Skip to content

Commit 3b663fa

Browse files
committed
capture outputs, fix ansible step extra dash
1 parent fdaad5f commit 3b663fa

File tree

2 files changed

+31
-22
lines changed

2 files changed

+31
-22
lines changed

workflows/argo-events/workflowtemplates/openstack-oslo-event.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,15 @@ spec:
8080
valueFrom:
8181
path: /var/run/argo/output.project_tags
8282
default: ""
83+
- name: storage
84+
valueFrom:
85+
path: /var/run/argo/output.storage
86+
default: "undefined"
87+
- name: node_uuid
88+
valueFrom:
89+
path: /var/run/argo/output.node_uuid
90+
default: "undefined"
91+
- name: instance_uuid
92+
valueFrom:
93+
path: /var/run/argo/output.instance_uuid
94+
default: "undefined"

workflows/openstack/sensors/sensor-ironic-oslo-event.yaml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ spec:
4646
name: ironic-project
4747
k8s:
4848
operation: create
49-
# edits source section
5049
parameters:
5150
# first parameter is the parsed oslo.message
5251
- dest: spec.arguments.parameters.0.value # event-json
@@ -98,24 +97,22 @@ spec:
9897
import uuid
9998
project_id_without_dashes = "{{workflow.parameters.project_id}}"
10099
print(str(uuid.UUID(project_id_without_dashes)))
101-
- - name: ansible-on_server_create
102-
when: "{{steps.oslo-events.outputs.parameters.storage}} == 'wanted'"
103-
inline:
104-
container:
105-
image: ghcr.io/rss-engineering/undercloud-nautobot/ansible:latest
106-
command: [ansible-playbook]
107-
args:
108-
- "storage_on_server_create.yml"
109-
- --extra-vars
110-
- "project_id={{steps.convert-project-id.outputs.result}} device_id={{workflow.parameters.device_id}} env=dev"
111-
- "-i"
112-
- "inventory/uc-dev/01-nautobot.yaml"
113-
- "-vvv"
114-
# TODO: this shouldn't be hardcodod to dev, but will work since
115-
# it really talks to https://nautobot-default.svc
116-
env:
117-
- name: NAUTOBOT_TOKEN
118-
valueFrom:
119-
secretKeyRef:
120-
key: token
121-
name: nautobot-token
100+
- - name: ansible-on-server-create
101+
when: "\"{{steps.oslo-events.outputs.parameters.storage}}\" == wanted"
102+
inline:
103+
container:
104+
image: ghcr.io/rss-engineering/undercloud-nautobot/ansible:latest
105+
command: [ansible-playbook]
106+
args:
107+
- "storage_on_server_create.yml"
108+
- --extra-vars
109+
- "project_id={{steps.convert-project-id.outputs.result}} device_id={{workflow.parameters.device_id}} env=dev"
110+
- "-i"
111+
- "inventory/uc-dev/01-nautobot.yaml"
112+
- "-vvv"
113+
env:
114+
- name: NAUTOBOT_TOKEN
115+
valueFrom:
116+
secretKeyRef:
117+
key: token
118+
name: nautobot-token

0 commit comments

Comments
 (0)