Skip to content

Instantly share code, notes, and snippets.

@Daviey
Created July 7, 2016 12:38
Show Gist options
  • Save Daviey/6538c85625fd5f39fdc3185f3d431efa to your computer and use it in GitHub Desktop.
Save Daviey/6538c85625fd5f39fdc3185f3d431efa to your computer and use it in GitHub Desktop.
---
- name: Check if Keystone Domain specific settings enabled
local_action: stat path="{{ node_custom_config }}/{{ item }}/domains"
register: keystone_domain_cfg
with_items:
- "keystone"
- name: DEBUG VAR
debug:
msg: "keystone_domain_cfg = {{ keystone_domain_cfg }}"
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
with_items:
- "keystone"
- name: Creating Keystone Domain direcory (if needed)
file:
dest: "{{ node_config_directory }}/{{ item }}/domains/"
state: "directory"
when:
keystone_domain_cfg.stat.exists
with_items:
- keystone
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
with_items:
- "keystone"
- name: Copying over keystone.conf
merge_configs:
vars:
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/keystone.conf.j2"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/keystone.conf"
- "{{ node_custom_config }}/keystone/{{ inventory_hostname }}/keystone.conf"
dest: "{{ node_config_directory }}/{{ item }}/keystone.conf"
with_items:
- "keystone"
- name: Copying Keystone Domain specific settings (if set)
copy:
src: "{{ item }}"
dest: "{{ node_config_directory }}/{{ item }}/domains/"
with_fileglob:
- "{{ node_custom_config }}/keystone/domains/*"
- name: Copying over wsgi-keystone.conf
template:
src: "wsgi-keystone.conf.j2"
dest: "{{ node_config_directory }}/keystone/wsgi-keystone.conf"
@Daviey
Copy link
Author

Daviey commented Jul 7, 2016

TASK [keystone : Check if Keystone Domain specific settings enabled] ***********
ok: [amcbk-db161203 -> localhost] => (item=keystone) => {"changed": false, "item": "keystone", "stat": {"exists": false}}
ok: [amcbk-qb161211 -> localhost] => (item=keystone) => {"changed": false, "item": "keystone", "stat": {"exists": false}}
ok: [amcbk-db161235 -> localhost] => (item=keystone) => {"changed": false, "item": "keystone", "stat": {"exists": false}}

TASK [keystone : DEBUG VAR] ****************************************************
ok: [amcbk-qb161211] => {
"msg": "keystone_domain_cfg = {'msg': u'All items completed', 'changed': False, 'results': [{u'stat': {u'exists': False}, u'changed': False, '_ansible_no_log': False, '_ansible_delegated_vars': {'ansible_host': u'localhost'}, '_ansible_item_result': True, 'item': u'keystone', 'invocation': {'module_name': u'stat', u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, u'get_checksum': True, u'follow': False, u'path': u'/etc/kolla/config/keystone/domains', u'get_md5': True}}}]}"
}
ok: [amcbk-db161203] => {
"msg": "keystone_domain_cfg = {'msg': u'All items completed', 'changed': False, 'results': [{u'stat': {u'exists': False}, u'changed': False, '_ansible_no_log': False, '_ansible_delegated_vars': {'ansible_host': u'localhost'}, '_ansible_item_result': True, 'item': u'keystone', 'invocation': {'module_name': u'stat', u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, u'get_checksum': True, u'follow': False, u'path': u'/etc/kolla/config/keystone/domains', u'get_md5': True}}}]}"
}
ok: [amcbk-db161235] => {
"msg": "keystone_domain_cfg = {'msg': u'All items completed', 'changed': False, 'results': [{u'stat': {u'exists': False}, u'changed': False, '_ansible_no_log': False, '_ansible_delegated_vars': {'ansible_host': u'localhost'}, '_ansible_item_result': True, 'item': u'keystone', 'invocation': {'module_name': u'stat', u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, u'get_checksum': True, u'follow': False, u'path': u'/etc/kolla/config/keystone/domains', u'get_md5': True}}}]}"
}

TASK [keystone : Ensuring config directories exist] ****************************
ok: [amcbk-qb161211] => (item=keystone) => {"changed": false, "gid": 0, "group": "root", "item": "keystone", "mode": "0755", "owner": "root", "path": "/etc/kolla//keystone", "size": 83, "state": "directory", "uid": 0}
ok: [amcbk-db161203] => (item=keystone) => {"changed": false, "gid": 0, "group": "root", "item": "keystone", "mode": "0755", "owner": "root", "path": "/etc/kolla//keystone", "size": 6, "state": "directory", "uid": 0}
ok: [amcbk-db161235] => (item=keystone) => {"changed": false, "gid": 0, "group": "root", "item": "keystone", "mode": "0755", "owner": "root", "path": "/etc/kolla//keystone", "size": 83, "state": "directory", "uid": 0}

TASK [keystone : Creating Keystone Domain direcory (if needed)] ****************
fatal: [amcbk-qb161211]: FAILED! => {"failed": true, "msg": "The conditional check 'keystone_domain_cfg.stat.exists' failed. The error was: error while evaluating conditional (keystone_domain_cfg.stat.exists): 'dict object' has no attribute 'stat'\n\nThe error appears to have been in '/usr/share/kolla/ansible/roles/keystone/tasks/config.yml': line 20, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Creating Keystone Domain direcory (if needed)\n ^ here\n"}
fatal: [amcbk-db161235]: FAILED! => {"failed": true, "msg": "The conditional check 'keystone_domain_cfg.stat.exists' failed. The error was: error while evaluating conditional (keystone_domain_cfg.stat.exists): 'dict object' has no attribute 'stat'\n\nThe error appears to have been in '/usr/share/kolla/ansible/roles/keystone/tasks/config.yml': line 20, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Creating Keystone Domain direcory (if needed)\n ^ here\n"}
fatal: [amcbk-db161203]: FAILED! => {"failed": true, "msg": "The conditional check 'keystone_domain_cfg.stat.exists' failed. The error was: error while evaluating conditional (keystone_domain_cfg.stat.exists): 'dict object' has no attribute 'stat'\n\nThe error appears to have been in '/usr/share/kolla/ansible/roles/keystone/tasks/config.yml': line 20, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Creating Keystone Domain direcory (if needed)\n ^ here\n"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment