salt.modules.grains

Control aspects of the grains data

salt.modules.grains.item(key=None, sanitize=False)

Return a singe component of the grains data

CLI Example:

salt '*' grains.item os

Sanitized CLI output:

salt '*' grains.items serialnumber sanitize=True
salt.modules.grains.items(sanitize=False)

Return the grains data

CLI Example:

salt '*' grains.items

Sanitized CLI output:

salt '*' grains.items sanitize=True
salt.modules.grains.ls()

Return a list of all available grains

CLI Example:

salt '*' grains.ls
salt.modules.grains.setval(key, val)

Set a grains value in the grains config file

CLI Example:

salt '*' grains.setval key val

Parent topic

Previous topic

salt.modules.glance

Next topic

salt.modules.groupadd