rundeck: 1 job, multiple nodes involded?

331 views Asked by At

I have a question about Rundeck features. Is it possible to include conditions within job execution? As it is quite difficult to explain, I provide an example: You have 2 redundant firewalls in your network. You implement a job 'job1' and it's aim is to update your firewall's configuration. Master is down, therefore you do not want to update slave. Indeed if you do so, slave will have to restart and there will not have any firewall running for a short time. So, what I want to do is to test, before running the update, that none of my firewalls are out of service. If the master is down, then do not update slave. So, is it possible to involve multiple nodes within one job?

Thanks for helping!

2

There are 2 answers

0
Roger McCarrick On

Absolutely. It can be a workflow of multiple jobs or just one job. No need for multiple nodes. For example, I use powershell for my scripts, and they live on a windows node. Rundeck can call the script on the node, the script can ping or use some other method to check if the firewalls are up, for example, an API call to the firewalls. Build logic into the script, like this

if slave is down or if master is down, do not update
send email that says firewall down, no update was done
else if both firewalls are up, start update on slave.
reboot slave
keep checking slave until it comes up.
if not up after 10 mins, exit and send email
else if up, update master firewall
check master comes back after reboot.
If fail, exit send fail email
If success, exit, send success email

this should do it

0
Shiv On

You create a job which pings both the firewalls. If both are up then this job will succeed. Now create another job which includes this job before update job in workflow. Make this job proceed only if first workflow succeeds. That should solve your problem.