swap: make it idempotent
Call 'swapon -a' only when we just added the swap /etc/fstab entry.
This commit is contained in:
parent
a9da2ee4d9
commit
2a4698ee3a
1 changed files with 2 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
passno=0
|
||||
dump=0
|
||||
state=present
|
||||
register: swap_fstab_added
|
||||
tags:
|
||||
- swap.fstab
|
||||
- swap
|
||||
|
@ -52,6 +53,7 @@
|
|||
- name: Mount swap
|
||||
command: "swapon -a"
|
||||
#when: ansible_swaptotal_mb|int < 1
|
||||
when: swap_fstab_added.changed
|
||||
tags:
|
||||
- swap.file.swapon
|
||||
- swap
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue