kolla-ansible/ansible/roles/bifrost/tasks/config.yml
Eduardo Gonzalez ea1a1dee0d Verify YAML syntax in gates
This patchset implements yamllint test to all *.yml
files.

Also fixes syntax errors to make jobs to pass.

Change-Id: I3186adf9835b4d0cada272d156b17d1bc9c2b799
2018-03-26 17:56:22 +02:00

60 lines
1.8 KiB
YAML

---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
with_items:
- "bifrost"
- name: Generate bifrost configs
merge_yaml:
sources:
- "{{ role_path }}/templates/{{ item }}.yml.j2"
- "{{ node_custom_config }}/{{ item }}.yml"
- "{{ node_custom_config }}/bifrost/{{ item }}.yml"
dest: "{{ node_config_directory }}/bifrost/{{ item }}.yml"
mode: "0660"
become: true
with_items:
- "bifrost"
- "dib"
- "servers"
- name: Copying over rabbitmq config
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/bifrost/{{ item }}"
mode: "0660"
become: true
with_items:
- "rabbitmq-env.conf"
- name: Template ssh keys
template:
src: "{{ item.src }}"
dest: "{{ node_config_directory }}/bifrost/{{ item.dest }}"
mode: "0660"
become: true
with_items:
- { src: "id_rsa", dest: "id_rsa" }
- { src: "id_rsa.pub", dest: "id_rsa.pub" }
- { src: "ssh_config", dest: "ssh_config" }
# NOTE(mgoddard): The following task was lifted from a Bifrost play
# (playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml). Because
# Bifrost cannot modify /etc/hosts from within the container we must do it
# here.
- name: "Ensure /etc/hosts has good defaults"
lineinfile:
dest: "/etc/hosts"
regexp: "{{ item.regexp }}.*({{ ansible_hostname }}|localhost).*"
line: "{{ item.contents }}"
with_items:
- { regexp: '^127\.0\.0\.1', contents: '127.0.0.1 {{ ansible_hostname }} {{ ansible_fqdn }} localhost' }
- { regexp: '^::1', contents: '::1 {{ ansible_hostname }} {{ ansible_fqdn }} localhost ipv6-localhost ipv6-loopback' }
become: true