#ansible (2019-06)
Discussions related to ansible configuration management
2019-06-06
ansible-playbook + buildah = a sweet container image - ansible-community/ansible-bender
2019-06-20
https://github.com/cloudposse/terraform-null-ansible how do I add multiple hosts to a group in dynamic inventory?
Terraform Module to run ansible playbooks. Contribute to cloudposse/terraform-null-ansible development by creating an account on GitHub.
2019-06-21
anyone know why ansible_date_time
returns a value in the past?
it seems to return the time of the first run of the playbook
2019-06-25
Anyone have an example playbook that I can review that does Packer + Terraform? The model Ansible has now is not what I’m used to traditionally. I did review the Ansible provisioner above but given what I am reading the model for Ansible is invoking Packer and Terraform.
@tamsky
I just need to understand the playbook… Coming from a guy that has 0 Ansible experience.
@oscarsullivan_old are you using packer?
Yuss
But I invoke it with a simple shell script and a standard packer json file. It’s not being handled by ansible
Oh I read Dustin’s message. @dustinvb do you mean an example where packer calls a playbook?
My workflow: Bash script to invoke packer Packer reads packer Json file Packer builds AWS EBS AMI using ansible
The workflow as describe by Ansible and HashiCorp here: https://www.hashicorp.com/resources/ansible-terraform-better-together
Ends up with Ansible becoming the control plane that consumes Packer and Terraform. I am used to the opposite with any other config management tooling.
I’d like to see an Ansible playbook that would call Packer with the packer.json and then provision that image with Ansible and also the same approach with Ansible using the Terraform module and .tf file and provisioning that VM instance once it as started. As I understand it this is the flow prescribed by the two companies.
Learn how users of the HashiCorp stack can use Ansible to achieve their goals of an automated enterprise—through complimentary security, image management, post provisioning configuration, and integrated end to end automation solutions.
Ah ok. Well I don’t call Terraform with Ansible so haven’t checked out their modules, but ansible is usually quick to grasp new modules.
I’m afraid I dont have the examples you’re looking for as I use bash to create the packer (ansible) AMI and then bash again to run terraform to go and use that packer baked AMI.
2019-06-26
Not thrilled at the workflow proposed but would prefer to be on board with the two companies approach to work “Better Together” May need to set this up sometime on my own to explore an example.
@dustinvb it sounds like you understand the ansible runtime environment differences … one is at packer-time (building AMI/docker images) and the other is at instance-launch-time via terraform’s ansible provisioner {}
?
In my “immutable infrastructure” best-case universe, I don’t use or reccomend terraform’s provisioner
feature.
Based on that immutable approach, I typically recommend doing all provisioning in packer. And if you need to do some boot time configuration, configure the AMI to use cloud-init
’s cloud-config
to perform those boot time actions.
^ this
I cant remember what but I remember reading something negative about Terraforms ansible provisioner
So I also bake immutable machines with packer ahead of time. Best part is if I REALLY need to run something against some EC2s I can just run the playbook directly.. say urgently offboarsing an ssh key.