Ansible Module: nokia.nsp.wfm¶
Manage workflows in Nokia NSP
Notes
Requires ansible.netcommon.httpapi connection using Network OS nokia.nsp.nsp.
Exactly one of upload, define, execute, or delete must be specified.
Using check-mode workflows will be validated but not created/updated.
Updates follow lifecycle: DRAFT → update → PUBLISHED.
Creates follow lifecycle: create → PUBLISHED.
Synopsis¶
- Create, update, delete, and execute workflows in Workflow Manager.
- Upload workflows from files or directories (with optional README and UI schemas).
- Create workflows from YAML definition.
- Execute workflows synchronously.
Parameters¶
| Parameter | Type | Comments |
|---|---|---|
| upload | path | Create or updates a workflow. User provides either a file path or a directory path. If file is provided, it must be a valid YAML file. If directory is provided, it must contain exactly one .yaml or .yml file.Automatically transitions lifecycle: DRAFT → PUBLISHED. Upload includes README.md and UI schema .json files if present.Mutually exclusive with define, execute, or delete. |
| define | str | Create or updates a workflow. Workflow definition is provided as YAML text. A compelete and valid workflow definition must be provided. Automatically transitions lifecycle: DRAFT → PUBLISHED. Mutually exclusive with upload, execute, or delete. |
| execute | str | Execute a workflow synchronously. Workflow name or UUID to be provided. Returns execution result with state and output. Mutually exclusive with upload, define, or delete. |
| delete | str | Deletes a workflow from NSP. Workflow name or UUID to be provided. |
| input | dict | Input parameters for workflow execution. Used if execute is used.Default: {} |
Examples¶
- name: Upload workflow from file
nokia.nsp.wfm:
upload: workflow.yaml
- name: Upload workflow from directory
nokia.nsp.wfm:
upload: /path/to/workflow_dir/
- name: Define workflow inline
nokia.nsp.wfm:
define: |
---
version: '2.0'
helloworld:
description: Simple test workflow
type: direct
tags:
- test
input:
- host: localhost
- seconds: 1
output:
result: <% task("pingtask").result %>
tasks:
pingtask:
action: nsp.ping
input:
host: <% $.host %>
duration: <% $.seconds %>
- name: Execute workflow by name
nokia.nsp.wfm:
execute: helloworld
input:
host: localhost
seconds: 5
- name: Execute workflow by UUID
nokia.nsp.wfm:
execute: "{{ workflow_id }}"
input:
host: localhost
seconds: 5
- name: Delete workflow
nokia.nsp.wfm:
delete: my_workflow
- name: Complete CI/CD pipeline
block:
- name: Upload workflow
nokia.nsp.wfm:
upload: workflows/helloworld/helloworld.yaml
register: wf
- name: Execute workflow
nokia.nsp.wfm:
execute: "{{ wf.workflow_id }}"
input:
host: localhost
seconds: 5
- name: Cleanup workflow
nokia.nsp.wfm:
delete: "{{ wf.workflow_id }}"
Return Values¶
| Parameter | Type | Comments |
|---|---|---|
| workflow_id | str | UUID of the workflow Returned: success Sample: a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
| workflow_name | str | Name of the workflow Returned: success Sample: my_workflow |
| status | str | Workflow status Returned: when upload or define Sample: PUBLISHED |
| execution_id | str | UUID of the execution Returned: when execute Sample: f1e2d3c4-b5a6-7890-cdef-123456789abc |
| state | str | Execution state Returned: when execute Sample: SUCCESS |
| output | dict | Workflow execution output Returned: when execute and completed |
| state_info | str | Execution state information or error details Returned: when execute |
| changed | bool | Whether workflow was created, updated, or deleted Returned: always |
| msg | str | Human-readable message describing the operation result Returned: always |
New in version "0.1.0"