This PR introduces some basic scaffolding and a first pass approach at provisioning terraform resources with ansible.
At a high level, this provisioner will accept apply a list of plays to a new
terraform resource. Once local_ansible.py has been created, this provisioner
will clone that script, install any dependencies to run it and will then
transfer the ansible module path and playbook to the resource before running
that script.
Ansible will only be run on resources when they are first provisioned and as
such this provisioner doesn't have any considerations for an ansible inventory
file or anything such as that. One of the design goals here is that the local
terraform environment doesn't have to know about ansible and doesn't actually
run ansible. This leverages the built in communication functionality that
terraform exposes via the plugin interface and does everything via remote commands.
Here's what this PR introduces:
[x] basic pluging scaffolding
[x] basic communication to the remote resource
[x] configuration declaration / validation
[x] local_ansible.py script
[x] install python and ansible on the remote host
[x] clone local_ansible.py to the remote host
[x] transfer specified playbook.yml and ansible to the remote host
[x] run local_ansible.py and report back how things go
This PR introduces some basic scaffolding and a first pass approach at provisioning terraform resources with
ansible
.At a high level, this provisioner will accept apply a list of plays to a new terraform resource. Once
local_ansible.py
has been created, this provisioner will clone that script, install any dependencies to run it and will then transfer the ansible module path and playbook to the resource before running that script.Ansible will only be run on resources when they are first provisioned and as such this provisioner doesn't have any considerations for an ansible inventory file or anything such as that. One of the design goals here is that the local terraform environment doesn't have to know about ansible and doesn't actually run ansible. This leverages the built in communication functionality that terraform exposes via the plugin interface and does everything via remote commands.
Here's what this PR introduces:
local_ansible.py
to the remote hostplaybook.yml
andansible
to the remote hostlocal_ansible.py
and report back how things go