Elektrine lite

← Feed

@niclas@infosec.exchange

Post #3060020

2026-01-28 21:07 UTC

@appsinet@phpc.social Interesting. Are your playbooks also located in a subfolder and not in the `inventory`folder? Because for me, those vars are not loaded when executing the playbook with `ansible-playbook -i inventory/inventory.yml playbooks/infra.yml`

Replies (2)

  • @appsinet@phpc.social 2026-01-29 06:56

    @niclas@infosec.exchange we have a few playbooks on the root folder (4-5, not more). But these playbooks are basically a set of role executions with different tags. So, if we want to execute the full playbook, we run the command with the production or staging inventory, and that's all. If we want to run only a few things, we use the tags parameter to only execute those. All the logic is always inside a role, playbooks only orchestrate

    Open ##3060021

  • @appsinet@phpc.social 2026-01-29 06:59

    @niclas@infosec.exchange also, on the main vars folder we only have reusable variables that are needed on several roles. Like an email address or user account used in several services, for example. Specific variables for each role leave on the vars folder of that role. I think we got this folder structure after reading some best practices blog posts. Might be outdated, because we did this 2-3 years ago. But still works for us

    Open ##3060022