Cleaned up connmon install and added monitor keystone tasks.
This commit is contained in:
parent
f99b6f9073
commit
aa9729d3e4
@ -14,20 +14,14 @@
|
|||||||
#
|
#
|
||||||
# Connmon Setup
|
# Connmon Setup
|
||||||
#
|
#
|
||||||
- name: Copy Connmon config
|
|
||||||
copy:
|
|
||||||
src: connmon.cfg
|
|
||||||
dest: /etc/connmon.cfg
|
|
||||||
mode: 0644
|
|
||||||
when: connmon
|
|
||||||
|
|
||||||
- name: Check connmon is configured
|
- name: Configure Connmon Host IP Address
|
||||||
shell: grep -q "{{ connmon_host }}" /etc/connmon.cfg
|
template:
|
||||||
ignore_errors: yes
|
src=connmon.cfg.j2
|
||||||
register: connmon_conf
|
dest=/etc/connmon.cfg
|
||||||
changed_when: false
|
owner=root
|
||||||
|
group=root
|
||||||
|
mode=0644
|
||||||
|
with_items:
|
||||||
|
- ip_address: "{{ connmon_host }}"
|
||||||
when: connmon
|
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
|
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
name: default
|
name: default
|
||||||
csv_dump: ./csv_results.csv
|
csv_dump: ./csv_results.csv
|
||||||
nodes:
|
nodes:
|
||||||
node1 hostname=localhost:5800 bind=0.0.0.0
|
node1 hostname={{ item.ip_address }}:5800 bind=0.0.0.0
|
@ -8,6 +8,7 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
when: connmon
|
when: connmon
|
||||||
register: connmon_port
|
register: connmon_port
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: open up iptables
|
- name: open up iptables
|
||||||
shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 5800 -j ACCEPT
|
shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 5800 -j ACCEPT
|
||||||
|
@ -2,3 +2,71 @@
|
|||||||
#
|
#
|
||||||
# Keystone tasks
|
# 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 }}'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user