Ansible Modules

  • are tools in toolkit for connecting to other systems for configuring or OSS
  • mostly python but can be written in other languages 
  • Extensible 
  • 450+ ship as default 
  • use raw module to just run commands without needing to do any checks (e.g. fatal: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "/bin/sh1: /opt/local/bin/python: not found No such file or directory\r\n", "msg": "MODULE FAILURE", "parsed": false} which happens when trying to shell or command modues
  • setup module to query known facts about a system
    • ansible gbhome_headnodes -m setup -a 'gather_subset=network,virtual' -a 'filter=ansible_*0'
  • some commands using the Command module won’t allow a semi-colon separated list of commands. These will need to be split into separate tasks or use shell module