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
|
passno=0
|
||||||
dump=0
|
dump=0
|
||||||
state=present
|
state=present
|
||||||
|
register: swap_fstab_added
|
||||||
tags:
|
tags:
|
||||||
- swap.fstab
|
- swap.fstab
|
||||||
- swap
|
- swap
|
||||||
|
@ -52,6 +53,7 @@
|
||||||
- name: Mount swap
|
- name: Mount swap
|
||||||
command: "swapon -a"
|
command: "swapon -a"
|
||||||
#when: ansible_swaptotal_mb|int < 1
|
#when: ansible_swaptotal_mb|int < 1
|
||||||
|
when: swap_fstab_added.changed
|
||||||
tags:
|
tags:
|
||||||
- swap.file.swapon
|
- swap.file.swapon
|
||||||
- swap
|
- swap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue