Hi, I’m trying to pick correct roles layout and can’t find solution.
The task is to install spark.
There are three roles:
-install-spark-base (install spark-core package)
-install-spark-configuration (puts configuration shared by all spark services)
-install-spark-service-XXX (where XXX master, worker, history, jobserver) (installs concrete spark service)
- hosts: sparkworkers
user: “{{ sudoUser }}”
sudo: True
roles:
- install-spark-worker
install-spark-worker depends on install-spark-configuration
install-spark-configuration depends on install-spark-base
So when install-spark-worker role is played, ansible runs
-install-spark-base
then
-install-spark-configuration
then
-install-spark-worker
Looks nice, basement, configuration and concrete service are separated.
BUT
I want install-spark-configuration to restart services each time configuration changes. When I do first run install-spark-configuration tries to restart absent service, since concrete service is installed AFTER configuration.
What is the right way to resolve such collision?
Hi, I'm trying to pick correct roles layout and can't find solution.
The task is to install spark.
There are three roles:
-install-spark-base (install spark-core package)
-install-spark-configuration (puts configuration shared by all spark
services)
-install-spark-service-XXX (where XXX master, worker, history, jobserver)
(installs concrete spark service)
- hosts: sparkworkers
user: "{{ sudoUser }}"
sudo: True
roles:
- install-spark-worker
install-spark-worker depends on install-spark-configuration
install-spark-configuration depends on install-spark-base
So when install-spark-worker role is played, ansible runs
-install-spark-base
then
-install-spark-configuration
then
-install-spark-worker
I'd just have:
spark (install packages, shared configuration, etc)
spark-master (specific packages, files, etc)
spark-worker
spark-jobserver
....
Looks nice, basement, configuration and concrete service are separated.
BUT
I want install-spark-configuration to restart services each time
configuration changes. When I do first run install-spark-configuration
tries to restart absent service, since concrete service is installed
AFTER
configuration.
What is the right way to resolve such collision?
I don't know how Spark works but there must be a way to trigger a
complete restart of all the services involved.
The basic "spark" role could have a task for that. And each
"spark-$service" role would take care of restarting only the service
impacted.
Giovanni