#ansible (2019-06)

ansible

Discussions related to ansible configuration management

2019-06-26

dustinvb avatar
dustinvb

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
tamsky

@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
tamsky

In my “immutable infrastructure” best-case universe, I don’t use or reccomend terraform’s provisioner feature.

:--1:2
tamsky avatar
tamsky

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.

:--1:2
oscarsullivan_old avatar
oscarsullivan_old

^ this

oscarsullivan_old avatar
oscarsullivan_old

I cant remember what but I remember reading something negative about Terraforms ansible provisioner

oscarsullivan_old avatar
oscarsullivan_old

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.

2019-06-25

dustinvb avatar
dustinvb

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
Erik Osterman (Cloud Posse)

@tamsky

dustinvb avatar
dustinvb

I just need to understand the playbook… Coming from a guy that has 0 Ansible experience.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@oscarsullivan_old are you using packer?

oscarsullivan_old avatar
oscarsullivan_old

Yuss

oscarsullivan_old avatar
oscarsullivan_old

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
oscarsullivan_old

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
dustinvb

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.

Ansible and Terraform: Better Together

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
oscarsullivan_old

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-21

Abel Luck avatar
Abel Luck

anyone know why ansible_date_time returns a value in the past?

Abel Luck avatar
Abel Luck

it seems to return the time of the first run of the playbook

2019-06-20

rohit kast avatar
rohit kast

https://github.com/cloudposse/terraform-null-ansible how do I add multiple hosts to a group in dynamic inventory?

cloudposse/terraform-null-ansible

Terraform Module to run ansible playbooks. Contribute to cloudposse/terraform-null-ansible development by creating an account on GitHub.

2019-06-06

Blaise Pabon avatar
Blaise Pabon
ansible-community/ansible-bender

ansible-playbook + buildah = a sweet container image - ansible-community/ansible-bender

    keyboard_arrow_up