-
Notifications
You must be signed in to change notification settings - Fork 15
/
tag_vm_tower.yml
35 lines (32 loc) · 1.02 KB
/
tag_vm_tower.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: Tag VM
hosts: "{{ vm_target_name }}"
vars:
user: admin
password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33626531363333626638363663613161623332396465373336356137656562316362653061366462
3265643766396636656230653162646336373562386439650a363130346538653338623734666136
36393562623936356135613230323066613439366362643638633634616534663964343634636233
3363613539613766360a663833616665323831613034376661376234303763353665313164363334
3934
vm_target_name:
tasks:
- debug: var=hostvars[inventory_hostname].cloudforms.href
- debug: var=user
- debug: var=password
- name: Tag the VM
uri:
url: "{{ hostvars[inventory_hostname].cloudforms.href }}/tags"
method: POST
validate_certs: no
force_basic_auth: yes
user: "{{ user }}"
password: "{{ password }}"
body_format: json
body:
action: assign
resources:
- name: "/function/database"
register: output
- debug: var=output