Leif Madsen e9ee8a3705
Resolve linting issues for install/connmon.yml
Resolves linting issues:
* [ANSIBLE0012] Commands should not change things if nothing needs doing
* [ANSIBLE0010] Package installs should not use latest
* [ANSIBLE0013] Use shell only when shell functionality is required

Executed via: ansible-lint ansible/install/connmon.yml

Change-Id: Ibe52c904c1ebc083e4aa0db10034c1a628b215b8
2016-08-30 15:15:11 -04:00

41 lines
991 B
YAML

---
#
# Keystone connmon tasks
#
- name: Determine if keystone is deployed in eventlet
command: 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
command: grep -Eq 'connection\s?=\s?mysql:' /etc/keystone/keystone.conf
register: keystone_mysql
become: true
ignore_errors: true
changed_when: false
- name: Enable connmon in keystone.conf
command: sed -i 's/mysql:/mysql+connmon:/g' /etc/keystone/keystone.conf
when: keystone_mysql.rc == 0
become: true
notify:
- restart httpd
- unmanage keystone
- restart keystone
- manage keystone
- cleanup keystone