Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/rundeck: Added multiple functionality. #8314

Closed
wants to merge 5 commits into from
Closed

provider/rundeck: Added multiple functionality. #8314

wants to merge 5 commits into from

Conversation

BobVanB
Copy link
Contributor

@BobVanB BobVanB commented Aug 19, 2016

Added multiple functionality: schedule, descriptions, storagepath, scriptinterpreter, nodesSelectedByDefault, scriptinterpreter, nodefilterbydefault

Terraform plan is now clean, so only changes you made are seen.

UseCase: Changeing all our manual rundeck code to terraform, and missing some features in the process.

Still waiting for pull request on go-rundeck-api:
apparentlymart/go-rundeck-api#9

@BobVanB BobVanB changed the title provider/rundeck: Added multiple functionality. [WIP] provider/rundeck: Added multiple functionality. Aug 19, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 19, 2016

Working code i currently use in production.

resource "rundeck_job" "my_job_name" {
  name = "My Job Name"
  description = "${file("${path.module}/scripts/description")}"
  project_name = "${rundeck_project.rundeck_project.name}"
  preserve_options_order = true

  node_filter_query = "${file("${path.module}/scripts/filter_query")}"
  max_thread_count = 10
  nodes_selected_by_default = true

  allow_concurrent_executions = false
  continue_on_error = false

  dispatch {
    continue_on_error = true
  }

  option {
    name = "Option"
    description = "${file("${path.module}/scripts/option_description")}"
    default_value = "status"
    value_choices = ["pulled","open","merged"]
    required = true
    require_predefined_choice = true
  }

  command {
    inline_script = "${file("${path.module}/scripts/inline_script")}"
    description = "Command Description"
  }
}

if len(scheduleCron) > 0 {
scheduleCronArray := strings.Split(scheduleCron, " ")
if len(scheduleCronArray) != 7 {
return nil, fmt.Errorf("rundeck schedule_cron format is incorrect")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a ValidateFunc on the schedule_cron attribute for this? If we do the validation there then Terraform can detect it during the "plan" step in some cases (as long as it doesn't contain any interpolation expressions).

Copy link
Contributor Author

@BobVanB BobVanB Aug 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came back of my opinion, yes we can put MaxItems on the element, this will trigger the validation on the plan step.

@apparentlymart
Copy link
Contributor

Thanks for this, @BobVanB!

I merged the upstream client library change, and I left an initial comment here for now, but generally this looks good so far. Let me know when you're done here, and if you need any help with the acceptance tests or docs.

@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 20, 2016

@apparentlymart I will pick this up monday, thnx for the review.

@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 20, 2016

Do you mean something like this?
#8103

@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 22, 2016

Added documentation and an advanced acceptance test.

@BobVanB BobVanB changed the title [WIP] provider/rundeck: Added multiple functionality. provider/rundeck: Added multiple functionality. Aug 22, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 22, 2016

`

@BobVanB BobVanB closed this Aug 22, 2016
@BobVanB BobVanB reopened this Aug 22, 2016
@BobVanB BobVanB changed the title provider/rundeck: Added multiple functionality. [wip] provider/rundeck: Added multiple functionality. Aug 22, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 22, 2016

Schema has a MaxItems for List elements, will test en add this tomorrow.
This will validate the schema at plan setup.
Also added a deprication warning for exclude presedence.

@BobVanB BobVanB changed the title [wip] provider/rundeck: Added multiple functionality. provider/rundeck: Added multiple functionality. Aug 23, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 23, 2016

@apparentlymart I think this one can be reviewed and is ready for merging.

@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 23, 2016

I have another idea, but that has to be separate from this pull.
Write a wrapper around: https://github.com/asaskevich/govalidator
And put more validation in the schema.

@BobVanB BobVanB changed the title provider/rundeck: Added multiple functionality. [wip] provider/rundeck: Added multiple functionality. Aug 23, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 23, 2016

I see that i dont have the latest go-rundeck-api version, updating it and then i will remove the wip

@BobVanB BobVanB changed the title [wip] provider/rundeck: Added multiple functionality. provider/rundeck: Added multiple functionality. Aug 23, 2016
@apparentlymart apparentlymart self-assigned this Aug 23, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 25, 2016

Currently adding errorhandling functionality.
If you have comments on changing keys, or other tips and stuff.
Just shout it out, there welcome and needed.
Else i am going to do what i think is easy. :D

@apparentlymart
Copy link
Contributor

Hi @BobVanB!

I do intend to review this in more detail soon, but I just wanted to make a general note now: it seems like this patch is becoming quite a large set of changes, and the larger it gets the more complicated it will be to review. When possible it's preferable for each PR to add one specific feature so that it can be reviewed and merged in isolation from the rest.

I certainly don't want to discourage your momentum here, since there's some good stuff! Just want to make sure we can get this stuff merged efficiently, rather than going back and forth on many small details in a large patch.

@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 25, 2016

Yeah I firgure that, was feeling the same.

The last one errorhandling changes alot of code.
I thing I should have put this seperatly.

Also still dont like that booleans are always present, there should be a third type for it "nil"
Omitempty an false can messup the plan output with unnessacary changes. But this will need an api change.

@BobVanB BobVanB changed the title provider/rundeck: Added multiple functionality. [WIP] provider/rundeck: Added multiple functionality. Aug 26, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Aug 30, 2016

For now added yet another feature, ^^ have to wait for the api first :P
notification>email/webhook

provider/rundeck: Added multiple functionality:
* schedule
* descriptions
* storagepath
* scriptinterpreter
* nodesSelectedByDefault
* scriptinterpreter
* nodefilterbydefault
* notification
* etc...

With an accaptance test and documents.
@BobVanB BobVanB changed the title [WIP] provider/rundeck: Added multiple functionality. provider/rundeck: Added multiple functionality. Sep 1, 2016
@BobVanB
Copy link
Contributor Author

BobVanB commented Sep 7, 2016

@apparentlymart After i checken out the boolean bug. I will cut this one Into smaller party.

@BobVanB
Copy link
Contributor Author

BobVanB commented Sep 18, 2016

Splitting this merge into multiple merges. closing this one.

@BobVanB BobVanB closed this Sep 18, 2016
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants