Confused about grains.append

176 views
Skip to first unread message

Gary Tang

unread,
Dec 29, 2014, 1:36:16 PM12/29/14
to salt-...@googlegroups.com
The documentation on grains.append (http://salt.readthedocs.org/en/latest/ref/modules/all/salt.modules.grains.htmlindicates that If the grain doesn't exist, the grain key is added and the value is appended to the new grain as a list item.

Using grains.append in the terminal (i.e. salt 'Dom' grains.append role test) seems to work properly, and creates the role if it does not exist, however when using it in the SLS, it doesn't seem to create the key if it does not exist

I am using the following to append the key:

collectd_role:

  grains.append:

    - value: collectd-client

    - name: role


Regards,

Phoenix

Gary Tang

unread,
Dec 29, 2014, 1:51:42 PM12/29/14
to salt-...@googlegroups.com
nvm, fixed it
Reply all
Reply to author
Forward
0 new messages