Below you will find pages that utilize the taxonomy term “Ansible”
postsread more
ansible role, vars / default files
overview
given a certain role, there are 2 folders to store variables, namely
[role root]/default
[role root]/vars
by default there is an empty main.yml
there.
storing all vars inside either of them will get messy easily, so it gets natural to group vars by different files.
but, trying to import / include them inside main.yml
won’t work.
the trick to load them all
create these folders :
[role root]/default/main/
[role root]/default/vars/
and put relevant files / folder(s) of files inside accordingly.
postsread more
add git repo local clones to other hosts
1. add url to repo ( according to .git/config ) and local destination file path
- target file :
set-facts-repo.yaml
- file path :
[ansible-repo-root]/etc/playbooks/roles/maintenance/tasks/git/tasks
2. add the above facts to the git pull loop
- target file :
git-pull.yaml
- file path :
[ansible-repo-root]/etc/playbooks/roles/maintenance/tasks/git