From 872233241bc2cdbd9a17cc61eff1d89f36e458d1 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Wed, 22 Jul 2020 21:25:59 +0000 Subject: [PATCH] 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 --- tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml | 7 +++++++ .../tasks/create_ceph_ansible_remote_tmp.yml | 1 + tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml | 1 + 3 files changed, 9 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml b/tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml index 293e79834..e6f1c0dc4 100644 --- a/tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml @@ -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) diff --git a/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml b/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml index 23bfbd280..82d5541eb 100644 --- a/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml +++ b/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml @@ -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 diff --git a/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml b/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml index bacca8774..204216523 100644 --- a/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml +++ b/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml @@ -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