diff --git a/ansible/browbeat/group_vars/all b/ansible/browbeat/group_vars/all deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/browbeat/group_vars/all +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/browbeat/group_vars/all.yml b/ansible/browbeat/group_vars/all.yml new file mode 100644 index 000000000..a34afa815 --- /dev/null +++ b/ansible/browbeat/group_vars/all.yml @@ -0,0 +1,3 @@ +--- +# If Pacemaker is managing services or not +pacemaker_controlled: false diff --git a/ansible/browbeat/roles/ceilometer-backend/handlers/main.yml b/ansible/browbeat/roles/ceilometer-backend/handlers/main.yml index fac0ef230..6c1964d45 100644 --- a/ansible/browbeat/roles/ceilometer-backend/handlers/main.yml +++ b/ansible/browbeat/roles/ceilometer-backend/handlers/main.yml @@ -6,6 +6,7 @@ - name: pacemaker default unmanaged become: true command: pcs property set is-managed-default=false + when: pacemaker_controlled - name: restart ceilometer services become: true @@ -15,6 +16,7 @@ - openstack-ceilometer-central - openstack-ceilometer-collector - openstack-ceilometer-notification + when: pacemaker_controlled - name: restart gnocchi services become: true @@ -26,6 +28,7 @@ - name: pacemaker default managed become: true command: pcs property set is-managed-default=true + when: pacemaker_controlled - name: pacemaker cleanup ceilometer become: true @@ -35,7 +38,7 @@ - openstack-ceilometer-central - openstack-ceilometer-collector - openstack-ceilometer-notification - when: inventory_hostname == groups['controller'][0] + when: inventory_hostname == groups['controller'][0] and pacemaker_controlled - name: pacemaker cleanup gnocchi become: true @@ -43,4 +46,4 @@ with_items: - openstack-gnocchi-metricd - openstack-gnocchi-statsd - when: inventory_hostname == groups['controller'][0] + when: inventory_hostname == groups['controller'][0] and pacemaker_controlled diff --git a/ansible/browbeat/roles/cinder-workers/handlers/main.yml b/ansible/browbeat/roles/cinder-workers/handlers/main.yml index 0888b5bd0..a83d6084a 100644 --- a/ansible/browbeat/roles/cinder-workers/handlers/main.yml +++ b/ansible/browbeat/roles/cinder-workers/handlers/main.yml @@ -9,6 +9,7 @@ with_items: - openstack-cinder-api ignore_errors: true + when: pacemaker_controlled - name: restart cinder services become: true @@ -22,6 +23,7 @@ with_items: - openstack-cinder-api ignore_errors: true + when: pacemaker_controlled - name: cleanup cinder services become: true @@ -29,3 +31,4 @@ with_items: - openstack-cinder-api ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/keystone-token/handlers/main.yml b/ansible/browbeat/roles/keystone-token/handlers/main.yml index d5bc37b5a..2fb7d90b0 100644 --- a/ansible/browbeat/roles/keystone-token/handlers/main.yml +++ b/ansible/browbeat/roles/keystone-token/handlers/main.yml @@ -6,6 +6,7 @@ - name: pacemaker default unmanaged become: true command: pcs property set is-managed-default=false + when: pacemaker_controlled - name: stop keystone service become: true @@ -25,10 +26,9 @@ - name: pacemaker default managed become: true command: pcs property set is-managed-default=true - when: "'eventlet' in '{{ keystone_deployment }}'" + when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled" -- name: pacemaker cleanup keystone become: true command: pcs resource cleanup openstack-keystone - when: "'eventlet' in '{{ keystone_deployment }}'" + when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled" ignore_errors: true diff --git a/ansible/browbeat/roles/keystone-workers/handlers/main.yml b/ansible/browbeat/roles/keystone-workers/handlers/main.yml index b6a0fda0e..36cd7af3a 100644 --- a/ansible/browbeat/roles/keystone-workers/handlers/main.yml +++ b/ansible/browbeat/roles/keystone-workers/handlers/main.yml @@ -7,6 +7,7 @@ become: true command: pcs property set is-managed-default=false ignore_errors: true + when: pacemaker_controlled - name: stop keystone eventlet become: true @@ -29,14 +30,16 @@ # OSP8 and below uncomment, so only pcs managed when keystone in eventlet # when: "'eventlet' in '{{ keystone_deployment }}'" ignore_errors: true + when: pacemaker_controlled - name: cleanup keystone become: true command: pcs resource cleanup openstack-keystone - when: "'eventlet' in '{{ keystone_deployment }}'" + when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled" ignore_errors: true - name: cleanup httpd become: true command: pcs resource cleanup httpd ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/keystone-workers/tasks/main.yml b/ansible/browbeat/roles/keystone-workers/tasks/main.yml index 63b64f42f..0e0fabee6 100644 --- a/ansible/browbeat/roles/keystone-workers/tasks/main.yml +++ b/ansible/browbeat/roles/keystone-workers/tasks/main.yml @@ -105,12 +105,12 @@ mode: 0644 backup: true with_items: - - ip_address: "{{ admin_ip_addr.stdout }}" + - ip_address: "{{ admin_ip_addr.stdout | default('') }}" interface: "admin" processes: "{{ workers }}" port: 35357 threads: "{{ threads }}" - - ip_address: "{{ public_ip_addr.stdout }}" + - ip_address: "{{ public_ip_addr.stdout | default('') }}" interface: "main" processes: "{{ workers }}" port: 5000 @@ -128,8 +128,8 @@ line: "Listen {{item}}" backup: true with_items: - - "{{ public_ip_addr.stdout }}:5000" - - "{{ admin_ip_addr.stdout }}:35357" + - "{{ public_ip_addr.stdout | default('') }}:5000" + - "{{ admin_ip_addr.stdout | default('') }}:35357" when: "'httpd' in '{{ keystone_deployment }}'" notify: - pacemaker unmanaged default @@ -145,8 +145,8 @@ line: "Listen {{item}}" state: absent with_items: - - "{{ public_ip_addr.stdout }}:5000" - - "{{ admin_ip_addr.stdout }}:35357" + - "{{ public_ip_addr.stdout | default('') }}:5000" + - "{{ admin_ip_addr.stdout | default('') }}:35357" when: "'eventlet' in '{{ keystone_deployment }}'" notify: - pacemaker unmanaged default diff --git a/ansible/browbeat/roles/neutron-l3/handlers/main.yml b/ansible/browbeat/roles/neutron-l3/handlers/main.yml index 24354005b..474924f40 100644 --- a/ansible/browbeat/roles/neutron-l3/handlers/main.yml +++ b/ansible/browbeat/roles/neutron-l3/handlers/main.yml @@ -9,6 +9,8 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled + - name: restart neutron services service: name={{ item }} state=restarted @@ -22,6 +24,7 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled - name: cleanup neutron services command: pcs resource cleanup {{ item }} @@ -29,3 +32,4 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/neutron-workers/handlers/main.yml b/ansible/browbeat/roles/neutron-workers/handlers/main.yml index c8ba618d0..045713f9b 100644 --- a/ansible/browbeat/roles/neutron-workers/handlers/main.yml +++ b/ansible/browbeat/roles/neutron-workers/handlers/main.yml @@ -10,6 +10,7 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled - name: restart neutron services become: true @@ -25,6 +26,7 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled - name: cleanup neutron services become: true @@ -33,3 +35,4 @@ - neutron-server - neutron-metadata-agent ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/nova-config/handlers/main.yml b/ansible/browbeat/roles/nova-config/handlers/main.yml index 308edbb1f..8cba11f7f 100644 --- a/ansible/browbeat/roles/nova-config/handlers/main.yml +++ b/ansible/browbeat/roles/nova-config/handlers/main.yml @@ -11,6 +11,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: restart nova services become: true @@ -28,6 +29,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: cleanup nova services become: true @@ -37,3 +39,4 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/nova-db/handlers/main.yml b/ansible/browbeat/roles/nova-db/handlers/main.yml index 3cec085cb..878a72b98 100644 --- a/ansible/browbeat/roles/nova-db/handlers/main.yml +++ b/ansible/browbeat/roles/nova-db/handlers/main.yml @@ -10,6 +10,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: restart nova services service: name={{ item }} state=restarted @@ -25,6 +26,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: cleanup nova services command: pcs resource cleanup {{ item }} @@ -33,3 +35,4 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled diff --git a/ansible/browbeat/roles/nova-workers/handlers/main.yml b/ansible/browbeat/roles/nova-workers/handlers/main.yml index 308edbb1f..8cba11f7f 100644 --- a/ansible/browbeat/roles/nova-workers/handlers/main.yml +++ b/ansible/browbeat/roles/nova-workers/handlers/main.yml @@ -11,6 +11,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: restart nova services become: true @@ -28,6 +29,7 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled - name: cleanup nova services become: true @@ -37,3 +39,4 @@ - openstack-nova-scheduler - openstack-nova-conductor ignore_errors: true + when: pacemaker_controlled