Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Ansible in 40 minutes
Installation
● If you do not have ansible installed yet, please
do it now:
http://docs.ansible.com/ansible/intro_installat...
Main features
● Agentless
● Secure
● Provisioning AND deployment
● Easy to start
● Data driven
● Idempotent
Key concepts
● Inventory
– List of managed computers, can be grouped.
– Default in /etc/ansible/hosts.
– May be dynamicall...
Key concepts (2)
● Variables
– Defined on multiple levels (host, group, inventory).
– Used for conditionals and in templat...
Key concepts (3)
● Task
– One task do one thing (usually it is module invocation).
● Play
– Set of tasks that run on group...
Toolset
● ansible
– Can run ad-hoc commands.
● ansible-playbook
– Run a playbooks (what a coincidence!).
● ansible-galaxy
...
Workshop!
● Install full HA load balanced LAMP stack with
replicated mysql.
● Time: 4 hours
● Probability I will be dragge...
Workshop!
● Install ntp server
● Time: 30 minutes
● Probability I will be dragged away by force: Low
● Maybe boring, but h...
Install ntp (in playbook)
● Get playbook: git clone
https://github.com/davidkarban/devconfcz2016_
ntp_playbook.git
Install ntp (thru role)
● Install role: sudo ansible-galaxy install
davidkarban.devconfcz2016_ntp_role
Thanks!
David Karban
david@karban.eu
www.karban.eu
https://twitter.com/davidkarban
https://github.com/davidkarban/
Upcoming SlideShare
Loading in …5
×

Ansible basics workshop

287 views

Published on

Slides from ansible workshop on devconf.cz, youtube link: https://www.youtube.com/watch?v=ISu9YV2eoug

Published in: Internet
  • Be the first to comment

Ansible basics workshop

  1. 1. Ansible in 40 minutes
  2. 2. Installation ● If you do not have ansible installed yet, please do it now: http://docs.ansible.com/ansible/intro_installation .html#installing-the-control-machine ● We will need the git, too. ● It should be included on USB stick in virtual machine.
  3. 3. Main features ● Agentless ● Secure ● Provisioning AND deployment ● Easy to start ● Data driven ● Idempotent
  4. 4. Key concepts ● Inventory – List of managed computers, can be grouped. – Default in /etc/ansible/hosts. – May be dynamically generated. ● Module – Basic work units. – Plenty of them (hundreds) available. – Template, copy, user, ... – http://docs.ansible.com/ansible/list_of_all_modules.html
  5. 5. Key concepts (2) ● Variables – Defined on multiple levels (host, group, inventory). – Used for conditionals and in templates. ● Facts – Special variables taken from server (hostname, date and time, networking setup, …). – ansible -m setup localhost
  6. 6. Key concepts (3) ● Task – One task do one thing (usually it is module invocation). ● Play – Set of tasks that run on group of computers. ● Playbook – Bunch of plays in one file. ● Role – Encapsulate set of tasks, variables, templates, files together.
  7. 7. Toolset ● ansible – Can run ad-hoc commands. ● ansible-playbook – Run a playbooks (what a coincidence!). ● ansible-galaxy – Download roles from other ansible users. ● ansible-vault – Can encrypt variables, protect passwords, etc.
  8. 8. Workshop! ● Install full HA load balanced LAMP stack with replicated mysql. ● Time: 4 hours ● Probability I will be dragged away by force: High ● It was tempting to see how long I`ll be able to speak :).
  9. 9. Workshop! ● Install ntp server ● Time: 30 minutes ● Probability I will be dragged away by force: Low ● Maybe boring, but hey, we have to start somewhere!
  10. 10. Install ntp (in playbook) ● Get playbook: git clone https://github.com/davidkarban/devconfcz2016_ ntp_playbook.git
  11. 11. Install ntp (thru role) ● Install role: sudo ansible-galaxy install davidkarban.devconfcz2016_ntp_role
  12. 12. Thanks! David Karban david@karban.eu www.karban.eu https://twitter.com/davidkarban https://github.com/davidkarban/

×