Cleaned up keystone adjustment.

This commit is contained in:
Alex Krzos 2015-12-02 22:04:47 -05:00
parent bd42b2c051
commit dee8295d8d

View File

@ -1,9 +1,8 @@
---
#
# Keystone tasks for browbeat
# * Change eventlet worker count or httpd process count
# * Change eventlet worker count or httpd process/thread count
# * Change keystone deployed in eventlet or httpd
# * Change keystone in httpd thread count
#
- name: Determine if keystone is deployed in eventlet
@ -11,34 +10,29 @@
register: deployed
when: "'not_defined' in '{{ keystone_deployment }}'"
ignore_errors: true
changed_when: false
- name: Set keystone_deployment variable to httpd
- name: Set keystone_deployment variable/fact to httpd
set_fact: keystone_deployment='httpd'
when: "'not_defined' in '{{ keystone_deployment }}' and deployed.stdout|int == 0"
- name: Set keystone_deployment variable to eventlet
- name: Set keystone_deployment variable/fact to eventlet
set_fact: keystone_deployment='eventlet'
when: "'not_defined' in '{{ keystone_deployment }}'"
- name: Get keystone admin ip address
command: crudini --get /etc/keystone/keystone.conf DEFAULT admin_bind_host
register: admin_ip_addr
changed_when: false
- name: Get keystone admin ip address
- name: Get keystone public ip address
command: crudini --get /etc/keystone/keystone.conf DEFAULT public_bind_host
register: public_ip_addr
changed_when: false
- name: Unmanage Keystone Service from pacemaker
shell: pcs resource unmanage openstack-keystone
- name: Unmanage httpd Service from pacemaker
shell: pcs resource unmanage httpd
- name: Stop Keystone Service
service: name=openstack-keystone state=stopped
- name: Stop httpd services
service: name=httpd state=stopped
#
# Configure keystone eventlet/httpd
#
- name: Configure eventlet workers
ini_file:
@ -72,7 +66,7 @@
group: keystone
when: "'httpd' in '{{ keystone_deployment }}'"
- name: Copy Keystone in httpd files over
- name: Copy keystone in httpd files over
copy:
src: keystone_httpd
dest: /var/www/cgi-bin/keystone/{{ item }}
@ -104,7 +98,7 @@
threads: "{{ threads }}"
when: "'httpd' in '{{ keystone_deployment }}'"
- name: Configure httpd ports.conf for keystone
- name: Configure/Unconfigure httpd ports.conf for keystone
template:
src=keystone_ports.conf.j2
dest=/etc/httpd/conf/ports.conf
@ -116,16 +110,55 @@
public_ip_address: "{{ public_ip_addr.stdout }}"
deployment: "{{ keystone_deployment }}"
- name: Start Keystone services
service: name=openstack-keystone state=started
#
# Umanage all services from pacemaker, stop keystone eventlet and restart
# httpd for keystone in httpd
#
- name: Set pacemaker default to unmanaged for httpd
command: pcs property set is-managed-default=false
when: "'httpd' in '{{ keystone_deployment }}'"
- name: Stop keystone service
service: name=openstack-keystone state=stopped
when: "'httpd' in '{{ keystone_deployment }}'"
- name: Restart httpd service
service: name=httpd state=restarted
when: "'httpd' in '{{ keystone_deployment }}'"
#
# Restart and manage keystone/httpd correctly for keystone in eventlet
#
- name: Unmanage keystone service from pacemaker
command: pcs resource unmanage openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Start httpd services
service: name=httpd state=started
- name: Manage Keystone Service from pacemaker
shell: pcs resource manage openstack-keystone
- name: Unmanage httpd service from pacemaker
command: pcs resource unmanage httpd
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Manage httpd Service from pacemaker
shell: pcs resource manage openstack-keystone
- name: Restart httpd service
service: name=httpd state=restarted
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Restart keystone service
service: name=openstack-keystone state=restarted
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Manage keystone service from pacemaker
command: pcs resource manage openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Manage httpd service from pacemaker
command: pcs resource manage httpd
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Set pacemaker default to managed for eventlet
command: pcs property set is-managed-default=true
when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Cleanup keystone service in pacemaker
command: pcs resource cleanup openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}'"