Browse Source

Merge "tripleo-container-manage: some improvements"

tags/1.0.0
Zuul 2 weeks ago
parent
commit
1e431d11f0
5 changed files with 17 additions and 14 deletions
  1. +1
    -1
      tripleo_ansible/roles/tripleo-container-manage/tasks/container_running.yml
  2. +1
    -0
      tripleo_ansible/roles/tripleo-container-manage/tasks/podman/create.yml
  3. +3
    -1
      tripleo_ansible/roles/tripleo-container-manage/tasks/podman/exec.yml
  4. +0
    -11
      tripleo_ansible/roles/tripleo-container-manage/tasks/podman/systemd.yml
  5. +12
    -1
      tripleo_ansible/roles/tripleo-container-manage/tasks/shutdown.yml

+ 1
- 1
tripleo_ansible/roles/tripleo-container-manage/tasks/container_running.yml View File

@@ -20,7 +20,7 @@
{{ podman_containers.containers | selectattr('Name', 'equalto', lookup('dict', container_exists_data).value.command.0) |
map(attribute='State.Running') | first | default(false) }}

- name: "Fail if {{ lookup('dict', container_exists_data).key }} is not running"
- name: "Fail if {{ lookup('dict', container_exists_data).value.command.0 }} is not running"
fail:
msg: >-
Can't run container exec for {{ lookup('dict', container_exists_data).key }},

+ 1
- 0
tripleo_ansible/roles/tripleo-container-manage/tasks/podman/create.yml View File

@@ -66,6 +66,7 @@
- name: "Check podman create status"
async_status:
jid: "{{ create_async_result_item.ansible_job_id }}"
no_log: "{{ not (tripleo_container_manage_debug | bool) }}"
loop: "{{ create_async_results.results }}"
loop_control:
loop_var: "create_async_result_item"

+ 3
- 1
tripleo_ansible/roles/tripleo-container-manage/tasks/podman/exec.yml View File

@@ -21,9 +21,10 @@
loop_var: container_exists_data
when: not ansible_check_mode|bool

- name: "Run actions async"
- name: "Async container exec"
command:
argv: "{{ cmd_template + lookup('dict', container_exec_data).value.command }}"
no_log: "{{ not (tripleo_container_manage_debug | bool) }}"
vars:
cmd_template:
- "{{ tripleo_container_manage_cli }}"
@@ -41,6 +42,7 @@
- name: "Check podman exec status"
async_status:
jid: "{{ exec_async_result_item.ansible_job_id }}"
no_log: "{{ not (tripleo_container_manage_debug | bool) }}"
loop: "{{ exec_async_results.results }}"
loop_control:
loop_var: "exec_async_result_item"

+ 0
- 11
tripleo_ansible/roles/tripleo-container-manage/tasks/podman/systemd.yml View File

@@ -14,17 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Check if /etc/sysconfig/podman_drop_in exists
stat:
path: /etc/sysconfig/podman_drop_in
register: podman_drop_in

- name: Set podman_drop_in fact
set_fact:
podman_drop_in: true
when:
- podman_drop_in.stat.exists

- name: Set container_name and container_sysd facts
set_fact:
container_sysd_name: "{{ lookup('dict', container_config).key }}"

+ 12
- 1
tripleo_ansible/roles/tripleo-container-manage/tasks/shutdown.yml View File

@@ -14,6 +14,17 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Check if /etc/sysconfig/podman_drop_in exists
stat:
path: /etc/sysconfig/podman_drop_in
register: podman_drop_in

- name: Set podman_drop_in fact
set_fact:
podman_drop_in: true
when:
- podman_drop_in.stat.exists

- name: Cleanup Paunch services and files
block:
- name: Check if /usr/lib/systemd/system/paunch-container-shutdown.service exists
@@ -51,7 +62,7 @@

- name: Create TripleO Container systemd service
block:
- name: "Create /usr/libexec/{{ item }}"
- name: "Deploy tripleo-container-shutdown and tripleo-start-podman-container"
copy:
src: "{{ role_path }}/files/{{ item }}"
dest: "/usr/libexec/{{ item }}"

Loading…
Cancel
Save