Files
browbeat/ansible/gather/roles/keystone/tasks/main.yml
Joe Talerico 8c668d51aa Gather script for containers
Currently our gather playbook assumes all configuration files will be in
/etc. This assumption isn't true with container deployments. Currently
the configuration files are located in
/var/lib/config-data/<service>/etc/<service>/.

The Gather script needs to support both container and non-container
deployments. This patchset updates the config parser python script
to check if a service is in the running containers list and then
determine it's appropriate path, grab all of multiple config files
in that path, then parse and drop them off for ansible to use.

This method automagically supports all possible mixes of containerized
uncontainerized services and will always grab the correct config even
if that changes build to build or run to run.

It's also easily extensible for many possible config locations or
different container types by adding another condition or additional
search paths.

Change-Id: I95a3059c7fc263733ac64aa894c6dbf11e2a909f
Closes-bug: #1701264
2017-07-13 10:02:13 -04:00

65 lines
2.5 KiB
YAML

---
#
# Tasks to set keystone facts
#
- name: Check that Keystone is installed
become: true
stat: path=/etc/keystone/keystone.conf
register: keystone_config
- name: Parse Keystone config
become: true
shell: python /tmp/openstack-config-parser.py keystone /tmp/out.yml
when: keystone_config.stat.exists
- name: Fetch output
fetch: src=/tmp/out.yml dest=/tmp/out.yml flat=yes
when: keystone_config.stat.exists
- name: Load configuration variables
include_vars: /tmp/out.yml
when: keystone_config.stat.exists
- name: Determine if Keystone is deployed in eventlet
shell: ps afx | grep "[Kk]eystone-all" -c
register: keystone_in_eventlet
changed_when: false
ignore_errors: True
- name: Set keystone_deployment variable to httpd
set_fact: openstack_keystone_deployment='httpd'
when: keystone_in_eventlet.stdout|int == 0
- name: Set keystone_deployment variable to eventlet
set_fact: openstack_keystone_deployment='eventlet'
when: keystone_in_eventlet.stdout|int > 0
- name: Determine number of keystone admin processes for httpd
shell: grep processes /etc/httpd/conf.d/10-keystone_wsgi_admin.conf | awk '{print $5}'| awk -F= '{print $2}'
register: keystone_admin_worker_processes
when: keystone_in_eventlet.stdout|int == 0
- name: Determine number of keystone admin threads for httpd
shell: grep threads /etc/httpd/conf.d/10-keystone_wsgi_admin.conf | awk '{print $6}'| awk -F= '{print $2}'
register: keystone_admin_worker_threads
when: keystone_in_eventlet.stdout|int == 0
- name: Determine number of keystone main threads for httpd
shell: grep threads /etc/httpd/conf.d/10-keystone_wsgi_main.conf | awk '{print $6}'| awk -F= '{print $2}'
register: keystone_main_worker_threads
when: keystone_in_eventlet.stdout|int == 0
- name: Determine number of keystone main processes for httpd
shell: grep threads /etc/httpd/conf.d/10-keystone_wsgi_main.conf | awk '{print $5}'| awk -F= '{print $2}'
register: keystone_main_worker_processes
when: keystone_in_eventlet.stdout|int == 0
- name: Set keystone httpd worker facts
set_fact:
openstack_S_keystone_S_admin_workers_S_processes: "{{ keystone_admin_worker_processes.stdout }}"
openstack_S_keystone_S_admin_workers_S_threads: "{{ keystone_admin_worker_threads.stdout }}"
openstack_S_keystone_S_main_workers_S_processes: "{{ keystone_main_worker_processes.stdout }}"
openstack_S_keystone_S_main_workers_S_threads: "{{ keystone_main_worker_threads.stdout }}"
when: keystone_in_eventlet.stdout|int == 0