diff --git a/.github/workflows/code-test.yaml b/.github/workflows/code-test.yaml index a774d5ccf..106daf59c 100644 --- a/.github/workflows/code-test.yaml +++ b/.github/workflows/code-test.yaml @@ -7,7 +7,7 @@ on: paths: - "python/**" - ".github/workflows/code-test.yaml" - pull_request_target: + pull_request: paths: - "python/**" - ".github/workflows/code-test.yaml" @@ -45,7 +45,7 @@ jobs: cache: "poetry" - run: poetry install --sync --with test - run: poetry build - - run: "poetry run pytest --cov-report xml:coverage.xml" + - run: "poetry run pytest --cov --cov-report xml:coverage.xml" - uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac # v3.2 with: coverageFile: python/${{ matrix.project }}/coverage.xml diff --git a/components/glance/aio-values.yaml b/components/glance/aio-values.yaml index dd4c946dd..f8d40263c 100644 --- a/components/glance/aio-values.yaml +++ b/components/glance/aio-values.yaml @@ -59,6 +59,7 @@ manifests: pod_rally_test: false secret_db: false secret_keystone: true + service_ingress_api: false # We don't want to enable OpenStack Helm's # helm.sh/hooks because they set them as diff --git a/components/horizon/aio-values.yaml b/components/horizon/aio-values.yaml index 39a201683..ac9169927 100644 --- a/components/horizon/aio-values.yaml +++ b/components/horizon/aio-values.yaml @@ -32,6 +32,8 @@ dependencies: manifests: job_db_init: false + secret_db: false + service_ingress: false # We don't want to enable OpenStack Helm's # helm.sh/hooks because they set them as diff --git a/components/ironic/aio-values.yaml b/components/ironic/aio-values.yaml index 053d9a237..1b329529c 100644 --- a/components/ironic/aio-values.yaml +++ b/components/ironic/aio-values.yaml @@ -129,6 +129,7 @@ manifests: secret_db: false secret_rabbitmq: false secret_registry: false + service_ingress_api: false pod: mounts: diff --git a/components/keystone/aio-values.yaml b/components/keystone/aio-values.yaml index 86eecbe5b..3a57e744f 100644 --- a/components/keystone/aio-values.yaml +++ b/components/keystone/aio-values.yaml @@ -10,12 +10,6 @@ bootstrap: --user="${OS_USERNAME}" \ --domain="${OS_DEFAULT_DOMAIN}" \ "admin" - # TODO: only create this actually requested - # create 'demo' user with sufficient permissions - openstack user create --or-show --password demo --email 'demo@example.com' demo - openstack user set --email 'demo@example.com' demo - # add 'demo' user to 'ucadmin' group - openstack group add user ucadmin demo # create 'argoworkflow' user # credentials for ironic-nautobot-sync and other argo workflows openstack project create undercloud --or-show @@ -90,6 +84,13 @@ bootstrap: openstack role add --group ucadmin --domain default admin openstack role add --group ucadmin --project undercloud admin + # TODO: only create this actually requested + # create 'demo' user with sufficient permissions + openstack user create --or-show --password demo --email 'demo@example.com' demo + openstack user set --email 'demo@example.com' demo + # add 'demo' user to 'ucadmin' group + openstack group add user ucadmin demo + network: # configure OpenStack Helm to use Undercloud's ingress # instead of expecting the ingress controller provided @@ -304,6 +305,11 @@ endpoints: name: rabbitmq-server hosts: default: rabbitmq-nodes + identity: + # upstream uses 'keystone' here which causes traffic to go via an internal ingress + # which is wired back to keystone-api via the service_ingress_api manifest. just + # go direct to the service + default: keystone-api manifests: job_credential_cleanup: false @@ -312,6 +318,7 @@ manifests: pod_rally_test: false secret_db: false secret_keystone: true + service_ingress_api: false # we don't want to enable OpenStack Helm's # helm.sh/hooks because they set them as diff --git a/components/neutron/aio-values.yaml b/components/neutron/aio-values.yaml index e4463bcf1..f94b31a7b 100644 --- a/components/neutron/aio-values.yaml +++ b/components/neutron/aio-values.yaml @@ -98,6 +98,7 @@ manifests: daemonset_bgp_dragent: false daemonset_netns_cleanup_cron: false deployment_ironic_agent: true + service_ingress_server: false # We don't want to enable OpenStack Helm's # helm.sh/hooks because they set them as diff --git a/components/nova/aio-values.yaml b/components/nova/aio-values.yaml index 29ed66124..871bc6a6d 100644 --- a/components/nova/aio-values.yaml +++ b/components/nova/aio-values.yaml @@ -116,6 +116,8 @@ manifests: secret_db_cell0: true secret_db: true secret_keystone: true + service_ingress_metadata: false + service_ingress_osapi: false daemonset_compute: false statefulset_compute_ironic: true diff --git a/components/placement/aio-values.yaml b/components/placement/aio-values.yaml index 6bf2e946a..cd8868254 100644 --- a/components/placement/aio-values.yaml +++ b/components/placement/aio-values.yaml @@ -25,6 +25,8 @@ pod: manifests: job_db_init: false + secret_db: false + service_ingress: false # We don't want to enable OpenStack Helm's # helm.sh/hooks because they set them as diff --git a/containers/argo_utils/README.md b/containers/argo_utils/README.md index 40a75afac..61cb41a51 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-bmc-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/bmc-utils/README.md b/containers/bmc-utils/README.md index 9d174c214..1e0a2d6a5 100644 --- a/containers/bmc-utils/README.md +++ b/containers/bmc-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/bmc-sync-creds --parameter hostname=host.domain.local +argo -n argo-events submit --from workflowtemplate/bmc-sync-creds --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca # TODO: Once we merge changes we will need to update these example with bmc-sync-creds events Name: obm-sync-creds-wrn2c @@ -18,7 +18,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 @@ -36,7 +36,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 # TODO: Once we merge changes we will need to update these example with bmc-sync-creds events STEP TEMPLATE PODNAME DURATION MESSAGE diff --git a/containers/bmc-utils/requirements.txt b/containers/bmc-utils/requirements.txt index 7f8979416..2ccd10eb7 100644 --- a/containers/bmc-utils/requirements.txt +++ b/containers/bmc-utils/requirements.txt @@ -1,4 +1,4 @@ requests==2.32.3 -pynautobot==2.1.1 +pynautobot==2.2.1 sushy==5.2.0 IdracRedfishSupport==0.0.8 diff --git a/docs/component-argo-workflows.md b/docs/component-argo-workflows.md index 3e5b165af..664f9e82b 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-bmc-creds | Get BMC credentials for the target Device | hostname | secret | * | -| get-bmc-ip | Get BMC IP address for target Device | hostname | ip | | -| nautobot-api | HTTP Template Workflow to query the Nautobot API | method,nautobot_url,uri | result | | -| bmc-firmware-update | Update BMC firmware on target Device | hostname | | | -| bmc-sync-creds | Sync's a devices BMC password with what we have on record | hostname | | | +| get-device-nautobot | Return Device Information from Nautobot | device_id | device | | +| get-bmc-creds | Get BMC credentials for the target Device | device_id | secret | * | +| get-bmc-ip | Get BMC IP address for target Device | device_id | ip | | +| nautobot-api | HTTP Template Workflow to query the Nautobot API | method,nautobot_url,uri | result | | +| bmc-firmware-update | Update BMC firmware on target Device | device_id | | | +| bmc-sync-creds | Sync's a devices BMC 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/operators/external-secrets/kustomization.yaml b/operators/external-secrets/kustomization.yaml index 3e8c1c7fa..700e04bed 100644 --- a/operators/external-secrets/kustomization.yaml +++ b/operators/external-secrets/kustomization.yaml @@ -7,5 +7,5 @@ helmCharts: includeCRDs: true namespace: external-secrets releaseName: external-secrets - version: 0.9.20 + version: 0.10.3 repo: https://charts.external-secrets.io diff --git a/operators/rabbitmq-system/cluster-operator/kustomization.yaml b/operators/rabbitmq-system/cluster-operator/kustomization.yaml new file mode 100644 index 000000000..e4763d415 --- /dev/null +++ b/operators/rabbitmq-system/cluster-operator/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/rabbitmq/cluster-operator/releases/download/v2.10.0/cluster-operator.yml + +# this needs to be here to remove the namespace from the above +# because the cluster-operator defines the same namespace and it would conflict +patches: +- patch: |- + apiVersion: v1 + kind: Namespace + metadata: + name: rabbitmq-system + $patch: delete diff --git a/operators/rabbitmq-system/kustomization.yaml b/operators/rabbitmq-system/kustomization.yaml index c781978e7..b6196d825 100644 --- a/operators/rabbitmq-system/kustomization.yaml +++ b/operators/rabbitmq-system/kustomization.yaml @@ -1,19 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - resources: - - https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml - -# this needs to be here to remove the namespace from the above -# because the messaging-topology-operator defines the same namespace and it would conflict -patches: -- patch: |- - apiVersion: v1 - kind: Namespace - metadata: - name: rabbitmq-system - $patch: delete - -# have to put this after the patch above -resources: # yamllint disable-line rule:key-duplicates - - https://github.com/rabbitmq/messaging-topology-operator/releases/download/v1.13.0/messaging-topology-operator-with-certmanager.yaml +- cluster-operator/ +- messaging-topology/ diff --git a/operators/rabbitmq-system/messaging-topology/kustomization.yaml b/operators/rabbitmq-system/messaging-topology/kustomization.yaml new file mode 100644 index 000000000..07b8869fc --- /dev/null +++ b/operators/rabbitmq-system/messaging-topology/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - https://github.com/rabbitmq/messaging-topology-operator/releases/download/v1.13.0/messaging-topology-operator-with-certmanager.yaml +# this needs to be here to remove the namespace from the above +# because the messaging-topology-operator defines the same namespace and it would conflict +patches: +- patch: |- + apiVersion: v1 + kind: Namespace + metadata: + name: rabbitmq-system + $patch: delete diff --git a/operators/rook/values-cluster.yaml b/operators/rook/values-cluster.yaml index e40fe57bf..9ad4be3a1 100644 --- a/operators/rook/values-cluster.yaml +++ b/operators/rook/values-cluster.yaml @@ -20,7 +20,7 @@ cephBlockPools: storageClass: enabled: true name: ceph-block-replicated - isDefault: false + isDefault: true reclaimPolicy: Retain allowVolumeExpansion: true volumeBindingMode: "Immediate" diff --git a/python/ironic-understack/poetry.lock b/python/ironic-understack/poetry.lock index e63407e0c..57a64cd64 100644 --- a/python/ironic-understack/poetry.lock +++ b/python/ironic-understack/poetry.lock @@ -777,13 +777,13 @@ files = [ [[package]] name = "ironic" -version = "24.1.1" +version = "24.1.2" description = "OpenStack Bare Metal Provisioning" optional = false python-versions = ">=3.8" files = [ - {file = "ironic-24.1.1-py3-none-any.whl", hash = "sha256:3f465c20e0ac55f00dcca8bbfbd9cf8c318074282ca429088483e5c024a5fe41"}, - {file = "ironic-24.1.1.tar.gz", hash = "sha256:4a090bbd21b440b3cb435a9b9df63d77d80dc5e061e838b1117915a4b817f529"}, + {file = "ironic-24.1.2-py3-none-any.whl", hash = "sha256:5de48dd05ecf2353eb2e367be6b4a843ac662641b26ed7f1c337513575059354"}, + {file = "ironic-24.1.2.tar.gz", hash = "sha256:cd3182df1f789d79b5f05457d781c2cf4169483f97cea66dad168d5b03ed7b78"}, ] [package.dependencies] diff --git a/python/neutron-understack/neutron_understack/tests/conftest.py b/python/neutron-understack/neutron_understack/tests/conftest.py new file mode 100644 index 000000000..8204f957a --- /dev/null +++ b/python/neutron-understack/neutron_understack/tests/conftest.py @@ -0,0 +1,26 @@ +import random +import uuid + +import pytest + + +@pytest.fixture +def device_id() -> uuid.UUID: + return uuid.uuid4() + + +@pytest.fixture +def mac_address() -> str: + return ( + f"{random.randint(0, 255):02x}:" + f"{random.randint(0, 255):02x}:" + f"{random.randint(0, 255):02x}:" + f"{random.randint(0, 255):02x}:" + f"{random.randint(0, 255):02x}:" + f"{random.randint(0, 255):02x}" + ) + + +@pytest.fixture +def network_id() -> uuid.UUID: + return uuid.uuid4() diff --git a/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py b/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py index f8b71fe31..a88768b7e 100644 --- a/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py +++ b/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py @@ -2,8 +2,8 @@ import pytest -from neutron_understack.neutron_understack_mech import UnderstackDriver from neutron_understack.argo.workflows import ArgoClient +from neutron_understack.neutron_understack_mech import UnderstackDriver @pytest.fixture @@ -11,13 +11,13 @@ def argo_client() -> ArgoClient: return MagicMock(spec_set=ArgoClient) -def test_move_to_network__provisioning(argo_client): +def test_move_to_network__provisioning(argo_client, device_id, network_id, mac_address): driver = UnderstackDriver() driver._move_to_network( vif_type="other", - mac_address="fa:16:3e:35:1c:3d", - device_uuid="41d18c6a-5548-4ee9-926f-4e3ebf43153f", - network_id="c2702769-5592-4555-8ae6-e670db82c31e", + mac_address=mac_address, + device_uuid=str(device_id), + network_id=str(network_id), argo_client=argo_client, ) @@ -25,9 +25,10 @@ def test_move_to_network__provisioning(argo_client): template_name="undersync-device", entrypoint="trigger-undersync", parameters={ - "interface_mac": "fa:16:3e:35:1c:3d", - "device_uuid": "41d18c6a-5548-4ee9-926f-4e3ebf43153f", + "interface_mac": mac_address, + "device_uuid": str(device_id), "network_name": "tenant", + "network_id": str(network_id), "dry_run": True, "force": False, }, diff --git a/python/neutron-understack/pyproject.toml b/python/neutron-understack/pyproject.toml index 1b9230f0f..4678f8907 100644 --- a/python/neutron-understack/pyproject.toml +++ b/python/neutron-understack/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" + [tool.poetry] name = "neutron-understack" version = "0.1.0" @@ -64,3 +68,6 @@ ignore = [ [tool.ruff.lint.pydocstyle] # enable the google doc style rules by default convention = "google" + +[tool.poetry.plugins."neutron.ml2.mechanism_drivers"] +understack = "neutron_understack.neutron_understack_mech:UnderstackDriver" diff --git a/python/understack-workflows/poetry.lock b/python/understack-workflows/poetry.lock index f1b7b33a4..aa253be0d 100644 --- a/python/understack-workflows/poetry.lock +++ b/python/understack-workflows/poetry.lock @@ -1072,13 +1072,13 @@ six = ">=1.5" [[package]] name = "python-ironicclient" -version = "5.7.0" +version = "5.8.0" description = "OpenStack Bare Metal Provisioning API Client Library" optional = false python-versions = ">=3.8" files = [ - {file = "python-ironicclient-5.7.0.tar.gz", hash = "sha256:065c74a6bef7b9903c787776899f5663e6a8cc1156b10856a71a102ad8ed2529"}, - {file = "python_ironicclient-5.7.0-py3-none-any.whl", hash = "sha256:82280466e3935f2587999827c4ee6a5a19ad70c865fe46809411e7b39bee5e4f"}, + {file = "python-ironicclient-5.8.0.tar.gz", hash = "sha256:86fedc2358486628ca8682717ebc69ee102971f117da3526b9d3e29552ec942e"}, + {file = "python_ironicclient-5.8.0-py3-none-any.whl", hash = "sha256:cfb4c1be25c859f5fe13d1203803cad279a1cb8720d69778c215424f9eb0da0b"}, ] [package.dependencies] @@ -1377,13 +1377,13 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" [[package]] name = "sushy" -version = "5.1.1" +version = "5.2.0" description = "Sushy is a small Python library to communicate with Redfish based systems" optional = false python-versions = ">=3.8" files = [ - {file = "sushy-5.1.1-py3-none-any.whl", hash = "sha256:44876009e648b0ab43679b50a4a56de71dc574912ad2e378cd03de62249e839e"}, - {file = "sushy-5.1.1.tar.gz", hash = "sha256:2a8335f18b03ce44d2be4af83ddaed770b94884239d5d18abc7cbb3347e27bae"}, + {file = "sushy-5.2.0-py3-none-any.whl", hash = "sha256:503896341615761d81cd95dd5281ee4c8c02932c5048332d0000d2460209b8a0"}, + {file = "sushy-5.2.0.tar.gz", hash = "sha256:d90a696fef42c522892179138f4ceae347d11676efdbe18fdeda0cf81154c1e4"}, ] [package.dependencies] diff --git a/scripts/gitops-secrets-gen.sh b/scripts/gitops-secrets-gen.sh index 6fe042233..f696179b5 100755 --- a/scripts/gitops-secrets-gen.sh +++ b/scripts/gitops-secrets-gen.sh @@ -132,6 +132,7 @@ EOF [ -n "${UC_AIO}" ] && gen-argocd || echo "UC_AIO is NOT set so not creating ArgoCD bits" echo "Checking cert-manager" +mkdir -p "${DEST_DIR}/cert-manager" if [ ! -f "${DEST_DIR}/cert-manager/cluster-issuer.yaml" ]; then if [ "${UC_DEPLOY_EMAIL}" = "" ]; then echo "UC_DEPLOY_EMAIL is not set. Unable to generate cert-manager issuer." >&2 @@ -287,6 +288,7 @@ create_os_secret() { local username=$3 local secret_var="SECRET_${name}" local data_var="VARNAME_${name}" + local password_var="${!data_var}" file_suffix=$(convert_to_secret_name "${name}") echo "Writing ${component}/secret-${file_suffix}.yaml, please commit" @@ -294,7 +296,7 @@ create_os_secret() { create secret generic "${!secret_var}" \ --type Opaque \ --from-literal=username="${username}" \ - --from-literal=password="${!data_var}" \ + --from-literal=password="${!password_var}" \ --dry-run=client -o yaml \ | secret-seal-stdin "${DEST_DIR}/${component}/secret-${file_suffix}.yaml" } diff --git a/workflows/argo-events/secrets/nautobot-token.yaml b/workflows/argo-events/secrets/nautobot-token.yaml index 7e68151dd..beacac38b 100644 --- a/workflows/argo-events/secrets/nautobot-token.yaml +++ b/workflows/argo-events/secrets/nautobot-token.yaml @@ -23,3 +23,7 @@ spec: remoteRef: key: nautobot-superuser property: apitoken + # necessary to avoid argoproj/argo-cd#13004 + conversionStrategy: Default + decodingStrategy: None + metadataPolicy: None diff --git a/workflows/argo-events/secrets/openstack-svc-acct.yaml b/workflows/argo-events/secrets/openstack-svc-acct.yaml index 0793273ce..4e9503a10 100644 --- a/workflows/argo-events/secrets/openstack-svc-acct.yaml +++ b/workflows/argo-events/secrets/openstack-svc-acct.yaml @@ -26,3 +26,7 @@ spec: dataFrom: - extract: key: svc-acct-argoworkflow + # necessary to avoid argoproj/argo-cd#13004 + conversionStrategy: Default + decodingStrategy: None + metadataPolicy: None 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/bmc-firmware-update.yaml b/workflows/argo-events/workflowtemplates/bmc-firmware-update.yaml index d54a54981..3d3195ecb 100644 --- a/workflows/argo-events/workflowtemplates/bmc-firmware-update.yaml +++ b/workflows/argo-events/workflowtemplates/bmc-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-bmc-creds templateRef: name: get-bmc-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: update-firmware dependencies: [get-bmc-ip, get-bmc-creds] template: bmc-firmware-update diff --git a/workflows/argo-events/workflowtemplates/bmc-sync-creds.yaml b/workflows/argo-events/workflowtemplates/bmc-sync-creds.yaml index c79a99f42..84c1d6e0b 100644 --- a/workflows/argo-events/workflowtemplates/bmc-sync-creds.yaml +++ b/workflows/argo-events/workflowtemplates/bmc-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-bmc-creds templateRef: name: get-bmc-creds template: main arguments: parameters: - - name: hostname - value: "{{workflow.parameters.hostname}}" + - name: device_id + value: "{{workflow.parameters.device_id}}" - name: bmc-sync-creds dependencies: [get-bmc-ip, get-bmc-creds] template: bmc-sync-creds diff --git a/workflows/argo-events/workflowtemplates/get-bmc-creds.yaml b/workflows/argo-events/workflowtemplates/get-bmc-creds.yaml index ab7eaa4cc..16814c4e5 100644 --- a/workflows/argo-events/workflowtemplates/get-bmc-creds.yaml +++ b/workflows/argo-events/workflowtemplates/get-bmc-creds.yaml @@ -4,7 +4,7 @@ metadata: name: get-bmc-creds namespace: argo-events annotations: - workflows.argoproj.io/title: Create a k8s secret containing BMC creds for given device hostname + workflows.argoproj.io/title: Create a k8s secret containing BMC creds for given device_id workflows.argoproj.io/description: | Defined in `workflows/argo-events/workflowtemplates/get-bmc-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's BMC 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-bmc-ip.yaml b/workflows/argo-events/workflowtemplates/get-bmc-ip.yaml index 869ae99f0..d6a5d8295 100644 --- a/workflows/argo-events/workflowtemplates/get-bmc-ip.yaml +++ b/workflows/argo-events/workflowtemplates/get-bmc-ip.yaml @@ -4,7 +4,7 @@ metadata: name: get-bmc-ip namespace: argo-events annotations: - workflows.argoproj.io/title: Output BMC IP address for the Device with the given hostname + workflows.argoproj.io/title: Output BMC IP address for the Device with the given device_id workflows.argoproj.io/description: | Defined in `workflows/argo-events/workflowtemplates/get-bmc-ip.yaml`. Get BMC 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/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/idrac-enable-network-boot.yaml b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml index 0fdc5d32a..3260e3eca 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-bmc-creds templateRef: name: get-bmc-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-bmc-ip, get-bmc-creds] template: idrac-enable-network-boot diff --git a/workflows/argo-events/workflowtemplates/sync-bmc-creds.yaml b/workflows/argo-events/workflowtemplates/sync-bmc-creds.yaml index 33c693f23..7990d37fa 100644 --- a/workflows/argo-events/workflowtemplates/sync-bmc-creds.yaml +++ b/workflows/argo-events/workflowtemplates/sync-bmc-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-bmc-creds template: sync-bmc-creds arguments: 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 c8fb82e29..49ab391d5 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-srv-redfish-intfs-to-nb.yaml b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml index df04755c0..d6ee79903 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-bmc-creds-secret templateRef: name: get-bmc-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