Skip to content

Commit 5e41529

Browse files
authored
Fully qualify seed container images (#2202)
Use Kayobe action_plugins to direct calls to the correct container_engine. Seed hosts configured to use the Podman container engine do not automatically resolve image short-names to docker.io like seed hosts using the Docker container engine. Fully qualify seed container images so that Podman does not fail to resolve them out of the box.
1 parent 34d4fec commit 5e41529

File tree

7 files changed

+28
-14
lines changed

7 files changed

+28
-14
lines changed

etc/kayobe/ansible/fixes/hotfix-containers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- container_hotfix_container_regex == "" or container_hotfix_command == "" and container_hotfix_files == []
2525

2626
- name: Get list of containers to hotfix
27-
ansible.builtin.command: '{{ kolla_container_engine | default("docker") }} ps --format {% raw %}"{{ .Names }}"{% endraw %}'
27+
ansible.builtin.command: '{{ container_engine | default("docker") }} ps --format {% raw %}"{{ .Names }}"{% endraw %}'
2828
register: host_containers
2929

3030
- name: Set fact for containers list
@@ -64,6 +64,6 @@
6464
state: absent
6565

6666
- name: Restart containers if requested
67-
ansible.builtin.command: "{{ kolla_container_engine | default('docker') }} restart {{ item }}"
67+
ansible.builtin.command: "{{ container_engine | default('docker') }} restart {{ item }}"
6868
loop: "{{ containers_list | regex_findall(container_hotfix_container_regex, multiline=True) | list | unique }}"
6969
when: container_hotfix_restart_containers

etc/kayobe/ansible/fixes/run-container-hotfix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
when: container_hotfix_files != []
44
block:
55
- name: Ensure any required directories exist in container(s)
6-
ansible.builtin.command: "{{ kolla_container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} mkdir
6+
ansible.builtin.command: "{{ container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} mkdir
77
-p {{ item.dest | dirname }}"
88
loop: "{{ container_hotfix_files }}"
99

1010
- name: Copy file into container(s)
11-
ansible.builtin.command: "{{ kolla_container_engine | default('docker') }} cp /tmp/hotfix-files/{{ index }} {{ hotfix_container }}:{{ item.dest }}"
11+
ansible.builtin.command: "{{ container_engine | default('docker') }} cp /tmp/hotfix-files/{{ index }} {{ hotfix_container }}:{{ item.dest }}"
1212
loop: "{{ container_hotfix_files }}"
1313
loop_control:
1414
index_var: index
1515

1616
- name: Set mode for copied files
17-
ansible.builtin.command: "{{ kolla_container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} chmod
17+
ansible.builtin.command: "{{ container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} chmod
1818
{{ item.mode | default('400') }} {{ item.dest }}"
1919
loop: "{{ container_hotfix_files }}"
2020
loop_control:
2121
index_var: index
2222

2323
- name: Run container_hotfix_command
24-
ansible.builtin.command: "{{ kolla_container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} {{ container_hotfix_command }}"
24+
ansible.builtin.command: "{{ container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} {{ container_hotfix_command }}"
2525
when: container_hotfix_command

etc/kayobe/containers/pulp/post.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- name: Set the Pulp admin password
1111
become: true
1212
command: >-
13-
docker exec -u root pulp
13+
{{ container_engine | default("docker") }} exec -u root pulp
1414
bash -c
1515
"pulpcore-manager reset-admin-password -p \"{{ pulp_password }}\""
1616
no_log: true
@@ -21,7 +21,7 @@
2121
- name: Manage Pulp content checksums
2222
become: true
2323
command: >-
24-
docker exec -u root pulp
24+
{{ container_engine | default("docker") }} exec -u root pulp
2525
bash -c
2626
'pulpcore-manager handle-artifact-checksums'
2727
when:
@@ -31,7 +31,7 @@
3131
- name: Manage Pulp content image data
3232
become: true
3333
command: >-
34-
docker exec -u root pulp
34+
{{ container_engine | default("docker") }} exec -u root pulp
3535
bash -c
3636
'pulpcore-manager container-handle-image-data'
3737
@@ -48,7 +48,7 @@
4848
- pulp_stack_password is defined and pulp_stack_password | length > 0
4949

5050
- name: Login to docker registry
51-
docker_login:
51+
kayobe_container_login:
5252
registry_url: "{{ kolla_docker_registry or omit }}"
5353
username: "{{ kolla_docker_registry_username }}"
5454
password: "{{ kolla_docker_registry_password }}"

etc/kayobe/containers/pulp/pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
become: true
77

88
- name: Ensure required Docker volumes exist
9-
docker_volume:
9+
kayobe_container_volume:
1010
name: "{{ item }}"
1111
loop:
1212
- pulp_containers
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- name: Restart redfish exporter container if config changed
33
become: true
4-
command: docker kill -s SIGHUP redfish_exporter
4+
command: >-
5+
{{ container_engine | default("docker") }} kill -s SIGHUP redfish_exporter
56
when:
67
- redfish_exporter_config is changed

etc/kayobe/seed.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ seed_pulp_container_enabled: true
102102

103103
seed_pulp_container:
104104
pulp:
105-
image: pulp/pulp
105+
image: quay.io/pulp/pulp
106106
pre: "{{ kayobe_config_path }}/containers/pulp/pre.yml"
107107
post: "{{ kayobe_config_path }}/containers/pulp/post.yml"
108108
tag: "3.81.0"
@@ -127,7 +127,7 @@ seed_squid_container_enabled: false
127127

128128
seed_squid_container:
129129
squid:
130-
image: stackhpc/squid
130+
image: docker.io/stackhpc/squid
131131
pre: "{{ kayobe_config_path }}/containers/squid_proxy/pre.yml"
132132
tag: "4.15"
133133
network_mode: host
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
fixes:
3+
- |
4+
Ensure that seed hosts using Podman pull seed container
5+
images using their fully-qualified name, rather than
6+
their short-name.
7+
- |
8+
Ensure that the ``container_engine variable`` is respected
9+
when running ``pre.yaml`` and ``post.yaml`` for seed
10+
containers.
11+
- |
12+
Replace instances of ``kolla_container_engine`` with
13+
``container_engine``.

0 commit comments

Comments
 (0)