This state allows for grains to be set. Grains set or altered this way are stored in the 'grains' file on the minions, by default at: /etc/salt/grains
Note: This does NOT override any grains set in the minion file.
Ensure the value is absent in the list type grain
The grain should be list type .
roles:
grains.list_absent:
- value: db
New in version 2014.1.0: (Hydrogen)
Ensure the value is present in the list type grain
The grain should be list type .
roles:
grains.list_present:
- value: web
Ensure that a grain is set
If the grain with the given name exists, its value is updated to the new value. If the grain does not yet exist, a new grain is set to the given value.
cheese:
grains.present:
- value: edam
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.