Skip to content

Instantly share code, notes, and snippets.

@cans
cans / pgidentifier.py
Last active July 2, 2019 19:47
A hastly put together filter plugin for postgres identifier (not yet functional)
# A hastly put together filter plugin to try have Ansible's `postgresql_query` module
# deal with identifiers correctly.
# References:
# * Postgres identifiers
# https://www.postgresql.org/docs/11/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
# * Psycopg2 handling of identifiers (cf. last example in the section)
# http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries
from psycopg2 import sql
from ansible.plugins.filter import core
@cans
cans / ansible-container-build.log
Last active February 18, 2018 19:44
Ansible-container build failure log after requirements were updated
$ ansible-container --debug build
2018-02-18T19:16:53.590012 The default type is [container.config] caller_file=/home/ncaniart/.virtualenvs/cans-containers/lib/python3.6/site-packages/container/config.py caller_func=_resolve_defaults caller_line=189 config=<class 'ruamel.yaml.comments.CommentedMap'> defaults=<class 'ruamel.yaml.compat.ordereddict'>
2018-02-18T19:16:53.590913 Getting environment variables... [container.config] caller_file=/home/ncaniart/.virtualenvs/cans-containers/lib/python3.6/site-packages/container/config.py caller_func=_get_environment_variables caller_line=205
2018-02-18T19:16:53.592015 Read environment variables [container.config] caller_file=/home/ncaniart/.virtualenvs/cans-containers/lib/python3.6/site-packages/container/config.py caller_func=_get_environment_variables caller_line=210 env_vars={}
2018-02-18T19:16:53.592866 Resolved template variables [container.config] caller_file=/home/ncaniart/.virtualenvs/cans-containers/lib/python3.6/site-packages/container/conf