From 10d300628d256c66e887e96c0d8e2429712490b4 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 15 Apr 2020 12:57:58 +0200 Subject: [PATCH] Add filter plugins --- ansible.cfg | 3 ++- plays/filter_plugins/update_env.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 plays/filter_plugins/update_env.py diff --git a/ansible.cfg b/ansible.cfg index beb4c0a..87bdb47 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,6 +1,7 @@ [defaults] -retry_files_enabled = false +filter_plugins = /var/lib/dokku/plugins/available/ansible-deploy/plays/filter_plugins interpreter_python = /usr/bin/python3 +retry_files_enabled = false [ssh_connection] pipelining = true diff --git a/plays/filter_plugins/update_env.py b/plays/filter_plugins/update_env.py new file mode 100644 index 0000000..eba3474 --- /dev/null +++ b/plays/filter_plugins/update_env.py @@ -0,0 +1,12 @@ +"""Update config.env filter.""" + + +def filter_update_env(config, env): + for key, val in env: + config["env"][key] = val + return config + + +class FilterModule(object): + def filters(self): + return {"update_env": filter_update_env}