Posts

Showing posts with the label ansible

Running Ansible with Docker

Image
Ansible is a great provisioning tool. However, it can be painful to get some ansible scripts right. Especially if you need some stuff with bash and Ansible. Often baking time in AWS can be pretty high. So It's better you can run ansible locally. However, running ansible local could mess up with your OS. So the best thing is run ansible in Docker. Since the docker container will be ephemeral, once you finish running the container all changes will be lost. You also will benefit from running locally and being able to figure it out quickly whats wrong.  So today I want to share about some simple project I create in order to help to do that. This is called Ansible-Docker this is an ansible sandbox using Amazon Linux.

AMI Backing: Using Ansible to Provision with Packer

Image
Immutable Infrastructure in on the heart of DevOps. Today Backing is a very popular idea. AWS allow you to create AMI (AMI is amazon specific image is kinda of a ISO on the OS) this image can be backed in a automated fashion. To perform this task we can use Packer but Packer will take care on the AMI and publishing to AWS but you still need to install things on this linux image lets say Ubuntu or CentOS for instance. For provision you can use Ansible . In this post i will show how to install Ansible, Packer and build an AMI image with Packer and have the full provisioning using Ansible. 

Running Ansible on Vagrant

Image
On the previous post i was talking about how to run Ansible on AWS .  IF you dont have acess to AWS or your solution runs on bare metal you still can run ansible on Vagrant and have an environment to test your playbooks. Once you download and install Vagrant, you just need pick up my vagrant file and them you ready to have ansible running :-) So you download the Vagrantfile and put it into a directory in your machine, them you gonna run: $ vagrant up $ vagrant ssh   That`s it, you are ready to have fun. Keep in mind for this vagrant file im using a shared folder where im putting my playbooks, if you dont want this just comment the line on the Vagrantfile.

Running Ansible on AWS

Image
Ansible is Configuration Management and automation engine.  Its has a very minimal setup, its just depends on Python - witch is good because pretty much all linux distributions came with python. You can run Ansible with just SSH, yes with-out agents. Like other engines Ansible is based on Recipes, in Ansible world recipes are called palybooks. Playbooks are written in a kind of DSL inside a YAML file, often called main.yml. You can have multiple YAML files and reuse a lot your provision playbooks. Ansible runs easily pretty much in all environments BUT windows.  For windows users its easy to use it with Vagrant.  It`s possible to have pretty complex provision scripts if needed, there are lots of modules like git, file, get_url and so one and on. Ansible provide variables, so you can bind custom values on conf files also called templates.  For this post i will how to do a very simple and straight forward setup for ansible on AWS, this will be a pretty basic s...