Sasha Reid (sasha at- hackl.es) @microwavenby
Just use the PDF of slides: https://bit.do/seagl_ansible https://d.pr/f/Nguxgt
create dir
- name:
file:
clone git repo
- name:
git:
virtualenv
- name:
become: no
pip:
requirements:
install supervisord
- name:
apt:
name: supervisor
state: latest
- name:
template:
src:
dest:
start app
- it works
- a second one look svery similar and duplicate....
- ansible prioritization of variables is confusing
- roles allow to segment into the required sub-folders
- folders auto-detect main.yml into the folders
- don't duplicate all of the playbook
what is the difference between variables & defaults? defaults get overridden first, bottom of precedence
basically:
- group_vars
- host_vars
- host facts
- play vars
- role vars
- block vars
- task vars
- cli vars
- setting defaults sets documentation of sane
-
make important values into vars
-
"role inheritence", make much more generic
-
then a "sub-role" that just consumes the generic one!
- don't set defaults in the sub-role, they smash the meta-role ones
-
roles in /meta/ get executed first before /tasks/, and in order
-
pass full paths to your meta-roles - they don't get operated in the sub-role context
-
only need include_role: tasks for much more control, running multiple times