Files
ansible-collection-kolla/roles/podman/tasks/config.yml
Michal Nasiadka 55d3c245c9 ansible-lint: Fix fqcn[action/action-core]
Change-Id: Idfbcfa8e9fc157c691ea30ebc5b6235ac4c3b436
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-11-21 14:17:13 +00:00

95 lines
2.5 KiB
YAML

---
- name: Ensure podman config directory exists
ansible.builtin.file:
path: /etc/containers/{{ item }}
state: directory
mode: "0755"
become: true
with_items:
- "containers.conf.d"
- "registries.conf.d"
- "storage.conf.d"
- name: Write registries config
become: true
vars:
registry: |
[[registry]]
location = "{{ podman_registry }}"
insecure = {{ podman_registry_insecure | bool | lower }}
ansible.builtin.copy:
content: "{{ registry }}"
dest: /etc/containers/registries.conf.d/registries.conf
mode: "0644"
when: podman_registry is not none
- name: Write registry mirror config
become: true
vars:
registry_mirror: |
[[registry.mirror]]
prefix = docker.io
location = "{{ podman_registry_mirror }}"
ansible.builtin.copy:
content: "{{ registry_mirror }}"
dest: /etc/containers/registries.conf.d/registry-mirror.conf
mode: "0644"
when: podman_registry_mirror is not none
- name: Write storage config
become: true
vars:
config: |
{% if podman_storage_driver is not none %}
driver = {{ podman_storage_driver }}
{% endif %}
{% if podman_runtime_directory is not none %}
runroot = {{ podman_runtime_directory }}
{% endif %}
ansible.builtin.copy:
content: "{{ config }}"
dest: /etc/containers/storage.conf.d/storage.conf
mode: "0644"
when: podman_storage_driver is not none or podman_runtime_directory is not none
- name: Ensure the path for CA file for podman registry exists
ansible.builtin.file:
path: "/etc/containers/certs.d/{{ podman_registry }}"
owner: root
group: root
mode: "0700"
state: directory
become: true
when:
- podman_registry is not none
- podman_registry_ca is not none
- not podman_registry_insecure | bool
- name: Write kolla.conf to containers.conf.d
ansible.builtin.template:
src: "kolla.conf.j2"
dest: "/etc/containers/containers.conf.d/kolla.conf"
mode: "0664"
become: true
- name: Ensure the CA file for private registry exists
ansible.builtin.copy:
src: "{{ private_registry_ca }}"
dest: "/etc/containers/certs.d/{{ private_registry }}/ca.crt"
owner: root
group: root
mode: "0600"
become: true
when:
- podman_registry is not none
- podman_registry_ca is not none
- not podman_registry_insecure | bool
- name: Copying over /run subdirectories conf
become: true
ansible.builtin.template:
src: kolla-directories.conf.j2
dest: /etc/tmpfiles.d/kolla.conf
mode: "0644"
notify: Restart systemd-tmpfiles