Monday, March 6, 2017

Ansible Notes

Sample Commands:

Ansible - Scripting using playbooks is the main critereon

Puppet - Module
Chef - Cookbook
Ansible - Playbook

Playbooks are used to perform many actions on multiple machines

Playbooks are written in YAML language

Playbooks are divided into three sections:
===========================================

1. Target Section
   Similar to nodes.pp in puppet
              runlist  in Chef
   Target hosts defines on which hosts, this playbook will be executed and how it will be executed

2. Variable Definition
   Define your variables, which can be used from the playbooks

3. Tasks Section
   What do you intend to do on the target hosts
   List all the modules that you intend to run in the order.

As ansible is agentless, we dont need any angent on the remote host


The playbook Syntax:
Always starts with ---
It is very particular about intendation and spacing

---
 - hosts: hostname.example.com
   




The tasks title in puppet is the name in playbook
Use the copy module , source and destination to copy the stuff