Running terraform with rundeck

469 views
Skip to first unread message

Ryan Tin

unread,
Jul 28, 2022, 9:02:45 AM7/28/22
to rundeck-discuss
Hi there, I'm looking at a possible scenario at using rundeck with terraform. 

The biggest problem I have is trying to halt the rundeck workflow when terraform plan is finished so that the devs can decide weather to go ahead to with terraform apply. Is something like that possible with rundeck? 

rac...@rundeck.com

unread,
Jul 28, 2022, 9:14:28 AM7/28/22
to rundeck-discuss
Hi Ryan,

That is a common question (a workflow waiting for user interaction) unfortunately Rundeck doesn't work in that way, but you can automate the workflow behavior depending on some step output, e.g.: capture some terraform apply string, save it on data variable, and then, in a script step execute something depending of that variable. That approach is extremely easy using the Ruleset Strategy on PagerDuty Process Automation On Prem (formerly "Rundeck Enterprise"), please take a look a this.

Additionally, I developed a community plugin for Terraform, feel free to test, use and contribute :-)

Hope it help!

Chris Grigor

unread,
Jul 28, 2022, 11:15:21 AM7/28/22
to rundeck...@googlegroups.com
In the job options you can have a droplist to do a plan apply or destroy. Then build logic into either a Makefile, bash script in a repo to decide what switch to pass to terraform to run.
I have found an easier way of doing this is dropping into a docker container that contains terraform (and other build tools if needed), taking the inputs from the job, executing terraform and taking the output from the container into a variable. You can then decide to alert the devs or ops teams whether to deploy the build by rerunning it with the apply option.

This way you can keep the build tools such as terraform outside of Rundeck and update as/when required, without changing the job on Rundeck and messing with updating binaries locally on Rundeck, this way you could have various containers all with different terraform versions if required.


On 27 Jul 2022, at 21:46, Ryan Tin <ryan...@workato.com> wrote:

Hi there, I'm looking at a possible scenario at using rundeck with terraform. 

The biggest problem I have is trying to halt the rundeck workflow when terraform plan is finished so that the devs can decide weather to go ahead to with terraform apply. Is something like that possible with rundeck? 

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/597abd15-f0d3-4cfe-84dd-64685bf499bfn%40googlegroups.com.

Ryan Tin

unread,
Jul 28, 2022, 2:33:18 PM7/28/22
to rundeck-discuss

This is pretty great. I'll look into both. Right now I'm just running it to demo the capabilities of rundeck, so everything is on the local machine. Eventually, I plan to either have a docker container or a separate EC2 instance specifically for tf binaries and other build tools so I don't have to mess around with it in rundeck as you said! 

Thanks all!
Reply all
Reply to author
Forward
0 new messages