Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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"
Copy link
Member Author

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:

"/AutomationManagement/AutomationManager/Provisioning/StateMachines/Provision/default"

Copy link
Member Author

Choose a reason for hiding this comment

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

cc @agrare @Fryguy thoughts?

Copy link
Member Author

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.

Copy link
Member Author

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.

/Infrastructure/VM/Lifecycle/Provisioning
  /Infrastructure/VM/Provisioning/Profile/${/#user.normalized_ldap_group}#get_state_machine
    /Infrastructure/VM/Provisioning/Profile/.missing
      state_machine: VMProvision_${/#miq_provision.target_type}
  /Infrastructure/VM/Provisioning/StateMachines/${/#state_machine}/${/#miq_provision.provision_type}  =>
    /Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/Provision VM from template
      CustomizeRequest...
      AcquireIPAddress...
      Provision: /Infrastructure/VM/Provisioning/StateMachines/Methods/Provision
        $evm.root["miq_provision"].execute



/PhysicalInfrastructure/PhysicalServer/Lifecycle/Provisioning
  /PhysicalInfrastructure/PhysicalServer/Provisioning/Profile/${/#user.normalized_ldap_group}#get_state_machine
    PhysicalInfrastructure/PhysicalServer/Provisioning/Profile/.missing
    state_machine: Provision
  /PhysicalInfrastructure/PhysicalServer/Provisioning/StateMachines/${/#state_machine}/default
  /PhysicalInfrastructure/PhysicalServer/Provisioning/StateMachines/Provision/default
    Provision: /PhysicalInfrastructure/PhysicalServer/Provisioning/StateMachines/Methods/Provision#${/#physical_server_provision_task.source.emstype}
    /PhysicalInfrastructure/PhysicalServer/Provisioning/StateMachines/Methods/Provision#lenovo_ph_infra
      $evm.root["miq_provision"].execute

I added it for automate manager:

/AutomationManagement/AutomationManager/Lifecycle/provisioning.yaml
  /AutomationManagement/AutomationManager/Provisioning/Profile/${/#user.normalized_ldap_group}#get_state_machine
    /AutomationManagement/AutomationManager/Provisioning/Profile/__class__.yaml
      state_machine: Provision
  /AutomationManagement/AutomationManager/Provisioning/StateMachines/${/#state_machine}/default =>
    /AutomationManagement/AutomationManager/Provisioning/StateMachines/Provision/default
        CustomizeRequest...
      AcquireIPAddress...
      Provision: /AutomationManagement/AutomationManager/Provisioning/StateMachines/Methods/Provision
        $evm.root["miq_provision"].execute

It could be as simple as:

/AutomationManagement/AutomationManager/Lifecycle/provisioning.yaml
    /AutomationManagement/AutomationManager/Provisioning/StateMachines/Provision/default
        CustomizeRequest...
      AcquireIPAddress...
      Provision: /AutomationManagement/AutomationManager/Provisioning/StateMachines/Methods/Provision
        $evm.root["miq_provision"].execute

Copy link
Member

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.

Copy link
Member Author

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.

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
Copy link
Member Author

Choose a reason for hiding this comment

The 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:
Copy link
Member Author

Choose a reason for hiding this comment

The 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
Loading