Ansible with vCloud Air Workshop Install, configure and use Ansible on your laptop to provision workloads in vCloud Air
Abstract Learn the basics of Ansible, use this workshop to install, setup and configure Ansible on your laptop. Once you have successfully configured Ansible, then learn how to use it for DevOps deployment into your vCloud Air environments. Dylan Silva, Sales Engineer, Ansible Inc. 8/31/2015
What is Ansible? SIMPLE AGENTLESS POWERFUL Human Readable Automation No Special Coding Skills Required Tasks executed in order Get Productive Quickly AGENTLESS No extra code to manage Uses OpenSSH No agents to exploit or update More Efficient and Secure POWERFUL App Deployment Configuration Management Workflow Orchestration Orchestrate the app lifecycle
Inventory Modules Tasks Plays Playbooks Ansible Components CONFIDENTIAL
Inventory Hosts and Groups Inventory Sources
Inventory-specific data Static / Dynamic Sources Inventory Concepts Hosts Groups Inventory-specific data Static / Dynamic Sources CONFIDENTIAL
Defines: Port and Address Remote/sudo usernames Connection type Inventory: Hosts Defines: Port and Address Remote/sudo usernames Connection type CONFIDENTIAL
Inventory: Hosts CONFIDENTIAL
Inventory: Hosts CONFIDENTIAL
Inventory: Hosts CONFIDENTIAL
Modules Bits of code copied to the target system. Executed to satisfy the task declaration. Customizable.
vca_vapp vca_nat vca_fw apt/yum copy file service template Modules Examples vca_vapp vca_nat vca_fw apt/yum copy file service template CONFIDENTIAL
TASKS Directory should exist Package should be installed Service should be running Render a template into a configuration file vCloud Air instance should exist
Tasks: Examples CONFIDENTIAL
file: path=/opt/cache state=directory - name: install nginx Using Modules in Tasks - name: add cache dir file: path=/opt/cache state=directory - name: install nginx yum: name=nginx state=present - name: start nginx service: name=nginx enabled=yes state=started state=started CONFIDENTIAL
Exercise 1 Install Ansible Setup key(s) Run a couple of tasks
Plays Play naming Hosts selection Play arguments Variables Tasks Concurrency and order of operations Conditionals
Play Naming name: This is a Play CONFIDENTIAL
Hosts Selection name: This is a Play hosts: web-servers CONFIDENTIAL
Play Arguments name: This is a Play hosts: web-servers remote_user: fred sudo: yes connection: ssh CONFIDENTIAL
cache_dir: /opt/cache Variables name: This is a Play hosts: web-servers remote_user: fred sudo: yes connection: ssh vars: http_port: 80 cache_dir: /opt/cache CONFIDENTIAL
Tasks name: This is a Play hosts: web-servers remote_user: fred sudo: yes connection: ssh vars: http_port: 80 cache_dir: /opt/cache tasks: - name: create cache dir file: path={{ cache_dir }} state=directory - name: install nginx yum: name=nginx state=installed CONFIDENTIAL
Exercise 2 Download playbooks Make modifications to playbooks Execute Playbooks against vCloud Air