Set ceph_ansible_limit to ansible_limit if ansible_limit defined

The 'openstack overcloud deploy ... --limit' command passes
the Ansible limit to the run of the config-download Ansible
but not to the run of ceph-ansible. To limit ceph-ansible
it's possible to override ceph_ansible_limit (an Ansible
variable) but, as per the bug this patch closes, this is
not possible via the deploy option of the tripleo client.
However, this patch makes it possible by having the variable
ceph_ansible_limit inherit the value of --limit but only
if it is passed. For backwards compatibility the inheritance
does not happen if ceph_ansible_limit is already defined.

Also, pass ceph_ansible_limit to the executions of the
machine unique UUID gather playbook and remote_tmp playbook.

Change-Id: Ibd1ca28592ba3dbbdd2dd129fe8319390f8435f3
Closes-Bug: 1888508
This commit is contained in:
John Fulton 2020-07-22 21:25:59 +00:00
parent 4cd03b45ac
commit 872233241b
3 changed files with 9 additions and 0 deletions

View File

@ -57,3 +57,10 @@
- name: Set common fact
set_fact:
ceph_common_done: true
- name: set ceph_ansible_limit to ansible_limit, only if ansible_limit defined
set_fact:
ceph_ansible_limit: "{{ ansible_limit }}"
when:
- (ceph_ansible_limit is not defined) or (ceph_ansible_limit|length == 0)
- (ansible_limit is defined) and (ansible_limit|length > 0)

View File

@ -54,6 +54,7 @@
- '{{ playbook_dir }}/ceph-ansible/inventory.yml'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ ansible_python_interpreter }}{% endif %}'
- "{{ playbook_dir }}/ceph-ansible/create_ceph_ansible_remote_tmp.yml"
- '{% if ceph_ansible_limit is defined and ceph_ansible_limit|length > 0 %}--limit {{ ceph_ansible_limit }}{% endif %}'
ceph_ansible_remote_tmp: '/tmp/ceph_ansible_tmp'
- name: run create_ceph_ansible_remote_tmp command

View File

@ -29,6 +29,7 @@
- '{{ playbook_dir }}/ceph-ansible/inventory.yml'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ ansible_python_interpreter }}{% endif %}'
- '{{ playbook_dir }}/ceph-ansible/nodes_uuid_playbook.yml'
- '{% if ceph_ansible_limit is defined and ceph_ansible_limit|length > 0 %}--limit {{ ceph_ansible_limit }}{% endif %}'
- name: run nodes-uuid command
# needs become to be able to read the ssh private key