#ansible - June 2019

ansibleArchived
13 messages

Discussions related to ansible configuration management

rohit kast
rohit kastover 7 years ago
https://github.com/cloudposse/terraform-null-ansible
how do I add multiple hosts to a group in dynamic inventory?
Abel Luck
Abel Luckover 7 years ago
anyone know why ansible_date_time returns a value in the past?
Abel Luck
Abel Luckover 7 years ago
it seems to return the time of the first run of the playbook
dustinvb
dustinvbover 7 years ago
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.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@tamsky ☝️
dustinvb
dustinvbover 7 years ago
I just need to understand the playbook... Coming from a guy that has 0 Ansible experience. 😉
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@oscarsullivan_old are you using packer?
dustinvb
dustinvbover 7 years ago
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.
dustinvb
dustinvbover 7 years ago
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. 🤷‍♂️
tamsky
tamskyover 7 years ago
@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 {} ?
tamsky
tamskyover 7 years ago
In my "immutable infrastructure" best-case universe, I don't use or reccomend terraform's provisioner feature.
tamsky
tamskyover 7 years ago(edited)
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.