Merge "Define condition for the first play host one time"
This commit is contained in:
commit
6a53dd4505
@ -108,7 +108,7 @@
|
||||
dest: "{{ item.tmp_f }}"
|
||||
flat: yes
|
||||
changed_when: false
|
||||
run_once: true
|
||||
when: _glance_is_first_play_host
|
||||
with_items: "{{ glance_core_files }}"
|
||||
|
||||
- name: Copy common config
|
||||
@ -130,7 +130,7 @@
|
||||
state: absent
|
||||
changed_when: false
|
||||
delegate_to: localhost
|
||||
run_once: true
|
||||
when: _glance_is_first_play_host
|
||||
with_items: "{{ glance_core_files }}"
|
||||
|
||||
# NOTE(cloudnull): This will ensure strong permissions on all rootwrap files.
|
||||
|
@ -42,8 +42,7 @@
|
||||
|
||||
- import_tasks: db_setup.yml
|
||||
when:
|
||||
- "glance_services['glance-api']['group'] in group_names"
|
||||
- "inventory_hostname == ((groups[glance_services['glance-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
|
||||
- "_glance_is_first_play_host"
|
||||
vars:
|
||||
_oslodb_setup_host: "{{ glance_db_setup_host }}"
|
||||
_oslodb_ansible_python_interpreter: "{{ glance_db_setup_python_interpreter }}"
|
||||
@ -60,8 +59,7 @@
|
||||
|
||||
- import_tasks: mq_setup.yml
|
||||
when:
|
||||
- "glance_services['glance-api']['group'] in group_names"
|
||||
- "inventory_hostname == ((groups[glance_services['glance-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
|
||||
- "_glance_is_first_play_host"
|
||||
vars:
|
||||
_oslomsg_rpc_setup_host: "{{ glance_oslomsg_rpc_setup_host }}"
|
||||
_oslomsg_rpc_userid: "{{ glance_oslomsg_rpc_userid }}"
|
||||
@ -87,8 +85,7 @@
|
||||
|
||||
- import_tasks: glance_db_sync.yml
|
||||
when:
|
||||
- "glance_services['glance-api']['group'] in group_names"
|
||||
- "inventory_hostname == ((groups[glance_services['glance-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
|
||||
- "_glance_is_first_play_host"
|
||||
tags:
|
||||
- glance-config
|
||||
|
||||
@ -119,8 +116,7 @@
|
||||
url: "{{ glance_service_adminurl }}"
|
||||
service: "{{ glance_service_name }}"
|
||||
when:
|
||||
- "glance_services['glance-api']['group'] in group_names"
|
||||
- "inventory_hostname == ((groups[glance_services['glance-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
|
||||
- "_glance_is_first_play_host"
|
||||
tags:
|
||||
- glance-config
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_glance_is_first_play_host: "{{ (glance_services['glance-api']['group'] in group_names and inventory_hostname == (groups[glance_services['glance-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
|
||||
|
||||
#
|
||||
# Compile a list of the services on a host based on whether
|
||||
# the host is in the host group and the service is enabled.
|
||||
|
Loading…
x
Reference in New Issue
Block a user