fix: Remove bootstrap python setup from check mode

Since we can't look into the variable `pythoncheck.rc`, as it doesn't
exist, we skip the `when` check for checkmode -- its installation cannot
run under any circumstance in the mode anyways.
This commit is contained in:
Marty Oehme 2025-11-19 14:40:00 +01:00
parent 2fc23d9774
commit 66ce16ce55
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -15,7 +15,11 @@
register: pythoncheck
- name: install debian python
ansible.builtin.raw: apt-get update && apt-get install python3 -y
when: pythoncheck.rc == 127
when: not ansible_check_mode and pythoncheck.rc == 127
- name: pretend installing debian python for check mode
ansible.builtin.debug:
msg: Pretending to install python...
when: ansible_check_mode
- name: Prepare incus server host
hosts: host_system