Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2016 14:18
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 anonymous/1cadf67b1667330b9bfb24a43e274246 to your computer and use it in GitHub Desktop.
Save anonymous/1cadf67b1667330b9bfb24a43e274246 to your computer and use it in GitHub Desktop.
Excerpt of grub state with multiple file.replace/managed
grubpermissions:
file.managed:
- name: {{ grub.cfg }}
- user: root
- group: root
- mode: 600
- replace: False
- source: None
addpassword:
file.replace:
- name: {{ grub.cfg }}
- pattern: 'password --.*'
- repl: 'password --md5 {{ salt['pillar.get']('system_users:grub_md5') }}'
- prepend_if_not_found: True
addaudit:
file.replace:
- name: {{ grub.cfg }}
- pattern: '(\s*kernel(?!.*audit=1).*$)'
- repl: '\1 audit=1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment