Those messages are coming from the {% if salt['cmd.run']('grep swap
/etc/fstab') %} line
However, you don't need this check as you are also using 'onlyif' in
the stanza - which is also checking if that string appears in
/etc/fstab ?
It might be better to use something like 'file.line' to remove the
'swap' line - i.e. something like:
swapoff_fstab:
file.line:
- name: /etc/fstab
- match: '\bswap\b'
- mode: delete
- backup: True
It is also probably possible to use 'file.replace' to do something similar ?
James Pearson