#ansible (2019-06)
Discussions related to ansible configuration management
2019-06-06
![Blaise Pabon avatar](https://secure.gravatar.com/avatar/6540d57ecbbbebc740a33d507aa085ad.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0004-72.png)
ansible-playbook + buildah = a sweet container image - ansible-community/ansible-bender
2019-06-20
![rohit kast avatar](https://secure.gravatar.com/avatar/9620faa6c77f93062f02b6e8e19451c4.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0007-72.png)
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
![Abel Luck avatar](https://secure.gravatar.com/avatar/0f605397e0ead93a68e1be26dc26481a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png)
anyone know why ansible_date_time
returns a value in the past?
![Abel Luck avatar](https://secure.gravatar.com/avatar/0f605397e0ead93a68e1be26dc26481a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png)
it seems to return the time of the first run of the playbook
2019-06-25
![dustinvb avatar](https://secure.gravatar.com/avatar/b841dbd22c0ed9d6076ba6e3579cc9fe.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
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) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
@tamsky
![dustinvb avatar](https://secure.gravatar.com/avatar/b841dbd22c0ed9d6076ba6e3579cc9fe.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
I just need to understand the playbook… Coming from a guy that has 0 Ansible experience.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
@oscarsullivan_old are you using packer?
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
Yuss
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
But I invoke it with a simple shell script and a standard packer json file. It’s not being handled by ansible
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
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
![dustinvb avatar](https://secure.gravatar.com/avatar/b841dbd22c0ed9d6076ba6e3579cc9fe.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
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.
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
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
![dustinvb avatar](https://secure.gravatar.com/avatar/b841dbd22c0ed9d6076ba6e3579cc9fe.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
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 avatar](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
@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 avatar](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
In my “immutable infrastructure” best-case universe, I don’t use or reccomend terraform’s provisioner
feature.
![tamsky avatar](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
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.
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
^ this
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
I cant remember what but I remember reading something negative about Terraforms ansible provisioner
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
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.