I want to insert some lines in a file using the blockinfile
module.
- name: add some lines
blockinfile:
dest: /etc/sysctl.conf
block: |
mykey1={{ kernvars['my_value1'] }}
mykey2={{ kernvars['my_value2'] }}
mykey3={{ kernvars['my_value3'] }}
Is there a way for the module (or a relevant pattern) to check and insert the specific lines only if they are not already there?
Using ansible 2.0.0.2
on Ubuntu 16.04.01
.