-
Notifications
You must be signed in to change notification settings - Fork 122
Add provisioning via automation manager such as terraform enterprise #772
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| display_name: | ||
| name: Provisioning | ||
| inherits: | ||
| description: | ||
| fields: | ||
| - Relationship5: | ||
| value: "/AutomationManagement/AutomationManager/Provisioning/Profile/${/#user.normalized_ldap_group}#get_state_machine" | ||
| - Relationship6: | ||
| value: "/AutomationManagement/AutomationManager/Provisioning/StateMachines/${/#state_machine}/default" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| object_type: class | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| description: Profile | ||
| display_name: | ||
| name: Profile | ||
| type: | ||
| inherits: | ||
| visibility: | ||
| owner: | ||
| schema: | ||
| - field: | ||
| aetype: attribute | ||
| name: state_machine | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole file could go away if we don't care about per ldap group statemachines... |
||
| display_name: | ||
| datatype: string | ||
| priority: 9 | ||
| owner: | ||
| default_value: Provision | ||
| substitute: true | ||
| message: get_state_machine | ||
| visibility: | ||
| collect: "/state_machine = state_machine" | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything in Provisioning/Profile.class would all go away if we don't care about per ldap group statemachines... |
||
| attributes: | ||
| display_name: | ||
| name: ".missing" | ||
| inherits: | ||
| description: | ||
| fields: [] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| display_name: | ||
| name: EvmGroup-super_administrator | ||
| inherits: | ||
| description: | ||
| fields: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| --- | ||
| object_type: class | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| description: | ||
| display_name: | ||
| name: Methods | ||
| type: | ||
| inherits: | ||
| visibility: | ||
| owner: | ||
| schema: | ||
| - field: | ||
| aetype: relationship | ||
| name: rel1 | ||
| display_name: '' | ||
| datatype: string | ||
| priority: 1 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: create | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: method | ||
| name: meth1 | ||
| display_name: '' | ||
| datatype: string | ||
| priority: 2 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: create | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: relationship | ||
| name: common_rel1 | ||
| display_name: '' | ||
| datatype: string | ||
| priority: 15 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: method | ||
| name: common_meth1 | ||
| display_name: '' | ||
| datatype: string | ||
| priority: 16 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: relationship | ||
| name: common_rel2 | ||
| display_name: | ||
| datatype: string | ||
| priority: 17 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: method | ||
| name: common_meth2 | ||
| display_name: | ||
| datatype: string | ||
| priority: 18 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: relationship | ||
| name: common_rel3 | ||
| display_name: | ||
| datatype: string | ||
| priority: 19 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: | ||
| - field: | ||
| aetype: relationship | ||
| name: common_meth3 | ||
| display_name: | ||
| datatype: string | ||
| priority: 20 | ||
| owner: | ||
| default_value: | ||
| substitute: true | ||
| message: "*" | ||
| visibility: | ||
| collect: | ||
| scope: | ||
| description: | ||
| condition: | ||
| on_entry: | ||
| on_exit: | ||
| on_error: | ||
| max_retries: | ||
| max_time: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # | ||
| # Description: Trigger internal state machine that performs the actual provisioning. | ||
| # | ||
| module ManageIQ | ||
| module Automate | ||
| module AutomationManagement | ||
| module AutomationManager | ||
| module Provisioning | ||
| module StateMachines | ||
| module Methods | ||
| class Provision | ||
| def initialize(handle = $evm) | ||
| @handle = handle | ||
| end | ||
|
|
||
| def main | ||
| @handle.root['miq_provision_task'].execute | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| ManageIQ::Automate::AutomationManagement::AutomationManager::Provisioning::StateMachines::Methods::Provision.new.main |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| object_type: method | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| name: provision | ||
| display_name: | ||
| description: | ||
| scope: instance | ||
| language: ruby | ||
| location: inline | ||
| inputs: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| display_name: | ||
| name: PostProvision | ||
| inherits: | ||
| description: | ||
| fields: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| display_name: | ||
| name: PreProvision | ||
| inherits: | ||
| description: | ||
| fields: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| object_type: instance | ||
| version: 1.0 | ||
| object: | ||
| attributes: | ||
| display_name: | ||
| name: Provision | ||
| inherits: | ||
| description: | ||
| fields: | ||
| - common_meth2: | ||
| value: provision |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, we can remove a lot of indirection here if we don't care about getting a per ldap group state machine... we could go directly to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @agrare @Fryguy thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add it later if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, this came from vm and physical server provisioning. I mapped out the flow and both went through Provisioning/Profile to get a state machine that would be used to route to the correct Statemachines/Provision.
I added it for automate manager:
It could be as simple as:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed the per-ldap thing allows the user to split off different state machines by ldap group. I don't think required for the new section in automate, but we may want it there for consistency. Personally, I'd leave it out for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it here for now for consistency.