際際滷

際際滷Share a Scribd company logo
Ansible Galaxy @ Berlin Meetup 0415
2
Getting around with
3
4
12511 users and 3325 role in total
ansible-galaxy
¢ init sets up the skeleton of the role
¢ info queries Galaxy API to fetch info about a role
¢ install pulls down a role from Galaxy and installs it
¢ list shows installed roles and their versions
¢ remove rm-rf gracefully removes a role
5
You¨re just starting but you wanna help?
¢ Look for a role on ^Galaxy ̄ before starting
from scratch => great time saver
¢ Review the role (mention what doesn¨t work /
isn¨t clear or simply give kudos) => it helps a
lot!
6
Calling proficient ansiblings: share your roles!
¢ don¨t assume anything
¢ use git tags as role versions (integrates nicely with Galaxy)
¢ don¨t forget: it¨s just a role, so no inventories or playbooks
¢ prefix the vars with rolename_ (ensures no conflicts)
¢ if your role relies on other roles, use meta/main.yml to
specify the roles dependencies; requirements.yml is a
bonus
¢ consistent naming: github repo name == galaxy role name
¢ use Ansible itself to do unit tests through Jenkins / Travis
(with Ansible¨s assert module) 7
Some great roles that I re-use often
¢ ANXS.generic-users
¢ geerlingguy.apache
¢ jdauphant.nginx
¢ f500.elasticsearch
¢ lesmyrmidons.mongodb
¢ graylog2.graylog
¢ geerlingguy.solr
¢ geerlingguy.java
¢ etc. 8
Demo
9
Closing words
When installing Galaxy roles, specify the
version so that you won¨t run into regressions
when the maintainer pushes new versions =>
predictability
10
Closing words
When you write a role that has other Galaxy
roles dependencies, don¨t try to overwrite the
other roles¨ vars in your role;
your role should only have vars for itself =>
instruct the user to define / include vars in the
playbook or pass them as extra vars
11
Questions?
12
Thanks!
際際滷s:
tinyurl.com/AnsibleBerlin0415
13

More Related Content

Ansible Galaxy @ Berlin Meetup 0415

  • 2. 2
  • 4. 4 12511 users and 3325 role in total
  • 5. ansible-galaxy ¢ init sets up the skeleton of the role ¢ info queries Galaxy API to fetch info about a role ¢ install pulls down a role from Galaxy and installs it ¢ list shows installed roles and their versions ¢ remove rm-rf gracefully removes a role 5
  • 6. You¨re just starting but you wanna help? ¢ Look for a role on ^Galaxy ̄ before starting from scratch => great time saver ¢ Review the role (mention what doesn¨t work / isn¨t clear or simply give kudos) => it helps a lot! 6
  • 7. Calling proficient ansiblings: share your roles! ¢ don¨t assume anything ¢ use git tags as role versions (integrates nicely with Galaxy) ¢ don¨t forget: it¨s just a role, so no inventories or playbooks ¢ prefix the vars with rolename_ (ensures no conflicts) ¢ if your role relies on other roles, use meta/main.yml to specify the roles dependencies; requirements.yml is a bonus ¢ consistent naming: github repo name == galaxy role name ¢ use Ansible itself to do unit tests through Jenkins / Travis (with Ansible¨s assert module) 7
  • 8. Some great roles that I re-use often ¢ ANXS.generic-users ¢ geerlingguy.apache ¢ jdauphant.nginx ¢ f500.elasticsearch ¢ lesmyrmidons.mongodb ¢ graylog2.graylog ¢ geerlingguy.solr ¢ geerlingguy.java ¢ etc. 8
  • 10. Closing words When installing Galaxy roles, specify the version so that you won¨t run into regressions when the maintainer pushes new versions => predictability 10
  • 11. Closing words When you write a role that has other Galaxy roles dependencies, don¨t try to overwrite the other roles¨ vars in your role; your role should only have vars for itself => instruct the user to define / include vars in the playbook or pass them as extra vars 11