Files
kayobe/ansible/roles/kolla-ansible/tasks/config.yml
Mark Goddard efb8b8bd27 Use docker_custom_config variable
In the Train cycle, Kolla Ansible added support for
docker_custom_config, and writes out configuration to
/etc/docker/daemon.json. This will conflict with Kayobe's configuration
of that file, and changes made by kayobe will be reversed when
kolla-ansible bootstrap-servers is run.

This change uses the new variable to pass daemon.json configuration
through to kolla ansible. Because the ordering has changed, we also need
to separate out the devicemapper setup and run this prior to starting
docker.

Change-Id: Idc3fa9fefd8242ef9db76d4d773885e3594b453a
Depends-On: https://review.opendev.org/691001
Story: 2006764
Task: 37277
2019-10-25 17:08:56 +01:00

114 lines
3.4 KiB
YAML

---
# NOTE: We're not looping over the two inventory files to avoid having the file
# content displayed in the ansible-playbook output.
- name: Check whether the legacy Kolla overcloud inventory files exist
stat:
path: "{{ item }}"
get_attributes: no
get_checksum: no
get_mime: no
register: inventory_stat
with_items:
- "{{ kolla_seed_inventory_path }}"
- "{{ kolla_overcloud_inventory_path }}"
loop_control:
label: "{{ item | basename }}"
- name: Ensure the legacy Kolla overcloud inventory file is absent
file:
path: "{{ item.item }}"
state: absent
with_items: "{{ inventory_stat.results }}"
when:
- item.stat.exists
- item.stat.isreg
loop_control:
label: "{{ item.item | basename }}"
- name: Ensure the Kolla Ansible configuration directories exist
file:
path: "{{ item }}"
state: directory
owner: "{{ ansible_user_uid }}"
group: "{{ ansible_user_gid }}"
mode: 0750
become: True
with_items:
- "{{ kolla_config_path }}"
- "{{ kolla_seed_inventory_path }}/host_vars"
- "{{ kolla_overcloud_inventory_path }}/host_vars"
- "{{ kolla_node_custom_config_path }}"
- name: Ensure the Kolla global configuration file exists
template:
src: "globals.yml.j2"
dest: "{{ kolla_config_path }}/globals.yml"
mode: 0640
vars:
kolla_docker_custom_config: "{{ lookup('template', 'daemon.json.j2') }}"
- name: Ensure the Kolla seed inventory file exists
copy:
content: "{{ kolla_seed_inventory }}"
dest: "{{ kolla_seed_inventory_path }}/hosts"
mode: 0640
- name: Ensure the Kolla seed host vars files exist
template:
src: host-vars.j2
dest: "{{ kolla_seed_inventory_path }}/host_vars/{{ host }}"
mode: 0640
with_inventory_hostnames: "seed"
vars:
host_vars: "{{ kolla_seed_inventory_pass_through_host_vars }}"
host_vars_map: "{{ kolla_seed_inventory_pass_through_host_vars_map }}"
loop_control:
loop_var: host
- name: Ensure the Kolla overcloud inventory file exists
copy:
content: "{{ kolla_overcloud_inventory }}"
dest: "{{ kolla_overcloud_inventory_path }}/hosts"
mode: 0640
- name: Ensure the Kolla overcloud host vars files exist
template:
src: host-vars.j2
dest: "{{ kolla_overcloud_inventory_path }}/host_vars/{{ host }}"
mode: 0640
with_inventory_hostnames: "{{ kolla_overcloud_top_level_groups }}"
vars:
host_vars: "{{ kolla_overcloud_inventory_pass_through_host_vars }}"
host_vars_map: "{{ kolla_overcloud_inventory_pass_through_host_vars_map }}"
loop_control:
loop_var: host
- name: Ensure the Kolla passwords file exists
kolla_passwords:
src: "{{ kolla_ansible_passwords_path }}"
dest: "{{ kolla_ansible_passwords_path }}"
mode: 0640
sample: "{{ kolla_ansible_install_dir }}/etc_examples/kolla/passwords.yml"
overrides: "{{ kolla_ansible_custom_passwords }}"
vault_password: "{{ kolla_ansible_vault_password }}"
virtualenv: "{{ kolla_ansible_venv or omit }}"
- name: Ensure the Kolla passwords file is copied into place
copy:
src: "{{ kolla_ansible_passwords_path }}"
dest: "{{ kolla_config_path }}/passwords.yml"
remote_src: True
- name: Ensure the HAProxy TLS certificate bundle is copied into place
block:
- file:
path: "{{ kolla_external_fqdn_cert | dirname }}"
state: directory
recurse: yes
- copy:
content: "{{ kolla_tls_cert }}"
dest: "{{ kolla_external_fqdn_cert }}"
when:
- kolla_tls_cert is not none