On 2/17/20 11:06 PM, Maciej Delmanowski wrote:
You need to use 'import_playbook' instead of
'include' for the playbook:
#v+
---
- import_playbook: 'app.yml'
- import_playbook: 'mattermost.yml'
#v-
What a shame! Believe me: I've been starring at that file for an hour
and I didn't realize import_playbook vs include ??? Then I realized that
I named the local file site.yml as syte.yml !!! Oh boy! (facepalm) So,
of course, whatever I wrote in there was ignored ... Well, I'm
retarded. Period.
Now it works like a charm. Thanks Maciej.
So, recapping for anyone else in the ML who might need an example
This is my working custom site.yml file:
---
- include: '{{ lookup("ENV", "HOME") +
"/.local/share/debops/debops/ansible/playbooks/site.yml" }}'
# Custom roles
- import_playbook: service/mattermost_mariadb.yml
- import_playbook: service/mattermost.yml
I prefer to include the original debops site.yml rather than copying the
content in my local site.yml to avoid differences during upgrades.
This is my skeleton:
└── ansible
├── inventory
├── playbooks
│ └── service
│ │ ├── mattermost_mariadb.yml
│ │ └── mattermost.yml
│ └── *site.yml*
├── resources
├── roles
│ ├── mattermost
│ ├── mattermost_mariadb
├── resources
├── roles
├── secret
├── tasks
└── templates
Notice import_playbook: *service/*mattermost.yml because my playbooks
are in ansible/playbooks/*service*/
You can also run the main DebOps playbook and "chain" your
custom playbooks
after it, for example:
debops site service/mattermost -l media
With this you don't need to mess with a custom 'site.yml' playbook. If you
want to be able to easily execute such chained playbook(s), you can write
a wrapper script.
Also precious, the fact is that I'm trying to avoid aliases or scripts
for simplicity. Until I can stick to "debops -l machine" I will.
Thanks guys for the support
Demetri