saltstack/salt — Issue #419: Allow `cmd` state to only run when triggered by another state
Author: fatbox
Created: 2012-01-04 06:54:43+00:00
State: open

This would be to allow definition of `cmd` states that would only be run when another state changes.

Use case: APT updating

`apt.sls`

apt-update:
cmd:
- trigger
- name: /usr/bin/apt-get update

`my.sls`

include:
- apt

/etc/apt/sources.list.d/fatbox.list:
file:
- managed
- source: salt://fatbox/debian/apt/fatbox.list
- owner: root
- group: root
- mode: 644

extend:
apt-update:
cmd:
- watch:
- file: /etc/apt/sources.list.d/fatbox.list