whoami
●
(PHP) Developer Advocate at
DigitalOcean
●
Working with PHP and Linux
for 10+ years
●
Author of Vagrant Cookbook
and phansible.com
Slide 3
Slide 3 text
What to expect from this talk
1. Ansible Overview and Installation
2. Inventories and ad-hoc Commands
3. Working with Playbooks
4. Useful Resouces
Slide 4
Slide 4 text
Ansible Overview
Slide 5
Slide 5 text
1.1 Ansible Overview
●
Simple and Straightforward
●
Human-readable automation
language
●
Agentless - needs only SSH
●
Extensive list of build-in modules
●
Used by Twitter, Atlassian, EA,
Spotify, even NASA!
Slide 6
Slide 6 text
1.2 Installation
$ brew update
$ brew install ansible
$ sudo apt-add-repository -y ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install -y ansible
Detailed installation instructions: do.co/ansible-docs
Mac OSX
Ubuntu
*Windows is not officially supported as controller machine.
Slide 7
Slide 7 text
1.3 Setting up SSH access
●
Servers should be accessible via SSH using
keypair authentication
●
It's recommended to have a user with sudo
permission to run the tasks in the server
How to configure your SSH access for running
Ansible: bit.ly/ansible-ssh
3.5 Conditionals
- name: "shutdown Debian flavored systems"
command: /sbin/shutdown -t now
when: ansible_os_family == "Debian"
- name: foo is defined
shell: echo "I've got '{{ foo }}' and am not afraid to use it!"
when: foo is defined
- name: foo is not defined
fail: msg="Bailing out. this play requires 'bar'"
when: bar is not defined
Slide 29
Slide 29 text
3.4 Templates
ServerAdmin webmaster@localhost
DocumentRoot {{ doc_root }}
AllowOverride All
Require all granted