Comment on I made a project that can install/configure/orchestrate 115+ applications on your homelab using Ansible!

<- View Parent
exu@feditown.com ⁨1⁩ ⁨week⁩ ago

You can use host_vars to set different variables per host. You’d still run the same playbook against both hosts, but each has different services activated.

  1. Make the folder host_vars in the repo root
  2. Make subfolders for every host with their hostname
  3. Enable services you want by writing the variables into a yaml file for your host (any file name as long as it ends with .yml
  4. Write an Ansible inventory for your hosts
  5. Run the playbook with your inventory

Slightly fancier would be using group_vars instead, you can add a host to multiple groups. Then deploying the same services on a new hosts would simply be adding it to the group

source
Sort:hotnewtop