Skip to content

Instantly share code, notes, and snippets.

@rrauenza
Created August 15, 2013 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrauenza/9dfcdf787c78d9324072 to your computer and use it in GitHub Desktop.
Save rrauenza/9dfcdf787c78d9324072 to your computer and use it in GitHub Desktop.
how do you do two actions on one file in salt?
Salt complains about this:
/etc/ntp.conf:
- file.comment:
- regex: ^server .*ntpd.org
- file.append:
- text: "myserver1\nmyserver2\n"
@rrauenza
Copy link
Author

/tmp/ntp.conf:
file.comment:
- regex: "^server .*ntpd.org"
file.append:
- text: "myserver1\nmyserver2\n"

@SEJeff
Copy link

SEJeff commented Aug 15, 2013

Hack workaround

/etc/ntp.conf:
  - file.comment:
    - regex: ^server .*ntpd.org

ntp_config:
  - file.append:
    - name: /etc/ntp.conf
    - text: 'myserver1\nmyserver2\n'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment