Created
August 25, 2014 23:15
-
-
Save cloudnull/24c740b0e99ea5066ad2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Append any options in config to the host_vars of a container | |
container_vars = host_options.get('container_vars') | |
if isinstance(container_vars, dict): | |
for _keys, _vars in container_vars.items(): | |
# Copy the options dictionary for manipulation | |
options = _vars.copy() | |
for _k, _v in options.items(): | |
limit = None | |
# If a limit is set use the limit string as a filter | |
# for the container name and see if it matches. | |
if 'limit_container_types' in _v: | |
limit = options.pop( | |
'limit_container_types', None | |
) | |
if limit is None or limit in container: | |
hdata[_keys] = options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment