Chapter 1- What is Ansible?
CHAPTER 1- AUTOMATION WITH ANSIBLE
CHAPTER 2-Install & configure ansible server nodes for manage inventory
Chapter 3-Performing Ad Hoc Commands with Ansible
CHAPTER 4-IMPLEMENTING PLAYBOOKS
Ansible is an open source automation platform. It's a simple automation language that can perfectly describe an IT application infrastructure in Ansible Playbooks. It's also an automation engine that runs Ansible Playbooks
Ansible Is Simple Ansible Playbooks provide human-readable automation. This means that your playbooks are automation tools that are also easy for humans to read, comprehend, and change. No special coding skills are required to write them. Playbooks execute tasks in order. The simplicity of playbook design makes them usable by every team. This allows people new to Ansible to get productive quickly.
Ansible has a number of important strengths:
•Cross platform support: Ansible provides agentless support for Linux, Windows, UNIX, and network devices, in physical, virtual, cloud, and container environments.
•Human-readable automation: Ansible Playbooks, written as YAML text files, are easy to read and help ensure that everyone understands what they will do
•Perfect description of applications: Every change can be made by Ansible Playbooks, and every aspect of your application environment can be described and documented.
•Easy to manage in version control: Ansible Playbooks and projects are plain text. They can be treated like source code and placed in your existing version control system
Installing Ansible :
• We are going to Install Ansible on server which is control all node .The control node should be Linux / Unix . Window is not support as control node.
Needs: Python 2 ( V 2.6 or later). Not recommend to install Python V3 on production with Ansible.
Step 1. Install python
root@Master_node ~]# yum list installed python
root@Master_node ~]# sudo yum install -y ansible
root@Master_node ~]# mkdir inventory
root@Master_node ~]# cd inventory
root@Master_node inventory ]# ansible dev -i inventory --list-hosts
Milestone 1.
The Inventory:
root@Master_node ~]# mkdir inventory
root@Master_node ~]# cd inventory
In the following example, the host inventory defines two host groups, webservers and db-servers.
Defining Nested Groups
Simplifying Host Specifications with Ranges :
Ranges match all the values from START to END, inclusive. Consider the following examples:
•192.168.[4:7].[0:255] will match all IPv4 addresses in the 192.168.4.0/22 network(192.168.4.0 through 192.168.7.255).
•server[01:20].example.com will match all hosts named server01.example.com through server20.example.com.
Milestone 2.
Managing Ansible Configuration Files
Steps 1.
Create the /home/tom/dep-manage directory, which will contain the files for this exercise. Change to this newly created directory.
[root@control ~]$ mkdir /home/node/dep-manage
[root@control ~]$ cd /home/node/dep-manage
3. In the /home/node/dep-manage directory, use a text editor to start editing the new static inventory file, inventory.
[root@control dep-manage]$vim inventory
localhost
[intranet_web]
servera.example.com
[everyone:children]
local
intranet_web
Note: Create the privilege_escalation section in the /home/node/dep-manage/ansible.cfg
[defaults]inventory = ./inventory
[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = true
No comments:
Post a Comment