Replace ignore_errors with failed_when
This commit is contained in:
parent
a3b772c543
commit
5312ec8cc6
2
main.yml
2
main.yml
@ -87,4 +87,4 @@
|
|||||||
- name: Reboot system
|
- name: Reboot system
|
||||||
when: hypervisor != "libvirt"
|
when: hypervisor != "libvirt"
|
||||||
ansible.builtin.command: reboot
|
ansible.builtin.command: reboot
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
- name: Remove CD-ROM from VM in vCenter
|
- name: Remove CD-ROM from VM in vCenter
|
||||||
when: hypervisor == "vmware"
|
when: hypervisor == "vmware"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
community.vmware.vmware_guest:
|
community.vmware.vmware_guest:
|
||||||
hostname: "{{ hypervisor_url }}"
|
hostname: "{{ hypervisor_url }}"
|
||||||
username: "{{ hypervisor_username }}"
|
username: "{{ hypervisor_username }}"
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
- name: Extra Configuration
|
- name: Extra Configuration
|
||||||
block:
|
block:
|
||||||
- name: Append lines to vimrc
|
- name: Append lines to vimrc
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ '/mnt/etc/vim/vimrc' if os | lower in ['debian11', 'debian12', 'ubuntu', 'ubuntu-lts'] else '/mnt/etc/vimrc' }}"
|
path: "{{ '/mnt/etc/vim/vimrc' if os | lower in ['debian11', 'debian12', 'ubuntu', 'ubuntu-lts'] else '/mnt/etc/vimrc' }}"
|
||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
- name: Partition install drive
|
- name: Partition install drive
|
||||||
block:
|
block:
|
||||||
- name: Prepare partitions
|
- name: Prepare partitions
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
ansible.builtin.command: "{{ item.cmd }}"
|
ansible.builtin.command: "{{ item.cmd }}"
|
||||||
loop:
|
loop:
|
||||||
- { cmd: umount -l /mnt }
|
- { cmd: umount -l /mnt }
|
||||||
|
Loading…
Reference in New Issue
Block a user