Hi,
I just upgraded Ansible from 1.4 → 1.6.2 and noticed that one of our custom jinja 2 plugins configured in filter_plugins/custom_plugins.py no longer works since a used module is not in the system python. The plugin provided a vault functionality because at that time it was not available in Ansible yet. The code:
filter_plugins/custom_plugins.py
import os.path
from ansible import errors
try:
from keyczar import keyczar
def vault(encrypted):
keydir = os.path.expanduser(‘~/.mykeystore’)
crypter = keyczar.Crypter.Read(keydir)
return crypter.Decrypt(encrypted)
except ImportError as e:
raise errors.AnsibleFilterError(“|keyczar not loaded: %s” % e)
We could use it in tasks like this: