diff --git a/ansible/gather/roles/ceilometer/tasks/main.yml b/ansible/gather/roles/ceilometer/tasks/main.yml index 28827a78d..66906eb26 100644 --- a/ansible/gather/roles/ceilometer/tasks/main.yml +++ b/ansible/gather/roles/ceilometer/tasks/main.yml @@ -2,20 +2,16 @@ # # Tasks to get ceilometer facts # -- name: Check that Ceilometer is installed - become: true - stat: path=/etc/ceilometer/ceilometer.conf - register: ceilometer_config - - name: Parse Ceilometer config become: true command: python /tmp/openstack-config-parser.py ceilometer /tmp/out.yml - when: ceilometer_config.stat.exists + register: ceilometer_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: ceilometer_config.stat.exists + when: ceilometer_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: ceilometer_config.stat.exists + when: ceilometer_parsed is succeeded diff --git a/ansible/gather/roles/cinder/tasks/main.yml b/ansible/gather/roles/cinder/tasks/main.yml index 508d71a60..a7255b51a 100644 --- a/ansible/gather/roles/cinder/tasks/main.yml +++ b/ansible/gather/roles/cinder/tasks/main.yml @@ -2,20 +2,16 @@ # # Tasks to get cinder facts # -- name: Check that Ceilometer is installed - become: true - stat: path=/etc/cinder/cinder.conf - register: cinder_config - - name: Parse Cinder config become: true command: python /tmp/openstack-config-parser.py cinder /tmp/out.yml - when: cinder_config.stat.exists + register: cinder_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: cinder_config.stat.exists + when: cinder_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: cinder_config.stat.exists + when: cinder_parsed is succeeded diff --git a/ansible/gather/roles/glance/tasks/main.yml b/ansible/gather/roles/glance/tasks/main.yml index 532ca80e4..d9396ca4c 100644 --- a/ansible/gather/roles/glance/tasks/main.yml +++ b/ansible/gather/roles/glance/tasks/main.yml @@ -6,9 +6,13 @@ - name: Parse Glance config files become: true command: "python /tmp/openstack-config-parser.py glance /tmp/out.yml" + register: glance_parsed + ignore_errors: true - name: Fetch output - fetch: "src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes" + fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes + when: glance_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml + when: glance_parsed is succeeded diff --git a/ansible/gather/roles/gnocchi/tasks/main.yml b/ansible/gather/roles/gnocchi/tasks/main.yml index b5551d44d..c08d104f9 100644 --- a/ansible/gather/roles/gnocchi/tasks/main.yml +++ b/ansible/gather/roles/gnocchi/tasks/main.yml @@ -3,20 +3,16 @@ # Tasks to get gnocchi config data # -- name: Check that Gnocchi is installed - become: true - stat: path=/etc/gnocchi/gnocchi.conf - register: gnocchi_config - - name: Parse Gnocchi config become: true command: python /tmp/openstack-config-parser.py gnocchi /tmp/out.yml - when: gnocchi_config.stat.exists + register: gnocchi_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: gnocchi_config.stat.exists + when: gnocchi_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: gnocchi_config.stat.exists + when: gnocchi_parsed is succeeded diff --git a/ansible/gather/roles/heat/tasks/main.yml b/ansible/gather/roles/heat/tasks/main.yml index 587b83d40..3da32d9ea 100644 --- a/ansible/gather/roles/heat/tasks/main.yml +++ b/ansible/gather/roles/heat/tasks/main.yml @@ -3,20 +3,16 @@ # Tasks to get heat facts # -- name: Check that Heat is installed - become: true - stat: path=/etc/heat/heat.conf - register: heat_config - - name: Parse Heat config become: true command: python /tmp/openstack-config-parser.py heat /tmp/out.yml - when: heat_config.stat.exists + register: heat_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: heat_config.stat.exists + when: heat_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: heat_config.stat.exists + when: heat_parsed is succeeded diff --git a/ansible/gather/roles/keystone/tasks/main.yml b/ansible/gather/roles/keystone/tasks/main.yml index c64750efc..9f5af6a2b 100644 --- a/ansible/gather/roles/keystone/tasks/main.yml +++ b/ansible/gather/roles/keystone/tasks/main.yml @@ -3,23 +3,19 @@ # Tasks to set keystone facts # -- name: Check that Keystone is installed - become: true - stat: path=/etc/keystone/keystone.conf - register: keystone_config - - name: Parse Keystone config become: true command: python /tmp/openstack-config-parser.py keystone /tmp/out.yml - when: keystone_config.stat.exists + register: keystone_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: keystone_config.stat.exists + when: keystone_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: keystone_config.stat.exists + when: keystone_parsed is succeeded - name: Determine if Keystone is deployed in eventlet shell: ps afx | grep "[Kk]eystone-all" -c diff --git a/ansible/gather/roles/mistral/tasks/main.yml b/ansible/gather/roles/mistral/tasks/main.yml index 724b96d1f..a1d4d793d 100644 --- a/ansible/gather/roles/mistral/tasks/main.yml +++ b/ansible/gather/roles/mistral/tasks/main.yml @@ -2,21 +2,16 @@ # # Tasks to get mistral facts # - -- name: Check that mistral is installed - become: true - stat: path=/etc/mistral/mistral.conf - register: mistral_config - - name: Parse Mistral config become: true command: python /tmp/openstack-config-parser.py mistral /tmp/out.yml - when: mistral_config.stat.exists + register: mistral_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: mistral_config.stat.exists + when: mistral_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: mistral_config.stat.exists + when: mistral_parsed is succeeded diff --git a/ansible/gather/roles/neutron/tasks/main.yml b/ansible/gather/roles/neutron/tasks/main.yml index d15b36769..04a6fe489 100644 --- a/ansible/gather/roles/neutron/tasks/main.yml +++ b/ansible/gather/roles/neutron/tasks/main.yml @@ -3,21 +3,16 @@ # Tasks to get neutron facts # -- name: Check that Neutron is installed - become: true - stat: path=/etc/neutron/neutron.conf - register: neutron_config - - name: Parse Neutron config become: true command: python /tmp/openstack-config-parser.py neutron /tmp/out.yml - when: neutron_config.stat.exists + register: neutron_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: neutron_config.stat.exists + when: neutron_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: neutron_config.stat.exists - + when: neutron_parsed is succeeded diff --git a/ansible/gather/roles/nova/tasks/main.yml b/ansible/gather/roles/nova/tasks/main.yml index 260509f87..c20d0257e 100644 --- a/ansible/gather/roles/nova/tasks/main.yml +++ b/ansible/gather/roles/nova/tasks/main.yml @@ -3,21 +3,16 @@ # Tasks to get nova facts # -- name: Check that Nova is installed - become: true - stat: path=/etc/nova/nova.conf - register: nova_config - - name: Parse Nova config become: true command: python /tmp/openstack-config-parser.py nova /tmp/out.yml - when: nova_config.stat.exists + register: nova_parsed + ignore_errors: true - name: Fetch output fetch: src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes - when: nova_config.stat.exists + when: nova_parsed is succeeded - name: Load configuration variables include_vars: /tmp/out-{{ inventory_hostname }}.yml - when: nova_config.stat.exists - + when: nova_parsed is succeeded diff --git a/ansible/gather/roles/undercloud/tasks/main.yml b/ansible/gather/roles/undercloud/tasks/main.yml index ce976f284..795938d1f 100644 --- a/ansible/gather/roles/undercloud/tasks/main.yml +++ b/ansible/gather/roles/undercloud/tasks/main.yml @@ -55,7 +55,7 @@ when: undercloud_conf.stat.exists - name: Get Controller Nodes number - shell: source ~/stackrc; nova list | grep controller | grep ACTIVE | wc -l + shell: source {{ ansible_env.HOME }}/stackrc; nova list | grep controller | grep ACTIVE | wc -l register: controller_count when: undercloud_conf.stat.exists @@ -65,7 +65,7 @@ when: undercloud_conf.stat.exists - name: Get Compute Nodes number - shell: source ~/stackrc; nova list | grep compute | grep ACTIVE | wc -l + shell: source {{ ansible_env.HOME }}/stackrc; nova list | grep compute | grep ACTIVE | wc -l register: compute_count when: undercloud_conf.stat.exists