OSCamp 2019 | #3 Ansible: Is that an ansible? by Felix Frank
1. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 1/120
IS THAT AN ANSIBLE?IS THAT AN ANSIBLE?
STOP HOLDING IT LIKE A PUPPET.STOP HOLDING IT LIKE A PUPPET.
OSCamp 2019, Berlin
Felix Frank, Systems Architect
The unbelievable Machine Company GmbH
2. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 2/120
WHAT? WHO NOW?WHAT? WHO NOW?
Felix (probably not literally a cat)
old command line geezer
open source vagabond
config management nerd
would've come here by bicycle
3. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 3/120
A text
4. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 4/120
The pig go. The pig put foot. Grunt.
The dove fly. The dove
drop something. The pig
disgusting. Rattle with dove.
The pig leave. Produce is chicken wing.
No Quack.
Go is to the fountain.
Foot in what? ketchup. Fly is in sky.
The something on the pig.
The pig rattle. The dove angry.
The dove produce.
With wing bark.
5. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 5/120
Guess the author?
6. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 6/120
The story goes as follows.
7. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 7/120
8. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 8/120
9. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 9/120
10. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 10/120
11. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 11/120
12. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 12/120
13. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 13/120
14. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 14/120
15. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 15/120
16. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 16/120
17. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 17/120
18. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 18/120
19. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 19/120
20. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 20/120
21. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 21/120
Don't use blatantly wrong tools.
22. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 22/120
When all you have
is a hammer,
everything looks like a nail
23. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 23/120
NO QUACK.NO QUACK.
24. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 24/120
Welcome to Ansible session 2
25. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 25/120
26. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 26/120
Benefits of config management
No manual tinkering. No wiki install guides.
27. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 27/120
Repeatable setup
28. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 28/120
Infrastructure as Code
29. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 29/120
Let's model a webserver
30. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 30/120
In Puppet
Class
varnish
Class
apache
Class
jvm
31. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 31/120
Class
varnish
Class
apache
Class
jvm
Package
varnish
Package
apache2
Package
open-jdk-8
File
/etc/default/varnish
File
default.vcl
File
httpd.conf
File
jce.zip
Exec
unzip jce.zip
Service
varnish
Service
apache2
vhost
corporate
vhost
ads
32. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 32/120
Class
varnish
Class
apache
Class
jvm
Package
varnish
Package
apache2
Package
open-jdk-8
File
/etc/default/varnish
File
default.vcl
File
httpd.conf
File
jce.zip
Exec
unzip jce.zip
Service
varnish
Service
apache2
vhost
corporate
vhost
ads
33. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 33/120
Class
varnish
Class
apache
Class
jvm
Package
varnish
Package
apache2
Package
open-jdk-8
File
/etc/default/varnish
File
default.vcl
File
httpd.conf
File
jce.zip
Exec
unzip jce.zip
Service
varnish
Service
apache2
vhost
corporate
vhost
ads
34. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 34/120
Ansible: Similar but different
35. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 35/120
In Ansible
Role
varnish
Role
apache
Role
jvm
36. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 36/120
Role
varnish
Role
apache
Role
jvm
Apt
varnish
Apt
apache2
Apt
open-jdk-8
File
/etc/default/varnish
File
default.vcl
File
httpd.conf File
jce.zip
Unarchive
jce.zip
Service
varnish
Service
apache2
vhost
corporate
vhost
ads
37. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 37/120
requirement
Role
varnish
Role
apache
Role
jvm
Apt
varnish
Apt
apache2
Apt
open-jdk-8
File
/etc/default/varnish
File
default.vcl
File
httpd.conf File
jce.zip
Unarchive
jce.zip
Service
varnish
Service
apache2
vhost
corporate
vhost
ads
38. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 38/120
Architecture: Puppet
Master
Agent
Facter
Agent
Facter
Agent
Facter
Manifest
node A {
include B
}
PuppetDB
Hiera
API
Master API
39. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 39/120
Architecture: Ansible
Ansible
Initiator
Host
Playbook
hosts: webtier
roles:
- apache
Inventory
Hosts
[group A]
...
[group B]
Variables
group A: {
...
}
ssh
Host
ssh
Host
ssh
Host
ssh
40. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 40/120
Naming Things is Hard
Puppet Ansible
resource type module
module role
role group (more or less)
resource task
41. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 41/120
Working with: Puppet
Editing code and data
Puppet manifests
Hiera data stores
42. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 42/120
class nodejs::install {
$npmrc_auth = $::nodejs::npmrc_auth
if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
}
# npm is a Gentoo USE flag
if $::operatingsystem == 'Gentoo' {
package_use { $nodejs::nodejs_package_name:
ensure => present,
target => 'nodejs-flags',
use => $nodejs::use_flags,
before => Package[$nodejs::nodejs_package_name],
}
43. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 43/120
---
nodejs::npm_path: /opt/osdc/npm/bin/npm
nodejs::manage_package_repo: false
nodejs::repo_proxy: "10.17.81.121"
nodejs::repo_proxy_username: sys
nodejs::repo_proxy_password: o0psThisisS3cre3t
apache::default_vhost: stage_site
apache::user: fitz
44. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 44/120
Modules are available from the Puppet Forge
45. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 45/120
web1
db1
web2
Profile: apache_customer1
Profile: apache_customer2
Profile: nginx
Profile: mysql
nginx
mysql
io_tuning
apache
Roles Profiles Modules
Custom code organized into Roles and Profiles
46. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 46/120
http://projects.theforeman.org/projects/foreman/wiki/Screenshots
Optionally use ENCs like the Foreman
47. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 47/120
http://maxpixel.freegreatpicture.com/Dream-Space-Sky-Galaxy-Magic-Unicorn-Fantasy-2035174
orchestration through MCollective
48. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 48/120
visualization with e.g. PuppetBoard
49. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 49/120
http://www.dailymail.co.uk/news/article-3152277/Dog-tor-Doolittle-Pet-pooch-friends-animals-loves-snuggling-hamster-bird-pals.html
50. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 50/120
Working with: Ansible
Write code in Ansible's YAML language:
structure things into roles
orchestrate roles across your infrastructure in playbooks
51. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 51/120
---
# roles/varnish/tasks/main.yml
- name: Install the varnish package
apt: name=varnish state=installed
- name: Write varnish config files
template: src={{ item.template }} dest={{ item.dest }} mode=0644
with_items:
- dest: /etc/default/varnish
src: etc_default_varnish.j2
- dest: /etc/varnish/default.vcl
src: etc_varnish_default.vcl.j2
- name: Manage varnish service
i i i i
52. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 52/120
---
# playbooks/webtier.yml
- name: Provision webservers
hosts: web
roles:
- common
- apache
- name: Provision reverse proxies
hosts: proxies
roles:
- common
- varnish
53. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 53/120
Open Source Roles from Ansible Galaxy
54. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 54/120
customize machines and groups using
--- | ---
# inventory/group_vars/all/vars.yml | # inventory/group_vars/web/vars
ssh_enabled: true | ssh_root_login: true
ssh_root_login: false |
| password_hashes:
password_hashes: | root: ""
root: "$6$deadbeef" | felix: "{{ password_hashes.fe
felix: "$6$acceff00" | gitlab_ssh_key: "{{ vault_gitla
variables
55. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 55/120
Ansible
Initiator
Host
Playbook
hosts: webtier
roles:
- apache
Inventory
Hosts
[group A]
...
[group B]
Variables
group A: {
...
}
ssh
Host
ssh
Host
ssh
Host
ssh
run from anywhere using ssh
56. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 56/120
http://projects.theforeman.org/projects/foreman/wiki/Screenshots
Foreman supports Ansible as well
57. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 57/120
https://img.memecdn.com/youre-doing-it-wrong_o_195760.jpg
not very comfortable without Ansible Tower
(now awx)
58. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 58/120
We've seen the parallels
Nowforthedifferences
59. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 59/120
Puppet models systems
system state will (should) converge
equilibrium o en a er single transaction
each machine has a definitive catalog of state
60. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 60/120
The Puppet Model
61. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 61/120
62. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 62/120
63. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 63/120
64. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 64/120
65. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 65/120
66. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 66/120
67. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 67/120
68. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 68/120
Ansible models
distributed activity
structured like a script, convergence is up to the user
a play in a playbook is like a view or projection
assigns tasks to hosts, rather than state
69. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 69/120
The Ansible Model
70. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 70/120
71. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 71/120
72. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 72/120
73. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 73/120
74. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 74/120
75. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 75/120
76. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 76/120
77. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 77/120
78. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 78/120
79. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 79/120
80. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 80/120
81. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 81/120
82. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 82/120
In Summary
83. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 83/120
Ansible v Puppet
84. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 84/120
Or let's use a metaphor
85. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 85/120
Imagine your infrastructure
was a theatre stage
86. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 86/120
87. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 87/120
88. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 88/120
So don't try to push Ansible into a Puppet-shaped box.
https://img.memecdn.com/youre-doing-it-wrong_o_195760.jpg
89. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 89/120
Some Ansible tips
Having a site.yml is nice, but it should not be
the primary use case.
Running the code for all machines will become
too slow sooner or later.
90. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 90/120
Tags aren't very flexible.
Better to rely on single-purpose playbooks.
Create ad-hoc playbooks whenever you need.
91. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 91/120
Don't shoot for DRY on playbook level.
But do make DRY roles.
92. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 92/120
Take advice on best practices
from the upstream Ansible documentation
with a grain of salt.
93. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 93/120
Let's look at site.yml
94. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 94/120
Ansible in Puppet-like mode
95. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 95/120
96. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 96/120
97. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 97/120
98. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 98/120
99. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 99/120
100. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 100/120
101. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 101/120
Use the tooling.
Orchestrate
102. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 102/120
Proper Ansible
103. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 103/120
104. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 104/120
105. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 105/120
106. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 106/120
107. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 107/120
108. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 108/120
109. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 109/120
110. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 110/120
111. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 111/120
When to choose Ansible over Puppet
need to cover code deployments?
primarily managing switches and similar gear?
many use cases for "ad hoc" management?
ubiquitous Python but no Ruby?
112. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 112/120
When to choose Puppet over Ansible
managing only OS level system properties?
very heterogeneous environment?
you value power over simplicity?
ubiquitous Ruby but no Python?
(or Python 3 only?)
you are certain that scale will be huge
113. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 113/120
Should I combine both?
Only if you know what you are doing.
There is value in limiting your tool chain.
114. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 114/120
Finally, what's the best way to lead discussions about config
management tools?
Well...
115. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 115/120
116. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 116/120
http://www.mrwallpaper.com/wallpapers/man-tiger-hug-1024x1024.jpg
Thanks for listening!
117. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 117/120
We are filling many (not only tech) roles!
Check out our careers page
118. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 118/120
Questions?
119. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 119/120
Testing tools
Style Puppet Ansible
Preview --noop --check
Unit rspec-puppet N/A
Static catalog-diff N/A
Acceptance beaker testinfra
120. 16/05/2019 Is that an Ansible? Stop Using It Like a Puppet - OSCamp 2019 - Felix Frank
localhost:8000/2019-renewed-ansible-v-puppet.html?print-pdf#/ 120/120
@felis_rex / ffrank Puppet vs. Ansible CfgMgmtCamp 2018
Attributions
The Git logo, available under .
The Jenkins logo:
Creative Commons 3.0
https://jenkins.io/