Infrastructure as Code

  • Jinja Loops

    Easiest way to get work with loops in jinja

  • Select and Sum dictionary values selecting a pattern

    The Dictionary FS: - nom_FS: /appm/oracle/product nom_LV: lv_product size_FS: 5 owner_FS: oracle group_FS: dba vg_name: vgapplis - nom_FS: /appm/oracle/product/12.1.0.2 nom_LV: lv_12102 size_FS: 15 owner_FS: oracle group_FS: dba vg_name: vgapplis - nom_FS: /apps/oracle/logs nom_LV: lvlogs size_FS: 5 owner_FS: oracle group_FS: dba vg_name: vglogs The ansible tasks tasks: - name: Calculate with selectattr, map and sum debug: msg: "{{ FS | selectattr('vg_name', 'equalto', 'vgapplis') | map(attribute='size_FS') | list | sum }}" - name: Calculate with json_query vars: sum_query: "[?

  • Ansible Environment variables

    How to inject Environment variables into Ansible Playbook

  • ansible-docs

    How to get ansible documentation in the cli

  • ansible-inventories

    Tips for ansible inventories

  • Print variable results

    Methods to access a variable results