Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Getting VLAN ID part2
- shell: jq -r ".collection|.[]|select(.name=="{{item.vlan}}").id" /tmp/temporal4
- register: id_vlan
- with_items: "{{ nic | default () }}"
- - name: Getting IP ID part 2
- shell: jq ".collection|.[]|select(.ip=="{{item.item.ip}}").id" /tmp/vlan{{item.stdout}}
- register: id_ip
- with_items: "{{id_vlan.results}}"
- - name: API CALL
- uri:
- url: "https://xxxx.xx-xxx.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/"
- method: POST
- force_basic_auth: yes
- validate_certs: no
- HEADER_Content-Type: "application/vnd.abiquo.virtualmachine+json; version=3.8"
- HEADER_Accept: "application/vnd.abiquo.virtualmachine+json; version=3.8"
- user: "xxxxa"
- password: "xxxx"
- body: "{{ lookup('file','/tmp/requestpayload.json') }}"
- body_format: json
- status_code: 201
- dest: "/tmp/temporal
- "title":"{{ip}}",
- "rel":"",
- "type":"application/vnd.xxxx.externalip+json",
- "href": "https://xxx.xxxx-xxxx.com:443/api/admin/enterprises/2/limits/2/externalnetworks/{{id_vlan.stdout}}/ips/{{id_ip.stdout}}"
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement