Showing posts with label ansible. Show all posts
Showing posts with label ansible. Show all posts

Saturday, December 16, 2017

Getting started with Ansible in Docker

Since OpenShift uses Ansible, and also since I hate Puppet, I love Python, Ansible is based on Python and I always wanted to learn a Provisioning tool other from Puppet to prove that Puppet folks are losers...
and since Ansible can nuke your environment if used incorrectly....

I am installing Ansible in a docker Centos machine, so I can nuke it at my will!

docker pull centos
#here nothing happens
docker run centos
docker container ls
docker run -i -t centos
yum install man
yum install ansible
exit
#note down the container id, it's displayed after the root@ prompt , like in root@61d50a06c86c
docker commit 61d50a06c86c centosansible

at this point I can easily run:
docker run -i -t centosansible

and if I do
docker images | grep centos
centosansible latest 2766690643c3 9 minutes ago 353MB
centos latest 3fa822599e10 2 weeks ago 204MB

I see that my image is there (the 353MB size include all the layers from centos image, which are NOT duplicated, so the real additional space is only 353-204=149 MB


http://docs.ansible.com/ansible/latest/intro_installation.html


ansible --version
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]


ansible localhost -a /bin/date

ansible localhost -m ping



This is a nice tutorial - skip first 13 minutes, then you have 20 minutes of theory, then some interesting Ansible examples








Friday, March 27, 2015

Clash of Titans, Ansible vs Puppet vs Salt



I have read this excellent article

https://dantehranian.wordpress.com/2015/01/20/ansible-vs-puppet-overview/

with part 2 https://dantehranian.wordpress.com/2015/01/20/ansible-vs-puppet-hands-on-with-ansible/

I have been dreaming of writing the same article for a long time....

2 statements caught my attention

"“I would say that if you don’t have a Puppet champion (someone that knows it well and is pushing to have it running) it is probably not worth for this.""

" I tend to agree with Lyft’s conclusion that if you have a centralized Ops team in change of deployments then they can own a Puppet codebase. On the other hand if you want more wide-spread ownership of your configuration management scripts, a tool with a shallower learning curve like Ansible is a better choice."



I haven't used Ansible, but such is my experience with Puppet: you need a technical guru (or max 2) dictating standards and finding solutions to common problems and bridging communication among departments and teams.... you can't just "leave it to the masses" and hoping everybody will be a champion... also, who wants Ruby? All my stuff is in Python !!!

And here goes a very interesting comparison Ansible vs Salt...

And here a "let's move away from Puppet, either to Salt or to Ansible" post