2016-08-08 16:48:11 +00:00
|
|
|
---
|
|
|
|
- name: Ensuring config directories exist
|
2019-03-26 09:56:29 +00:00
|
|
|
file:
|
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
|
|
|
state: "directory"
|
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ barbican_services }}"
|
|
|
|
|
|
|
|
- name: Ensuring vassals config directories exist
|
|
|
|
vars:
|
|
|
|
service: "{{ barbican_services['barbican-api'] }}"
|
2016-08-08 16:48:11 +00:00
|
|
|
file:
|
|
|
|
path: "{{ node_config_directory }}/{{ item }}"
|
|
|
|
state: "directory"
|
2016-08-24 00:28:08 +07:00
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
|
|
|
become: true
|
2019-03-26 09:56:29 +00:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service.group]
|
|
|
|
- service.enabled | bool
|
2016-08-08 16:48:11 +00:00
|
|
|
with_items:
|
2016-10-11 10:05:07 +08:00
|
|
|
- "barbican-api/vassals"
|
2016-08-08 16:48:11 +00:00
|
|
|
|
2018-01-08 16:00:22 +07:00
|
|
|
- name: Check if policies shall be overwritten
|
2019-11-19 09:34:23 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
2018-01-08 16:00:22 +07:00
|
|
|
run_once: True
|
2019-11-19 09:34:23 +00:00
|
|
|
delegate_to: localhost
|
2018-01-08 16:00:22 +07:00
|
|
|
register: barbican_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/barbican/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set barbican policy file
|
|
|
|
set_fact:
|
|
|
|
barbican_policy_file: "{{ barbican_policy.results.0.stat.path | basename }}"
|
|
|
|
barbican_policy_file_path: "{{ barbican_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- barbican_policy.results
|
|
|
|
|
2016-08-08 16:48:11 +00:00
|
|
|
- name: Copying over config.json files for services
|
|
|
|
template:
|
2017-01-22 10:06:06 +08:00
|
|
|
src: "{{ item.key }}.json.j2"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-22 10:06:06 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ barbican_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart {{ item.key }} container
|
2016-08-08 16:48:11 +00:00
|
|
|
|
2016-10-11 10:05:07 +08:00
|
|
|
- name: Copying over barbican-api.ini
|
2017-01-22 10:06:06 +08:00
|
|
|
vars:
|
|
|
|
service: "{{ barbican_services['barbican-api'] }}"
|
2016-10-11 10:05:07 +08:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/barbican-api.ini.j2"
|
|
|
|
- "{{ node_custom_config }}/barbican-api/barbican-api.ini"
|
|
|
|
- "{{ node_custom_config }}/barbican-api/{{ inventory_hostname }}/barbican-api.ini"
|
|
|
|
dest: "{{ node_config_directory }}/barbican-api/vassals/barbican-api.ini"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-22 10:06:06 +08:00
|
|
|
when:
|
2019-03-26 09:56:29 +00:00
|
|
|
- inventory_hostname in groups[service.group]
|
2017-01-22 10:06:06 +08:00
|
|
|
- service.enabled | bool
|
|
|
|
notify:
|
|
|
|
- Restart barbican-api container
|
2016-10-11 10:05:07 +08:00
|
|
|
|
2017-06-01 18:16:29 +02:00
|
|
|
- name: Checking whether barbican-api-paste.ini file exists
|
|
|
|
vars:
|
2017-07-10 14:03:28 +09:00
|
|
|
service: "{{ barbican_services['barbican-api'] }}"
|
2019-11-19 09:34:23 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ node_custom_config }}/barbican/barbican-api-paste.ini"
|
2017-06-01 18:16:29 +02:00
|
|
|
run_once: True
|
2019-11-19 09:34:23 +00:00
|
|
|
delegate_to: localhost
|
2017-06-01 18:16:29 +02:00
|
|
|
register: check_barbican_api_paste_ini
|
|
|
|
when:
|
2019-03-26 09:56:29 +00:00
|
|
|
- inventory_hostname in groups[service.group]
|
2017-07-10 14:03:28 +09:00
|
|
|
- service.enabled | bool
|
2017-06-01 18:16:29 +02:00
|
|
|
|
2016-10-09 14:57:29 +08:00
|
|
|
- name: Copying over barbican-api-paste.ini
|
2017-01-22 10:06:06 +08:00
|
|
|
vars:
|
|
|
|
service: "{{ barbican_services['barbican-api'] }}"
|
2017-06-01 18:16:29 +02:00
|
|
|
template:
|
|
|
|
src: "{{ node_custom_config }}/barbican/barbican-api-paste.ini"
|
2016-10-09 14:57:29 +08:00
|
|
|
dest: "{{ node_config_directory }}/barbican-api/barbican-api-paste.ini"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-22 10:06:06 +08:00
|
|
|
when:
|
2019-03-26 09:56:29 +00:00
|
|
|
- inventory_hostname in groups[service.group]
|
2017-01-22 10:06:06 +08:00
|
|
|
- service.enabled | bool
|
2017-06-01 18:16:29 +02:00
|
|
|
- check_barbican_api_paste_ini.stat.exists
|
2017-01-22 10:06:06 +08:00
|
|
|
notify:
|
|
|
|
- Restart barbican-api container
|
2016-10-09 14:57:29 +08:00
|
|
|
|
2016-08-08 16:48:11 +00:00
|
|
|
- name: Copying over barbican.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2016-08-08 16:48:11 +00:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/barbican.conf.j2"
|
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/barbican.conf"
|
2017-01-22 10:06:06 +08:00
|
|
|
- "{{ node_custom_config }}/barbican/{{ item.key }}.conf"
|
2016-08-08 16:48:11 +00:00
|
|
|
- "{{ node_custom_config }}/barbican/{{ inventory_hostname }}/barbican.conf"
|
2017-01-22 10:06:06 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/barbican.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-22 10:06:06 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ barbican_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart {{ item.key }} container
|
2016-10-27 10:36:35 +02:00
|
|
|
|
2018-01-08 16:00:22 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 16:00:22 +07:00
|
|
|
src: "{{ barbican_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ barbican_policy_file }}"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-22 10:06:06 +08:00
|
|
|
when:
|
2018-01-08 16:00:22 +07:00
|
|
|
- barbican_policy_file is defined
|
2017-01-22 10:06:06 +08:00
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ barbican_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart {{ item.key }} container
|
|
|
|
|
2019-03-22 19:06:37 -06:00
|
|
|
- include_tasks: check-containers.yml
|
|
|
|
when: kolla_action != "config"
|