Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.17.26.38
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks/ova_workflow.yml
---
# Execute Orchestration Workflow
- hosts: localhost
  collections:
    - cisco.intersight
  gather_facts: false
  vars:
    # Create an anchor for api_info that can be used throughout the file
    api_info: &api_info
      api_private_key: "{{ api_private_key }}"
      api_key_id: "{{ api_key_id }}"
    image_url: "{{ image_url | default('http://172.28.224.62/UCSPE_4.0.4e.ova') }}"
    vm_name: "{{ vm_name | default('ucspe-4-0-4e-orch') }}"
  tasks:
    - name: Get vCenter Moid
      intersight_rest_api:
        <<: *api_info
        resource_path: /asset/DeviceRegistrations
        query_params:
          $filter: DeviceIpAddress eq '172.28.225.220'
      register: vcenter
    - name: Execute OVA deploy workflow
      intersight_rest_api:
        <<: *api_info
        resource_path: /workflow/WorkflowInfos
        update_method: post
        api_body: {
          "Name": "ucspe_vm",
          "Organization": {
            # "Selector": "Name eq 'default'",
            # "ObjectType": "organization.Organization"
            "Moid": "5dde9f116972652d33539d39"
          },
          "Action": "Start",
          "Input": {
            "Vcenter": {
              "Moid": "{{ vcenter.api_response.Moid }}",
              "ObjectType":"asset.DeviceRegistration"
            },
            "Datastore": "Atlanta Data",
            "Image": "{{ image_url }}",
            "VmName": "{{ vm_name }}",
            "PowerOn": false,
            "Datacenter": "SJC07",
            "Cluster": "Atlanta"
          },
          "WorkflowDefinition": {
            "Selector": "Name eq 'ucspe_vm'",
            "ObjectType":"workflow.WorkflowDefinition"
          },
          "WorkflowCtx": {
            "InitiatorCtx": {
              "InitiatorName":"ucspe_vm",
              "InitiatorType":"workflow.WorkflowDefinition"
            }
          }
        }
      register: workflow
    - name: Get status of OVA deploy workflow
      intersight_rest_api:
        <<: *api_info
        resource_path: /workflow/WorkflowInfos
        query_params:
          $expand: ParentTaskInfo($select=WorkflowInfo;$expand=WorkflowInfo($select=WorkflowDefinition))
          $filter: "Moid eq '{{ workflow.api_response.Moid }}'"
      register: status
      until: status.api_response.Status != 'RUNNING' and status.api_response.Status != 'WAITING'
      retries: 10
      delay: 60
      ignore_errors: true
    - debug:
        msg: "Final workflow status: {{ status.api_response.Status }}"

Anon7 - 2022
AnonSec Team