This section provides an overview of what ansible is, and why a developer might want to use it.
It should also mention any large subjects within ansible, and link out to the related topics. Since the Documentation for ansible is new, you may need to create initial versions of those related topics.
Environment variables in dynamic inventory won't work, f.e.
"ansible_ssh_private_key_file": $HOME/.ssh/key.pem"
If the dynamic inventory server side passes $HOME
for example, replace the variable in the client code (Python):
json_input.replace("$HOME", os.environ.get("HOME"))
example-2: This is serves as an example so just don't copy/past it. Instead, to suit your needs, you should customize its variables; ansible_key, security group rules etc..
example-1: To disable the ssh strict host key checking, a behavior we don't want when automating tasks, we set it to no
in ansible.cfg
file. ie: StrictHostKeyChecking=no
The ec2.py
file is a python script that executes and returns your AWS ressources based on the ec2.ini
which is the configuration file that you need to customize if you want to limit the scope of your project to some particular regions, specific tags etc...
Ansible offers Vault (not to be mistaken with HashiCorp Vault!) to handle sensitive data encryption. Vault primarily targets to encrypt any structured data such as variables, tasks, handlers.
Official docs explains playbook conditionals.
Ansible (github)