Files
kolla-ansible/ansible/post-deploy.yml
Michal Nasiadka 78f3c2b5de ansible-lint: Remove yaml[truthy] from excludes
Normalize quotes and some other easy fixes done by
ansible-lint --fix

Also drop etc from excludes and ignore comment check in
etc/kolla/globals.yml

Pinning to ansible-lint<25.11.0 because 25.11.1 is breaking
without any messages

Change-Id: I7dee3866191cef84cd12b1816cdab0a02380ec7f
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-11-28 09:06:26 +00:00

72 lines
2.2 KiB
YAML

---
- name: Determining whether we need become=true
hosts: localhost
gather_facts: false
tasks:
- name: Get stats of {{ node_config }}
stat:
path: "{{ node_config }}"
register: st
- name: Set become fact
set_fact:
needs_root: "{{ not (st.stat.writeable | bool) }}"
- name: Creating clouds.yaml file on the deploy node
hosts: localhost
tasks:
- name: Template out clouds.yaml
become: "{{ needs_root }}"
template:
src: "roles/common/templates/clouds.yaml.j2"
dest: "{{ node_config }}/clouds.yaml"
owner: "{{ ansible_facts.user_uid }}"
group: "{{ ansible_facts.user_gid }}"
mode: "0600"
- name: Creating admin openrc file on the deploy node
hosts: localhost
tasks:
- name: Template out admin-openrc.sh
become: "{{ needs_root }}"
template:
src: "roles/common/templates/admin-openrc.sh.j2"
dest: "{{ node_config }}/admin-openrc.sh"
owner: "{{ ansible_facts.user_uid }}"
group: "{{ ansible_facts.user_gid }}"
mode: "0600"
- name: Template out admin-openrc-system.sh
become: "{{ needs_root }}"
template:
src: "roles/common/templates/admin-openrc-system.sh.j2"
dest: "{{ node_config }}/admin-openrc-system.sh"
owner: "{{ ansible_facts.user_uid }}"
group: "{{ ansible_facts.user_gid }}"
mode: "0600"
- name: Template out public-openrc.sh
become: "{{ needs_root }}"
template:
src: "roles/common/templates/public-openrc.sh.j2"
dest: "{{ node_config }}/public-openrc.sh"
owner: "{{ ansible_facts.user_uid }}"
group: "{{ ansible_facts.user_gid }}"
mode: "0600"
- name: Template out public-openrc-system.sh
become: "{{ needs_root }}"
template:
src: "roles/common/templates/public-openrc-system.sh.j2"
dest: "{{ node_config }}/public-openrc-system.sh"
owner: "{{ ansible_facts.user_uid }}"
group: "{{ ansible_facts.user_gid }}"
mode: "0600"
- import_role:
name: octavia
tasks_from: openrc.yml
vars:
octavia_openrc_become: "{{ needs_root }}"
when: enable_octavia | bool