RSS

Posts in 2019

  • Dump all ansible variables

    Tuesday, October 15, 2019 in Ansible

    Here is the task to use in order to achieve that : - name:Dumpallvarsaction:templatesrc=dumpall.j2dest=ansible.all And here is the template to use with it : Module Variables ("vars"): -------------------------------- {{ vars | to_nice_json …

    Read more

Posts in 2018

  • Ansible custom facts

    Tuesday, September 25, 2018 in Ansible

    Custom facts are actually quite easy to implement despite the lack of documentation about it. How they work On any Ansible controlled host — that is, the remote machine that is being controlled and not the machine on which the playbook is run — you …

    Read more

  • Ansible vault example

    Wednesday, February 21, 2018 in Ansible

    Here is how to edit a vault protected file : ansible-vault edit hostvars/blah.yml Here is how to put a multiline entry like a private key in vault (for a simple value, just don’t use a |): ssl_key :| ----- BEGIN PRIVATE KEY …

    Read more