Advertisement
Guest User

Untitled

a guest
Apr 16th, 2020
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.72 KB | None | 0 0
  1. ---
  2. version: '2.0'
  3.  
  4. create_vm:
  5.   description: Simple workflow example
  6.  
  7.   input:
  8.    - vm_name
  9.     - image_ref
  10.     - flavor_ref
  11.     - nics
  12.         net-id: xxxxxxx
  13.   output:
  14.     vm_id: "{{ _.vm_id }}"
  15.     vm_status: <% $.vm_status %>
  16.  
  17.   tasks:
  18.     create_server:
  19.       action: nova.servers_create name=<% $.vm_name %> image=<% $.image_ref %> flavor=<% $.flavor_ref %>
  20.       input:
  21.         nics: <% $.nics %>
  22.       publish:
  23.         vm_id: <% task().result.id %>
  24.       on-success:
  25.        - wait_for_instance
  26.  
  27.     wait_for_instance:
  28.       action: nova.servers_find id={{ _.vm_id }} status='ACTIVE'
  29.       retry:
  30.         delay: 5
  31.         count: 15
  32.       publish:
  33.         vm_status: "{{ task().result.status }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement