- A role is a
roles/<name>/directory: tasks intasks/main.yml, handlers inhandlers/main.yml, templates intemplates/, default values indefaults/main.yml; a play calls it with theroleslist and sets its ownvars. - Group and machine variables live in
group_vars/andhost_vars/next to the inventory; of a role'sdefaults,group_vars,host_vars, a play'svarsand-e, the later one in the list wins, and-elasts one run. ansible-vault encryptencrypts a file with a secret, and a run decrypts it with the vault password from--ask-vault-passor fromvault_password_file; the password file lives outside the project.- The phone from the start of the lesson reached only shop because the playbooks were three copies of the tasks; with a role the edit is one line in
defaults, and the database password is written once, in an encrypted file.
Step 6 of 6 · summary · 3 min
Summary
Found an inaccuracy? Report an error in the lesson