swap device: use shell instead of command.

This commit is contained in:
Andrea Dell'Amico 2024-07-12 16:32:07 +02:00
parent 9244f93dc3
commit 5abdd7babc
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 2 additions and 2 deletions

View File

@ -6,12 +6,12 @@
- swap_device
block:
- name: swap_device | Initialize the swap device
ansible.builtin.command: mkswap {{ swap_device_name }} && touch /root/.mkswap_executed
ansible.builtin.shell: mkswap {{ swap_device_name }} && touch /root/.mkswap_executed
args:
creates: /root/.mkswap_executed
register: mkswap_command_execution
- name: swap_device | Enable the swap device
ansible.builtin.command: swapon {{ swap_device_name }} && touch /root/.swapon_executed
ansible.builtin.shell: swapon {{ swap_device_name }} && touch /root/.swapon_executed
args:
creates: /root/.swapon_executed