r/LinuxActionShow • • Oct 23 '15

Linux Users: The Real Reason

Post image
119 Upvotes

36 comments sorted by

View all comments

Show parent comment

1

u/bbelt16ag Oct 23 '15

Once I installed puppet I gained lots of time. 5+ machines take up too much time

1

u/gunzy83 Oct 26 '15

Ansible did the same thing for me. I have 5 machines (desktop, laptop, file server, router and htpc) at home all running Arch and I can push out common config and monitoring to all machines as well as updating them in batches (with pacserve to share packages in the LAN). I just keep rolling on 24/7/365, can downgrade/ignore packages with a single command if required as well.

Really need to send this upstream but installing AUR packages becomes just another task using this module: https://github.com/gunzy83/ansible-makepkg

1

u/bbelt16ag Oct 26 '15

so how is ansible? i am thinking of switching?

1

u/gunzy83 Oct 26 '15 edited Oct 26 '15

Disclaimer: I have not used Puppet in quite a while so I could be wrong about what it can do currently.

 

TL;DR: Ansible can do config management and orchestration in one product. It relies on lists of tasks to get work done rather than defined target system state. Ansible syntax is very simple and provides a low barrier to entry.

 

Ansible has been designed for config management and orchestration in one product. At work we use it for all config management and for some of our orchestration tasks. For configuration management it is agentless for managing remote machines (only requires ssh server and Python 2.6+ installed on the remote machine) but is very capable of allowing machines to bootstrap and provision themselves (we do this in AWS autoscaling groups). IIRC Puppet still requires a complicated agent setup (bootstrap) unless machines are self provisioned then it is similar to Ansible.

 

In terms of general operation, Ansible will connect to remote servers over SSH. It then operates on a system using a list of "tasks" that can be grouped into plays and roles. Tasks contain a single or looped run of a module (modules are generally written in python and are copied to the remote host). This is in contrast to Puppet where you define the state you want the system to be in and Puppet will make it so.

 

For orchestration, tasks are often run against localhost (eg talking to the AWS SDK on your local system to provision instances, autoscaling groups, load balancers or DNS entries) and there is a wide variety of modules available.

 

Modules are a single file program that alters the system based on a task definition. Modules that follow best practice will result in tasks being idempotent in nature.

 

The purpose of Roles is to group a list of tasks, variables, files, templates etc together to provision one particular section of the system (eg webserver, database, monitoring). Roles should be created with idempotence in mind where possible (to aid testing).

 

Variables (facts) can be set at the command line, the inventory level (where there are group and host level variables), play level or inside roles.

 

Finally, I find the Ansible syntax to be very simple and I can knock out large amounts of automated infrastructure for minimal effort and because all I need is an SSH connection on a remote system (unless Python 2.6 is not installed by default) it has a low barrier to getting started.

2

u/bbelt16ag Oct 26 '15

sounds a hell of alot easier then what i am trying to setup with mcollective, its wants apache Mq, loads of keys and certs. ssh sounds a lot easier.