rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
http://rundeck.org
Apache License 2.0
5.55k stars 920 forks source link

Allow Flow Control to halt a single Node step with success state, without halting entire workflow #2632

Open dpomnean opened 7 years ago

dpomnean commented 7 years ago

Issue type: Bug report/Enhancement Request

My Rundeck detail

Expected Behavior Is there a way to end a job thats running and still be considered successful?

Currently I have a job that checks if a server is scheduled to be patched from an external calendar. If that server doesn't fall under that patch date, then it will not proceed with the rest of the steps in the job.

My problem is, rundeck tells me the job is considered to be failed, but would like to just halt or stop the job without failing the job, because a failed job would send a "Job Failed" email notification. Any ideas?

Thanks.

ahonor commented 7 years ago

@dpomnean Take a look at the Workflow step, Flow Control. It will let you halt the job with your own status.

dpomnean commented 7 years ago

@ahonor Is it possible to do this in a node step? So I would proceed to the next step on some nodes if they meet the criteria, but the other nodes would halt instead of failing.

gschueler commented 7 years ago

@dpomnean currently no, it halts at the given step We would have to add another flow control option such as "node halt" to halt only on a specific node in a node step

dpomnean commented 7 years ago

@gschueler is there any enhancement request or the possibility of adding this workflow option in a future release?

gschueler commented 7 years ago

@dpomnean I will mark this issue as an enhancement request.

you might try using the Flow Control step and rearranging your job definitions to perhaps solve the issue with the current system.

  1. job 1 uses node filters to operate on multiple nodes
  2. job 2 defines the logic for operating on one node, or halting with a "success" if the node is not scheduled to be patched
  3. job 1 uses a "node step" job reference to job2, and passes the ${node.name} as the filter to job 2.

In this way, job1 will run job2 for each node, but the job2 may halt with success on any node where it is not necessary to proceed.

dpomnean commented 7 years ago

@gschueler thats actually how we have it set up. but our job 2 has multiple steps/other job calls.

gschueler commented 7 years ago

@dpomnean maybe i didn't fully understand the situation. is that not sufficient to have it work the way you wanted?

dpomnean commented 7 years ago

@gschueler "job 2 defines the logic for operating on one node, or halting with a "success" if the node is not scheduled to be patched". Ok, I think I see what you are saying. job 1 will be a node step that calls job 2, that contains workflow steps.

EDIT:

We really only want the first step under job 2 to have that workflow halt on success.

EDIT 2:

Tried adding Flow Control on 1st step in job 2, with Halt checked and "Keep going on success" checked. Rundeck seemed to ignore this and fail anyways.

gschueler commented 7 years ago

@dpomnean can you post your job configurations?

dpomnean commented 7 years ago

I attached a zip of the two files. In this instance, PATCH_job1.xml would be job1 and PATCH_TEST.xml would be job 2

job1_2.zip