path to automation

ansible

with

LB
APP
DB
LB
APP
DB
APP
APP

Steps

  • Create User
  • Install Apps
  • Manage Configs
  • Start Service 
APP

Steps

  • Create User
  • Install Apps
  • Manage Configs
  • Start Service 

Map to Ansible Modules

Modules

user
package
template
service
user
package
template
service
state = present
uid = 5001
home = /home/xyz
pass = xxxx
name = xyz
state = installed
version = 7.0.4
state = running
state = present
source = xyz.j2
owner = root
mode = 0644
name = xyz

Task Definitions

task1
task2
- user:
    name: xyz
    comment: "Xy Z"
    uid: 5001
    group: devops
- package:
    name: tomcat
    version: 7.0.1
main.yml
user
package
modules
task file
objective
ta1.yml
ta2.yml
tasks
ta1.yml
ta2.yml
tasks
f1
files
f2
vars
main.yml
app1
roles
java
roles
tomcat
mysql
appn
servers
which server applies what? 
playbooks
inventory
playbooks
play 1
play 2
play 3
- hosts: db
  remote_user: devops
  become: true
  roles:
     - { role: mysql, tags: 'mysql'  }
- hosts: www
  remote_user: devops
  become: true
  roles:
     - base 
     - java
     - tomcat
 
- hosts: lb
  remote_user: devops
  become: true
  roles:
     - base 
     - ssl
     - haproxy
 
host
role1
role2
role3
playbooks
provisioning
installation & 
configurations
application deployment

one server many Playbooks

playbook3
playbook2
playbook3
  • How to write Ansible Playbooks
  • How to create modular code with roles 
  • How to create data driven, dynamic, flexible configurations
  • How to manage multiple environments 
  • How to do achieve zero downtime application deployments with Ansible

Reviews

learnansible.org

Ansible: Path to Automation with Ansible

By School of Devops

Ansible: Path to Automation with Ansible

Overview of Ansible Tasks, Plays, Modules, Playbooks, Roles etc.

  • 2,048