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 # 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 deployed in eventlet or httpd
# * Change keystone in httpd thread count
# #
- name: Determine if keystone is deployed in eventlet - name: Determine if keystone is deployed in eventlet
@ -11,34 +10,29 @@
register: deployed register: deployed
when: "'not_defined' in '{{ keystone_deployment }}'" when: "'not_defined' in '{{ keystone_deployment }}'"
ignore_errors: true 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' set_fact: keystone_deployment='httpd'
when: "'not_defined' in '{{ keystone_deployment }}' and deployed.stdout|int == 0" 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' set_fact: keystone_deployment='eventlet'
when: "'not_defined' in '{{ keystone_deployment }}'" when: "'not_defined' in '{{ keystone_deployment }}'"
- name: Get keystone admin ip address - name: Get keystone admin ip address
command: crudini --get /etc/keystone/keystone.conf DEFAULT admin_bind_host command: crudini --get /etc/keystone/keystone.conf DEFAULT admin_bind_host
register: admin_ip_addr 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 command: crudini --get /etc/keystone/keystone.conf DEFAULT public_bind_host
register: public_ip_addr register: public_ip_addr
changed_when: false
- name: Unmanage Keystone Service from pacemaker #
shell: pcs resource unmanage openstack-keystone # Configure keystone eventlet/httpd
#
- 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
- name: Configure eventlet workers - name: Configure eventlet workers
ini_file: ini_file:
@ -72,7 +66,7 @@
group: keystone group: keystone
when: "'httpd' in '{{ keystone_deployment }}'" when: "'httpd' in '{{ keystone_deployment }}'"
- name: Copy Keystone in httpd files over - name: Copy keystone in httpd files over
copy: copy:
src: keystone_httpd src: keystone_httpd
dest: /var/www/cgi-bin/keystone/{{ item }} dest: /var/www/cgi-bin/keystone/{{ item }}
@ -104,7 +98,7 @@
threads: "{{ threads }}" threads: "{{ threads }}"
when: "'httpd' in '{{ keystone_deployment }}'" when: "'httpd' in '{{ keystone_deployment }}'"
- name: Configure httpd ports.conf for keystone - name: Configure/Unconfigure httpd ports.conf for keystone
template: template:
src=keystone_ports.conf.j2 src=keystone_ports.conf.j2
dest=/etc/httpd/conf/ports.conf dest=/etc/httpd/conf/ports.conf
@ -116,16 +110,55 @@
public_ip_address: "{{ public_ip_addr.stdout }}" public_ip_address: "{{ public_ip_addr.stdout }}"
deployment: "{{ keystone_deployment }}" 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 }}'" when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Start httpd services - name: Unmanage httpd service from pacemaker
service: name=httpd state=started command: pcs resource unmanage httpd
- name: Manage Keystone Service from pacemaker
shell: pcs resource manage openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}'" when: "'eventlet' in '{{ keystone_deployment }}'"
- name: Manage httpd Service from pacemaker - name: Restart httpd service
shell: pcs resource manage openstack-keystone 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 }}'"