Skip to content

Instantly share code, notes, and snippets.

@dnd
Last active August 29, 2015 14:02
Show Gist options
  • Save dnd/72f2da2354d8abe39636 to your computer and use it in GitHub Desktop.
Save dnd/72f2da2354d8abe39636 to your computer and use it in GitHub Desktop.
SaltStack YAML block reuse
#salt requires a proper dictionary with declared state, so the file.missing is just a dummy
appUserGroup:
file.missing:
- name: /tmp/aroisntoaursntoyaurnsotnarstnarosetairestoiaernst
- &usergroup
- user: {{user}}
- group: {{group}}
- hashvalues: &hashvals
some: value
another: one
/tmp/managed:
file.managed:
- content: whatever
- <<: *usergroup #nested at same level to appear
- env:
<<: *hashvals #requires double indent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment