Cleaned up connmon install and added monitor keystone tasks.

This commit is contained in:
Alex Krzos 2015-12-05 22:52:10 -05:00
parent f99b6f9073
commit aa9729d3e4
4 changed files with 79 additions and 16 deletions

View File

@ -14,20 +14,14 @@
#
# Connmon Setup
#
- name: Copy Connmon config
copy:
src: connmon.cfg
dest: /etc/connmon.cfg
mode: 0644
when: connmon
- name: Check connmon is configured
shell: grep -q "{{ connmon_host }}" /etc/connmon.cfg
ignore_errors: yes
register: connmon_conf
changed_when: false
- name: Configure Connmon Host IP Address
template:
src=connmon.cfg.j2
dest=/etc/connmon.cfg
owner=root
group=root
mode=0644
with_items:
- ip_address: "{{ connmon_host }}"
when: connmon
- name: Config Connmon Host IP Address
shell: sed -i 's/localhost/{{ connmon_host }}/g' /etc/connmon.cfg
when: connmon and connmon_conf.rc == 1

View File

@ -2,4 +2,4 @@
name: default
csv_dump: ./csv_results.csv
nodes:
node1 hostname=localhost:5800 bind=0.0.0.0
node1 hostname={{ item.ip_address }}:5800 bind=0.0.0.0

View File

@ -8,6 +8,7 @@
changed_when: false
when: connmon
register: connmon_port
ignore_errors: true
- name: open up iptables
shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 5800 -j ACCEPT

View File

@ -2,3 +2,71 @@
#
# Keystone tasks
#
- name: Determine if keystone is deployed in eventlet
shell: ps afx | grep "[Kk]eystone-all" -c
register: deployed
ignore_errors: true
changed_when: false
- name: Set keystone_deployment variable/fact to httpd
set_fact: keystone_deployment='httpd'
when: deployed.stdout|int == 0
- name: Set keystone_deployment variable/fact to eventlet
set_fact: keystone_deployment='eventlet'
when: deployed.stdout|int > 0
#
# Configure connmon in keystone.conf
#
- name: Check for connmon in keystone.conf
shell: grep -q 'connection = mysql:' /etc/keystone/keystone.conf
when: connmon
register: keystone_mysql
ignore_errors: true
changed_when: false
- name: Enable connmon in keystone.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/keystone/keystone.conf
when: connmon and keystone_mysql.rc == 0
- name: Check for connmon_service in keystone.conf
shell: grep -q 'connmon_service' /etc/keystone/keystone.conf
when: connmon
ignore_errors: true
register: keystone_connmon_service
changed_when: false
- name: Enable connmon in nova.conf
shell: sed -i '/connection = mysql/s/$/?connmon_service=default/' /etc/keystone/keystone.conf
when: connmon and keystone_connmon_service.rc == 1
#
# Restart keystone when in httpd
#
- name: Restart httpd service
service: name=httpd state=restarted
when: "'httpd' in '{{ keystone_deployment }}'"
#
# Restart keystone when in eventlet
#
- name: Unmanage keystone service from pacemaker
command: pcs resource unmanage openstack-keystone
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: Cleanup keystone service in pacemaker
command: pcs resource cleanup openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}'"