Executing a role dependency on all hosts in a list before executing main role

12 views
Skip to first unread message

Brent Kingston

unread,
May 29, 2020, 4:10:15 PM5/29/20
to Ansible Project
I'm relatively new to Ansible and I have a question about role dependencies.

Is it possible to have a dependency execute on all hosts in a hostList before proceeding to perform the tasks of the given role

Just a sudo code example
___
name: role1

name: role2
  dependency: role1
___

The reason this question has come up is because of a software suite I'm installing and configuring.

The core software has the following infrastructure

cluster:
   host1: master
   host2: slave
   host3: slave

Each of the above nodes has the exact same core install which would be handled in role1

Once the software is installed, the cluster's configuration is all handled on host1 (the master node) via role2. When it comes to configuration the only requirement is that the software is installed on each of the nodes in the cluster.

The thought process behind splitting this into 2 roles with a dependency is because role1 is a general install and can be applied to every application I manage. role2 is a application specific configuration where the setup is dependent on the application.
Reply all
Reply to author
Forward
0 new messages