Advertisement
Guest User

Untitled

a guest
Dec 19th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. - name: Getting VLAN ID part2
  2. shell: jq -r ".collection|.[]|select(.name=="{{item.vlan}}").id" /tmp/temporal4
  3. register: id_vlan
  4. with_items: "{{ nic | default () }}"
  5.  
  6. - name: Getting IP ID part 2
  7. shell: jq ".collection|.[]|select(.ip=="{{item.item.ip}}").id" /tmp/vlan{{item.stdout}}
  8. register: id_ip
  9. with_items: "{{id_vlan.results}}"
  10.  
  11. - name: API CALL
  12. uri:
  13. url: "https://xxxx.xx-xxx.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/"
  14. method: POST
  15. force_basic_auth: yes
  16. validate_certs: no
  17. HEADER_Content-Type: "application/vnd.abiquo.virtualmachine+json; version=3.8"
  18. HEADER_Accept: "application/vnd.abiquo.virtualmachine+json; version=3.8"
  19. user: "xxxxa"
  20. password: "xxxx"
  21. body: "{{ lookup('file','/tmp/requestpayload.json') }}"
  22. body_format: json
  23. status_code: 201
  24. dest: "/tmp/temporal
  25.  
  26. "title":"{{ip}}",
  27. "rel":"",
  28. "type":"application/vnd.xxxx.externalip+json",
  29. "href": "https://xxx.xxxx-xxxx.com:443/api/admin/enterprises/2/limits/2/externalnetworks/{{id_vlan.stdout}}/ips/{{id_ip.stdout}}"
  30. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement