Anzeige
Anzeige

Más contenido relacionado

Anzeige
Anzeige

Introduction to ansible

  1. 1 Introduction to Ansible (IT Automation or Orchestration Engine) Mukul Malhotra Red Hat Gluster Storage
  2. 2 Agenda ● Introduction: What is Ansible ? ● Ansible Architecture ● Components ● Inventory File ● Facts ● Modules ● Playbooks ● Installation: Getting Started ● Ad-Hoc Method ● Demo ● Questions ?
  3. 3 Introduction: What is Ansible ? ● Simple IT automation platform ● Written in Python ● Playbooks written in YAML files ● Uses an agentless, SSH-based model ● Require no server or client daemons ● Modules included ● Easy to manage ● Push mechanism
  4. 07/19/16 The Future of Gluster.org - John Mark Walk er Ansible Architecture
  5. 07/19/16 The Future of Gluster.org - John Mark Walk er Inventory ● Inventory files are simple text files which describe your target machines ● Catagorize by IP Addresses, DNS Names & group names ● Configured in /etc/ansible/hosts Example: [www] 168.197.1.15 168.197.1.16 168.197.1.17 [db] 192.168.1.[18:25]
  6. 07/19/16 The Future of Gluster.org - John Mark Walk er Facts ● When Ansible host connects to the target server(s), It queries the server(s) for all kinds of details about the server(s): CPU architecture, operating system, IP addresses, memory info, disk info, and more ● Viewing All Facts Associated with a Server, $ ansible server1 -m setup
  7. 07/19/16 The Future of Gluster.org - John Mark Walk er Module ● Modules (also referred to as “task plugins” or “library plugins”) are the ones that do the actual work in ansible, they are what gets executed in each playbook task. ● These modules can control system resources, like services, packages, or handle executing system commands. ● You can also run a single module using the ‘ansible’ command with ad-hoc method. ● Documentation for each module can be accessed from the command line with the ansible-doc tool: # ansible-doc -l # ansible-doc ping Example: # ansible webservers -m service -a "name=httpd state=started" # ansible webservers -m ping # ansible webservers -m command -a "/sbin/reboot -t now"
  8. 07/19/16 The Future of Gluster.org - John Mark Walk er Playbooks ● Playbooks can be used to manage configurations of and deployments to remote machines. ● Playbooks are designed to be easy and are developed in a basic text language ● Playbooks are expressed in YAML format YAML Syntax: --- # Employee records - martin: name: Martin job: Developer skills: - python - perl - pascal
  9. 9 Installation: Getting Started # yum install python-pip ● Refer, https://access.redhat.com/solutions/472793 # pip install ansible [--upgrade]
  10. 07/19/16 The Future of Gluster.org - John Mark Walk er Introduction to Ad-hoc commands ● An ad-hoc command is something that you might want to type in to do something really quick ● Don't want to save for later ● Don't want to write a full playbook Example: # ansible webservers -m service -a "name=httpd state=started" # ansible webservers -m ping # ansible webservers -m command -a "/sbin/reboot -t now"
  11. 07/19/16 The Future of Gluster.org - John Mark Walk er Other Solutions
  12. 07/19/16 The Future of Gluster.org - John Mark Walk er Demo
  13. 07/19/16 The Future of Gluster.org - John Mark Walk er Thank You Questions/Feedback ?
Anzeige