Merge pull request #22535 from rallytime/fix-22534

Add additional examples to grains.list_absent and grains.list_present
This commit is contained in:
Justin Findlay 2015-04-10 15:56:09 -06:00
commit 061c730a29

View File

@ -65,13 +65,13 @@ def list_present(name, value):
'''
.. versionadded:: 2014.1.0
Ensure the value is present in the list type grain
Ensure the value is present in the list type grain.
name
The grain name
The grain name.
value
The value is present in the list type grain
The value is present in the list type grain.
The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_
@ -80,6 +80,16 @@ def list_present(name, value):
roles:
grains.list_present:
- value: web
For multiple grains, the syntax looks like:
.. code-block:: yaml
roles:
grains.list_present:
- value:
- web
- dev
'''
ret = {'name': name,
'changes': {},
@ -121,13 +131,15 @@ def list_present(name, value):
def list_absent(name, value):
'''
Delete a value from a grain formed as a list
Delete a value from a grain formed as a list.
.. versionadded:: 2014.1.0
name
The grain name
The grain name.
value
The value to delete from the grain list
The value to delete from the grain list.
The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_
@ -136,6 +148,16 @@ def list_absent(name, value):
roles:
grains.list_absent:
- value: db
For multiple grains, the syntax looks like:
.. code-block:: yaml
roles:
grains.list_absent:
- value:
- web
- dev
'''
ret = {'name': name,
'changes': {},