ansible-role-openpolicyagent/action_plugins/openpolicyagent_config_generate.py
Elia El Lazkani 292ca2ef63 Second commit
2019-10-08 00:09:33 +02:00

19 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
)