Tighten podman ansible tasks based on manual testing
- Use 'started successfully' instead of just 'started' for changed_when - Use specific failed_when: rc not in [0, 125] instead of false - 125 = already exists (init) or already running (start) Tested manually on indri - podman machine initialized and running. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b333b7ff2c
commit
2c8ced07b4
1 changed files with 3 additions and 3 deletions
|
|
@ -458,14 +458,14 @@ ansible/roles/podman/
|
|||
cmd: podman machine init --cpus 4 --memory 8192 --disk-size 100
|
||||
register: podman_init
|
||||
changed_when: podman_init.rc == 0
|
||||
failed_when: false # May already exist
|
||||
failed_when: podman_init.rc not in [0, 125] # 125 = already exists
|
||||
|
||||
- name: Start podman machine
|
||||
ansible.builtin.command:
|
||||
cmd: podman machine start
|
||||
register: podman_start
|
||||
changed_when: "'started' in podman_start.stdout"
|
||||
failed_when: false # May already be running
|
||||
changed_when: "'started successfully' in podman_start.stdout"
|
||||
failed_when: podman_start.rc not in [0, 125] # 125 = already running
|
||||
```
|
||||
|
||||
**Testing:**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue