20 lines
549 B
Python
20 lines
549 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
from ansible.plugins.action import ActionBase
|
||
|
|
||
|
|
||
|
class ActionModule(ActionBase):
|
||
|
def run(self, tmp=None, task_vars=None):
|
||
|
config = self._task.args.get('config')
|
||
|
varname = self._task.args.get('var_name')
|
||
|
_config = {}
|
||
|
|
||
|
for config_item in config:
|
||
|
if config[config_item]:
|
||
|
_config[config_item] = self._templar.template(config[config_item])
|
||
|
|
||
|
return dict(
|
||
|
ansible_facts={varname: self._templar.template(_config)},
|
||
|
changed=False
|
||
|
)
|