diff --git a/containers/argo_utils/README.md b/containers/argo_utils/README.md index 116552804..723b32494 100644 --- a/containers/argo_utils/README.md +++ b/containers/argo_utils/README.md @@ -24,7 +24,7 @@ however they will likely fail until a proper get-obm-creds Workflow is created. ## Example ```bash -argo -n argo-events submit --from workflowtemplate/get-device-nautobot --parameter hostname=host.domain.local +argo -n argo-events submit --from workflowtemplate/get-device-nautobot --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca Name: get-device-nautobot-g5wlz Namespace: argo-events @@ -33,7 +33,7 @@ Status: Pending Created: Tue Apr 23 13:50:57 -0400 (now) Progress: Parameters: - hostname: some-host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca ``` ```bash @@ -52,7 +52,7 @@ Finished: Tue Apr 23 13:51:27 -0400 (8 seconds ago) Duration: 30 seconds Progress: 1/1 Parameters: - hostname: some-host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca STEP TEMPLATE PODNAME DURATION MESSAGE ✔ get-device-nautobot-g5wlz main diff --git a/containers/argo_utils/code/argo_python/__init__.py b/containers/argo_utils/code/argo_python/__init__.py index a460652e2..ec613af6c 100644 --- a/containers/argo_utils/code/argo_python/__init__.py +++ b/containers/argo_utils/code/argo_python/__init__.py @@ -45,7 +45,7 @@ def create_secret(self, name: str, data: Dict, persist=False) -> str: try: # if KUBERNETES_POD_UID is not explicitly defined in the container env, pod get permissions will need # be set for the service account running this workflow - owner_name = os.environ["HOSTNAME"] + owner_name = os.environ["DEVICE_ID"] owner_id = os.getenv("KUBERNETES_POD_UID") if not owner_id: owner_metadata = self.get_pod(owner_name) diff --git a/containers/obm-utils/README.md b/containers/obm-utils/README.md index 9bcb78d30..6da216e0c 100644 --- a/containers/obm-utils/README.md +++ b/containers/obm-utils/README.md @@ -8,7 +8,7 @@ The WorkflowTemplates provided in this directory were created to provide common ## Example ```bash -argo -n argo-events submit --from workflowtemplate/obm-sync-creds --parameter hostname=host.domain.local +argo -n argo-events submit --from workflowtemplate/obm-sync-creds --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca Name: obm-sync-creds-wrn2c Namespace: argo-events @@ -17,7 +17,7 @@ Status: Pending Created: Tue Apr 23 14:24:07 -0400 (now) Progress: Parameters: - hostname: host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca ``` ```bash @@ -34,7 +34,7 @@ Duration: 58 seconds Progress: 2/3 ResourcesDuration: 0s*(1 cpu),5s*(100Mi memory) Parameters: - hostname: host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca STEP TEMPLATE PODNAME DURATION MESSAGE ● obm-sync-creds-wrn2c main diff --git a/docs/component-argo-workflows.md b/docs/component-argo-workflows.md index 40d6d8484..a4d3bfe88 100644 --- a/docs/component-argo-workflows.md +++ b/docs/component-argo-workflows.md @@ -8,12 +8,12 @@ set of WorkflowTemplates below. | WorkflowTemplate | Description | Input | Output | | |---------------------- |-----------------------------------------------------------|-------------------------|------------|---| -| get-device-nautobot | Return Device Information from Nautobot | hostname | device | | -| get-obm-creds | Get the credentials for the target Device | hostname | secret | * | -| get-obm-ip | Get OBM IP address for target Device | hostname | ip | | +| get-device-nautobot | Return Device Information from Nautobot | device_id | device | | +| get-obm-creds | Get the credentials for the target Device | device_id | secret | * | +| get-obm-ip | Get OBM IP address for target Device | device_id | ip | | | nautobot-api | HTTP Template Workflow to query the Nautobot API | method,nautobot_url,uri | result | | -| obm-firmware-update | Update OBM firmware on target Device | hostname | | | -| obm-sync-creds | Sync's a devices OBM password with what we have on record | hostname | | | +| obm-firmware-update | Update OBM firmware on target Device | device_id | | | +| obm-sync-creds | Sync's a devices OBM password with what we have on record | device_id | | | \* WorkflowTemplate which requires a manual / custom implementation. @@ -62,7 +62,7 @@ Argo Workflows has a CLI and the installation instrucutions can be found [here]( Usage: ```bash -argo -n argo-events submit --from workflowtemplate/get-device-nautobot --parameter hostname=host.domain.local +argo -n argo-events submit --from workflowtemplate/get-device-nautobot --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca Name: get-device-nautobot-g5wlz Namespace: argo-events @@ -71,7 +71,7 @@ Status: Pending Created: Tue Apr 23 13:50:57 -0400 (now) Progress: Parameters: - hostname: host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca ``` ```bash @@ -90,7 +90,7 @@ Finished: Tue Apr 23 13:51:27 -0400 (8 seconds ago) Duration: 30 seconds Progress: 1/1 Parameters: - hostname: host.domain.local + device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca STEP TEMPLATE PODNAME DURATION MESSAGE ✔ get-device-nautobot-g5wlz main diff --git a/workflows/argo-events/sensors/nb-oob-interface-update.yaml b/workflows/argo-events/sensors/nb-oob-interface-update.yaml index 053bee464..05f848017 100644 --- a/workflows/argo-events/sensors/nb-oob-interface-update.yaml +++ b/workflows/argo-events/sensors/nb-oob-interface-update.yaml @@ -68,8 +68,6 @@ spec: value: Some nautobot interface has changed - name: device_id value: device id that event is for - - name: hostname - value: to support other workflows that references hostname entrypoint: start serviceAccountName: workflow templates: diff --git a/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml b/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml index 853fcd653..100567804 100644 --- a/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml +++ b/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml @@ -5,7 +5,7 @@ metadata: name: get-device-nautobot namespace: argo-events annotations: - workflows.argoproj.io/title: Output JSON blob of Nautobot data for given device hostname + workflows.argoproj.io/title: Output JSON blob of Nautobot data for given device_id workflows.argoproj.io/description: | Defined in `workflows/argo-events/workflowtemplates/get-device-nautobot.yaml`. Return Device Information from Nautobot spec: @@ -13,13 +13,13 @@ spec: entrypoint: main arguments: parameters: - - name: hostname + - name: device_id templates: - name: main inputs: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" outputs: parameters: - name: device @@ -34,4 +34,4 @@ spec: arguments: parameters: - name: uri - value: "/dcim/devices/?name={{inputs.parameters.hostname}}" + value: "/dcim/devices/{{inputs.parameters.device_id}}/" diff --git a/workflows/argo-events/workflowtemplates/get-obm-creds.yaml b/workflows/argo-events/workflowtemplates/get-obm-creds.yaml index 18022f593..444bd8a9e 100644 --- a/workflows/argo-events/workflowtemplates/get-obm-creds.yaml +++ b/workflows/argo-events/workflowtemplates/get-obm-creds.yaml @@ -4,7 +4,7 @@ metadata: name: get-obm-creds namespace: argo-events annotations: - workflows.argoproj.io/title: Create a k8s secret containing OBM creds for given device hostname + workflows.argoproj.io/title: Create a k8s secret containing OBM creds for given device_id workflows.argoproj.io/description: | Defined in `workflows/argo-events/workflowtemplates/get-obm-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's OBM credentials. @@ -17,12 +17,12 @@ spec: entrypoint: main arguments: parameters: - - name: hostname + - name: device_id templates: - name: main inputs: parameters: - - name: hostname + - name: device_id outputs: parameters: - name: secret diff --git a/workflows/argo-events/workflowtemplates/get-obm-ip.yaml b/workflows/argo-events/workflowtemplates/get-obm-ip.yaml index 75d498fad..2f4137167 100644 --- a/workflows/argo-events/workflowtemplates/get-obm-ip.yaml +++ b/workflows/argo-events/workflowtemplates/get-obm-ip.yaml @@ -4,7 +4,7 @@ metadata: name: get-obm-ip namespace: argo-events annotations: - workflows.argoproj.io/title: Output OBM IP address for the Device with the given hostname + workflows.argoproj.io/title: Output OBM IP address for the Device with the given device_id workflows.argoproj.io/description: | Defined in `workflows/argo-events/workflowtemplates/get-obm-ip.yaml`. Get OBM IP address for target Device @@ -13,12 +13,12 @@ spec: entrypoint: main arguments: parameters: - - name: hostname + - name: device_id templates: - name: main inputs: parameters: - - name: hostname + - name: device_id outputs: parameters: - name: ip @@ -32,4 +32,4 @@ spec: arguments: parameters: - name: uri - value: "/ipam/ip-addresses/?device={{inputs.parameters.hostname}}&interfaces=iDRAC&interfaces=iLO" + value: "/ipam/ip-addresses/?device_id={{inputs.parameters.device_id}}&interfaces=iDRAC&interfaces=iLO" diff --git a/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml index 643488cda..89ccb17f9 100644 --- a/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml +++ b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml @@ -11,7 +11,7 @@ metadata: spec: arguments: parameters: - - name: hostname + - name: device_id serviceAccountName: workflow entrypoint: main templates: @@ -24,16 +24,16 @@ spec: template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: get-obm-creds templateRef: name: get-obm-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: idrac-enable-network-boot dependencies: [get-obm-ip, get-obm-creds] template: idrac-enable-network-boot diff --git a/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml b/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml index ea19a3ab5..a18fd7d21 100644 --- a/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml +++ b/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml @@ -12,7 +12,7 @@ spec: entrypoint: main arguments: parameters: - - name: hostname + - name: device_id - name: firmware-url templates: - name: main @@ -24,16 +24,16 @@ spec: template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: get-obm-creds templateRef: name: get-obm-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: update-firmware dependencies: [get-obm-ip, get-obm-creds] template: obm-firmware-update diff --git a/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml b/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml index e854e7743..406f65c96 100644 --- a/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml +++ b/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml @@ -11,7 +11,7 @@ metadata: spec: arguments: parameters: - - name: hostname + - name: device_id serviceAccountName: workflow entrypoint: main templates: @@ -24,16 +24,16 @@ spec: template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: get-obm-creds templateRef: name: get-obm-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: obm-sync-creds dependencies: [get-obm-ip, get-obm-creds] template: obm-sync-creds diff --git a/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml index c87d27d63..6196291b5 100644 --- a/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml +++ b/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml @@ -12,8 +12,8 @@ spec: parameters: - name: interface_update_event value: Some nautobot interface has changed - - name: hostname - value: hostname of the device that event is for + - name: device_id + value: device_id that event is for templates: - name: main steps: diff --git a/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml b/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml index a508d493f..88a48d25a 100644 --- a/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml +++ b/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml @@ -21,8 +21,8 @@ spec: template: main arguments: parameters: - - name: hostname - value: '{{workflow.parameters.hostname}}' + - name: device_id + value: '{{workflow.parameters.device_id}}' - - name: sync-obm-creds template: sync-obm-creds arguments: diff --git a/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml index c0ccbe808..a49dad06d 100644 --- a/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml +++ b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml @@ -12,8 +12,6 @@ spec: parameters: - name: device_id value: "{}" - - name: hostname - value: "{}" templates: - name: main steps: @@ -23,16 +21,16 @@ spec: template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - - name: get-obm-creds-secret templateRef: name: get-obm-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - - name: sync-interfaces-to-nautobot templateRef: name: sync-interfaces-to-nautobot