diff --git a/ansible/roles/aodh/tasks/config.yml b/ansible/roles/aodh/tasks/config.yml index b6720ba575..ce986df30c 100644 --- a/ansible/roles/aodh/tasks/config.yml +++ b/ansible/roles/aodh/tasks/config.yml @@ -63,6 +63,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/aodh/policy.json" + run_once: True register: aodh_policy - name: Copying over existing policy.json diff --git a/ansible/roles/barbican/tasks/config.yml b/ansible/roles/barbican/tasks/config.yml index d4927eae5e..4fd0eb349b 100644 --- a/ansible/roles/barbican/tasks/config.yml +++ b/ansible/roles/barbican/tasks/config.yml @@ -83,6 +83,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/barbican/policy.json" + run_once: True register: barbican_policy - name: Copying over existing policy.json diff --git a/ansible/roles/ceilometer/tasks/config.yml b/ansible/roles/ceilometer/tasks/config.yml index 52ef3318a4..c829c08802 100644 --- a/ansible/roles/ceilometer/tasks/config.yml +++ b/ansible/roles/ceilometer/tasks/config.yml @@ -109,6 +109,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/ceilometer/policy.json" + run_once: True register: ceilometer_policy - name: Copying over existing policy.json diff --git a/ansible/roles/ceph/tasks/start_rgw_keystone.yml b/ansible/roles/ceph/tasks/start_rgw_keystone.yml index 5409644a19..6c845253d1 100644 --- a/ansible/roles/ceph/tasks/start_rgw_keystone.yml +++ b/ansible/roles/ceph/tasks/start_rgw_keystone.yml @@ -2,6 +2,7 @@ - name: Check whether the swift service is enabled local_action: fail msg='Ceph-rgw-keystone is conflicted with swift, you should only enable one of them' when: enable_swift | bool + run_once: True - name: Creating the Swift service and endpoint kolla_toolbox: diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 3f808ddde0..1a3d6da3e3 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -69,6 +69,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/cinder/policy.json" + run_once: True register: cinder_policy - name: Copying over existing policy.json diff --git a/ansible/roles/cloudkitty/tasks/config.yml b/ansible/roles/cloudkitty/tasks/config.yml index da333341f5..da56b0c3ed 100644 --- a/ansible/roles/cloudkitty/tasks/config.yml +++ b/ansible/roles/cloudkitty/tasks/config.yml @@ -46,6 +46,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/cloudkitty/policy.json" + run_once: True register: cloudkitty_policy - name: Copying over existing policy.json diff --git a/ansible/roles/congress/tasks/config.yml b/ansible/roles/congress/tasks/config.yml index dc78e50164..1a3db435ee 100644 --- a/ansible/roles/congress/tasks/config.yml +++ b/ansible/roles/congress/tasks/config.yml @@ -42,6 +42,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/congress/policy.json" + run_once: True register: congress_policy - name: Copying over existing policy.json diff --git a/ansible/roles/designate/tasks/config.yml b/ansible/roles/designate/tasks/config.yml index f88ddb9a69..7c333a6c30 100644 --- a/ansible/roles/designate/tasks/config.yml +++ b/ansible/roles/designate/tasks/config.yml @@ -118,6 +118,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/designate/policy.json" + run_once: True register: designate_policy - name: Copying over existing policy.json diff --git a/ansible/roles/freezer/tasks/config.yml b/ansible/roles/freezer/tasks/config.yml index 970e8715f0..aef83f44b2 100644 --- a/ansible/roles/freezer/tasks/config.yml +++ b/ansible/roles/freezer/tasks/config.yml @@ -56,6 +56,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_config_directory }}/freezer/policy.json" + run_once: True register: freezer_policy - name: Copying over existing policy.json diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index 719f92392a..db3c69362f 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -46,6 +46,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/glance/policy.json" + run_once: True register: glance_policy - name: Copying over existing policy.json diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index 76cdb04d49..afec2e4dc8 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -63,6 +63,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/gnocchi/policy.json" + run_once: True register: gnocchi_policy - name: Copying over existing policy.json diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index 0f8340ca97..cbdd938ac4 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -55,6 +55,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/heat/policy.json" + run_once: True register: heat_policy - name: Copying over existing policy.json diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml index 1ef693b416..12836efaab 100644 --- a/ansible/roles/horizon/tasks/config.yml +++ b/ansible/roles/horizon/tasks/config.yml @@ -58,6 +58,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/horizon/{{ item.name }}_policy.json" + run_once: True register: custom_policy when: item.enabled | bool with_items: diff --git a/ansible/roles/ironic/tasks/config.yml b/ansible/roles/ironic/tasks/config.yml index a878f32f7e..57fad1ce49 100644 --- a/ansible/roles/ironic/tasks/config.yml +++ b/ansible/roles/ironic/tasks/config.yml @@ -83,6 +83,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/ironic/policy.json" + run_once: True register: ironic_policy - name: Copying over existing policy.json diff --git a/ansible/roles/ironic/tasks/precheck.yml b/ansible/roles/ironic/tasks/precheck.yml index 8a1b476bb4..0538436a6e 100644 --- a/ansible/roles/ironic/tasks/precheck.yml +++ b/ansible/roles/ironic/tasks/precheck.yml @@ -30,6 +30,7 @@ - name: Checking ironic-agent files exist for Ironic local_action: stat path="{{ node_custom_config }}/ironic/{{ item }}" + run_once: True register: result failed_when: not result.stat.exists when: diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index b31357612a..6f9ce59158 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -1,10 +1,12 @@ --- - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/keystone/policy.json" + run_once: True register: keystone_policy - name: Check if Keystone Domain specific settings enabled local_action: stat path="{{ node_custom_config }}/keystone/domains" + run_once: True register: keystone_domain_directory - name: Ensuring config directories exist diff --git a/ansible/roles/kuryr/tasks/config.yml b/ansible/roles/kuryr/tasks/config.yml index 21d5f49584..b5f999ba88 100644 --- a/ansible/roles/kuryr/tasks/config.yml +++ b/ansible/roles/kuryr/tasks/config.yml @@ -59,6 +59,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/kuryr/policy.json" + run_once: True register: kuryr_policy - name: Copying over existing policy.json diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index 9b4e71f880..2203b6f99c 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -46,6 +46,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/magnum/policy.json" + run_once: True register: magnum_policy - name: Copying over existing policy.json diff --git a/ansible/roles/manila/tasks/config.yml b/ansible/roles/manila/tasks/config.yml index 49f077cf75..0b7927c053 100644 --- a/ansible/roles/manila/tasks/config.yml +++ b/ansible/roles/manila/tasks/config.yml @@ -73,6 +73,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/manila/policy.json" + run_once: True register: manila_policy - name: Copying over existing policy.json diff --git a/ansible/roles/mistral/tasks/config.yml b/ansible/roles/mistral/tasks/config.yml index 4410e8384b..717dc7073b 100644 --- a/ansible/roles/mistral/tasks/config.yml +++ b/ansible/roles/mistral/tasks/config.yml @@ -42,6 +42,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/mistral/policy.json" + run_once: True register: mistral_policy - name: Copying over existing policy.json diff --git a/ansible/roles/murano/tasks/config.yml b/ansible/roles/murano/tasks/config.yml index 392863d1b5..8f899fe6ce 100644 --- a/ansible/roles/murano/tasks/config.yml +++ b/ansible/roles/murano/tasks/config.yml @@ -35,6 +35,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/murano/policy.json" + run_once: True register: murano_policy - name: Copying over existing policy.json diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml index bbb70b39f8..e64493b8f1 100644 --- a/ansible/roles/neutron/tasks/config.yml +++ b/ansible/roles/neutron/tasks/config.yml @@ -265,6 +265,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/neutron/policy.json" + run_once: True register: neutron_policy - name: Copying over nsx.ini diff --git a/ansible/roles/neutron/tasks/precheck.yml b/ansible/roles/neutron/tasks/precheck.yml index f5329462b6..e357ab4383 100644 --- a/ansible/roles/neutron/tasks/precheck.yml +++ b/ansible/roles/neutron/tasks/precheck.yml @@ -19,6 +19,7 @@ - name: Checking number of network agents local_action: fail msg="Number of network agents are less than two when enabling agent ha" changed_when: false + run_once: True when: - enable_neutron_agent_ha | bool - groups['neutron-dhcp-agent'] | length < 2 diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index 2085d50d4f..29f5bc6294 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -115,6 +115,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/nova/policy.json" + run_once: True register: nova_policy - name: Copying over existing policy.json diff --git a/ansible/roles/nova/tasks/external-ceph.yml b/ansible/roles/nova/tasks/external-ceph.yml index 2ce1bfca57..23011f8779 100644 --- a/ansible/roles/nova/tasks/external-ceph.yml +++ b/ansible/roles/nova/tasks/external-ceph.yml @@ -10,12 +10,14 @@ - name: Check nova keyring file local_action: stat path="{{ node_custom_config }}/nova/ceph.client.nova.keyring" + run_once: True register: nova_cephx_keyring_file failed_when: not nova_cephx_keyring_file.stat.exists when: external_ceph_cephx_enabled | bool - name: Check cinder keyring file local_action: stat path="{{ node_custom_config }}/nova/ceph.client.cinder.keyring" + run_once: True register: cinder_cephx_keyring_file failed_when: not cinder_cephx_keyring_file.stat.exists when: @@ -61,11 +63,13 @@ - name: Extract nova key from file local_action: shell cat "{{ nova_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }' + run_once: True register: nova_cephx_raw_key when: external_ceph_cephx_enabled | bool - name: Extract cinder key from file local_action: shell cat "{{ cinder_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }' + run_once: True register: cinder_cephx_raw_key when: - cinder_backend_ceph | bool diff --git a/ansible/roles/octavia/tasks/precheck.yml b/ansible/roles/octavia/tasks/precheck.yml index 2326739cd4..9aa417b9c8 100644 --- a/ansible/roles/octavia/tasks/precheck.yml +++ b/ansible/roles/octavia/tasks/precheck.yml @@ -30,6 +30,7 @@ - name: Checking certificate files exist for octavia local_action: stat path="{{ node_custom_config }}/octavia/{{ item }}" + run_once: True register: result failed_when: not result.stat.exists when: inventory_hostname in groups['octavia-worker'] diff --git a/ansible/roles/panko/tasks/config.yml b/ansible/roles/panko/tasks/config.yml index 1b8e0a4c9e..c79c265a2d 100644 --- a/ansible/roles/panko/tasks/config.yml +++ b/ansible/roles/panko/tasks/config.yml @@ -59,6 +59,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/panko/policy.json" + run_once: True register: panko_policy - name: Copying over existing policy.json diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index 79614881e7..1b09a607a0 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -8,6 +8,7 @@ - name: Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails local_action: command grep '^[^#].*:\s*$' "{{ CONFIG_DIR | default('/etc/kolla') }}/passwords.yml" + run_once: True register: result changed_when: false failed_when: result.stdout | regex_replace('(.*ssh_key.*)', '') | search(":") diff --git a/ansible/roles/rally/tasks/config.yml b/ansible/roles/rally/tasks/config.yml index be8d8ffbf5..cd846cb308 100644 --- a/ansible/roles/rally/tasks/config.yml +++ b/ansible/roles/rally/tasks/config.yml @@ -39,6 +39,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/rally/policy.json" + run_once: True register: rally_policy - name: Copying over existing policy.json diff --git a/ansible/roles/sahara/tasks/config.yml b/ansible/roles/sahara/tasks/config.yml index 36456b0ccc..785c9875fe 100644 --- a/ansible/roles/sahara/tasks/config.yml +++ b/ansible/roles/sahara/tasks/config.yml @@ -46,6 +46,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/sahara/policy.json" + run_once: True register: sahara_policy - name: Copying over existing policy.json diff --git a/ansible/roles/searchlight/tasks/config.yml b/ansible/roles/searchlight/tasks/config.yml index a3868da315..0e7f96809b 100644 --- a/ansible/roles/searchlight/tasks/config.yml +++ b/ansible/roles/searchlight/tasks/config.yml @@ -41,6 +41,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/searchlight/policy.json" + run_once: True register: searchlight_policy - name: Copying over existing policy.json diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index 4bb2878ca5..76a1229c67 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/tasks/config.yml @@ -46,6 +46,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/senlin/policy.json" + run_once: True register: senlin_policy - name: Copying over existing policy.json diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml index 3b81038ee9..82fd47cc15 100644 --- a/ansible/roles/swift/tasks/config.yml +++ b/ansible/roles/swift/tasks/config.yml @@ -155,6 +155,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/swift/policy.json" + run_once: True register: swift_policy - name: Copying over existing policy.json diff --git a/ansible/roles/tacker/tasks/config.yml b/ansible/roles/tacker/tasks/config.yml index 0918bd02f2..145300e582 100644 --- a/ansible/roles/tacker/tasks/config.yml +++ b/ansible/roles/tacker/tasks/config.yml @@ -44,6 +44,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/tacker/policy.json" + run_once: True register: tacker_policy - name: Copying over existing policy.json diff --git a/ansible/roles/watcher/tasks/config.yml b/ansible/roles/watcher/tasks/config.yml index 5037c87467..7cb1ba0a06 100644 --- a/ansible/roles/watcher/tasks/config.yml +++ b/ansible/roles/watcher/tasks/config.yml @@ -48,6 +48,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/watcher/policy.json" + run_once: True register: watcher_policy - name: Copying over existing policy.json diff --git a/ansible/roles/zun/tasks/config.yml b/ansible/roles/zun/tasks/config.yml index 9712b48bab..7935458606 100644 --- a/ansible/roles/zun/tasks/config.yml +++ b/ansible/roles/zun/tasks/config.yml @@ -57,6 +57,7 @@ - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/zun/policy.json" + run_once: True register: zun_policy - name: Copying over existing policy.json