|
|
@ -11,11 +11,16 @@
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- meta: end_play
|
|
|
|
when:
|
|
|
|
when:
|
|
|
|
# TODO CI currently runs on macOS 12 & which isn't supported by Podman
|
|
|
|
# Podman versions available in Homebrew have dropped macOS 12 support.
|
|
|
|
# version available in Homebrew.
|
|
|
|
|
|
|
|
- ansible_facts.system == 'Darwin'
|
|
|
|
- ansible_facts.system == 'Darwin'
|
|
|
|
- ansible_facts.distribution_version is version('13.0', '<', strict=True)
|
|
|
|
- ansible_facts.distribution_version is version('13.0', '<', strict=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- meta: end_play
|
|
|
|
|
|
|
|
when:
|
|
|
|
|
|
|
|
# Ansible 10 (ansible-core 2.17+) require Python 3.7+ on targets.
|
|
|
|
|
|
|
|
# On CentOS 8 /usr/libexec/platform-python is Python 3.6
|
|
|
|
|
|
|
|
- ansible_version.full is version('2.17', '>=', strict=True)
|
|
|
|
|
|
|
|
|
|
|
|
- name: set up test container and run tests inside it
|
|
|
|
- name: set up test container and run tests inside it
|
|
|
|
block:
|
|
|
|
block:
|
|
|
|
- name: install deps
|
|
|
|
- name: install deps
|
|
|
@ -33,6 +38,7 @@
|
|
|
|
- cmd: podman info
|
|
|
|
- cmd: podman info
|
|
|
|
timeout: 300
|
|
|
|
timeout: 300
|
|
|
|
register: podman_machine
|
|
|
|
register: podman_machine
|
|
|
|
|
|
|
|
changed_when: true
|
|
|
|
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: podman_machine
|
|
|
|
var: podman_machine
|
|
|
@ -41,11 +47,13 @@
|
|
|
|
- name: create container
|
|
|
|
- name: create container
|
|
|
|
command:
|
|
|
|
command:
|
|
|
|
cmd: podman run --name testMitogen -d --rm centos:8 bash -c "sleep infinity & wait"
|
|
|
|
cmd: podman run --name testMitogen -d --rm centos:8 bash -c "sleep infinity & wait"
|
|
|
|
|
|
|
|
changed_when: true
|
|
|
|
|
|
|
|
|
|
|
|
- name: add container to inventory
|
|
|
|
- name: add container to inventory
|
|
|
|
add_host:
|
|
|
|
add_host:
|
|
|
|
name: testMitogen
|
|
|
|
name: testMitogen
|
|
|
|
ansible_connection: podman
|
|
|
|
ansible_connection: podman
|
|
|
|
|
|
|
|
ansible_python_interpreter: /usr/libexec/platform-python # Python 3.6
|
|
|
|
ansible_user: root
|
|
|
|
ansible_user: root
|
|
|
|
changed_when: false
|
|
|
|
changed_when: false
|
|
|
|
environment:
|
|
|
|
environment:
|
|
|
@ -57,6 +65,7 @@
|
|
|
|
- name: create test file
|
|
|
|
- name: create test file
|
|
|
|
file:
|
|
|
|
file:
|
|
|
|
path: /var/run/reboot-required
|
|
|
|
path: /var/run/reboot-required
|
|
|
|
|
|
|
|
mode: u=rw,go=r
|
|
|
|
state: touch
|
|
|
|
state: touch
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check if reboot is required
|
|
|
|
- name: Check if reboot is required
|
|
|
@ -68,13 +77,16 @@
|
|
|
|
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
|
|
|
|
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
|
|
|
|
async: 1
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
|
|
|
poll: 0
|
|
|
|
when: reboot_required.stat.exists == True
|
|
|
|
changed_when: true
|
|
|
|
|
|
|
|
when:
|
|
|
|
|
|
|
|
- reboot_required.stat.exists
|
|
|
|
|
|
|
|
|
|
|
|
- name: Wait 300 seconds for server to become available
|
|
|
|
- name: Wait 300 seconds for server to become available
|
|
|
|
wait_for_connection:
|
|
|
|
wait_for_connection:
|
|
|
|
delay: 30
|
|
|
|
delay: 30
|
|
|
|
timeout: 300
|
|
|
|
timeout: 300
|
|
|
|
when: reboot_required.stat.exists == True
|
|
|
|
when:
|
|
|
|
|
|
|
|
- reboot_required.stat.exists
|
|
|
|
|
|
|
|
|
|
|
|
- name: cleanup test file
|
|
|
|
- name: cleanup test file
|
|
|
|
file:
|
|
|
|
file:
|
|
|
@ -90,6 +102,7 @@
|
|
|
|
loop:
|
|
|
|
loop:
|
|
|
|
- cmd: podman stop testMitogen
|
|
|
|
- cmd: podman stop testMitogen
|
|
|
|
- cmd: podman machine stop
|
|
|
|
- cmd: podman machine stop
|
|
|
|
|
|
|
|
changed_when: true
|
|
|
|
when:
|
|
|
|
when:
|
|
|
|
- ansible_facts.pkg_mgr in ['homebrew']
|
|
|
|
- ansible_facts.pkg_mgr in ['homebrew']
|
|
|
|
tags:
|
|
|
|
tags:
|
|
|
|