Create a module which allows to set specific content of the file, mostly config file.
The module should prefent setting lines multiple times. This should allow to define something as following in the documentation:
Add following line to the /etc/hosts file:
This should now prefent be executable by the bash script and only add 192.0.0.1 example.org if it does not exist
yet, or if specified, look for a defined regex (defined as description) to replace it with the defined line.
General idea:
- remove every line matching regex
- insert defined line -> preferably at the same location as the regex has removed the line
Most likely dependent on #1
Create a module which allows to set specific content of the file, mostly config file.
The module should prefent setting lines multiple times. This should allow to define something as following in the documentation:
Add following line to the /etc/hosts file:
This should now prefent be executable by the bash script and only add
192.0.0.1 example.orgif it does not existyet, or if specified, look for a defined regex (defined as description) to replace it with the defined line.
General idea:
Most likely dependent on #1