summaryrefslogtreecommitdiffstats
path: root/ansible/deployment_poc/tasks/netbox_evaluate_vm.yml
blob: f0f584c3309571821a11b9646055e90fa3e16c54 (plain)
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
---
- name: Pick hard- and software
  # not needed, can be pulled from hostvars
  set_fact:
    vcpus: "{{ nb_vm.json.results[0].vcpus | int }}"
    os: "{{ nb_vm.json.results[0].platform.name }}"
    
#            - name: Pick virtual hardware specifications
#              # not needed, part of hostvars
#              set_fact:
#                memory: "{{ nb_vm.json.results[0].memory }}"
#                disk: "{{ nb_vm.json.results[0].disk }}"
  tags:
    - init_dp
    - init_ssh
    
- name: Pick metadata
  set_fact:
    id: "{{ nb_vm.json.results[0].id }}"
    site: "{{ hostvars[inventory_hostname]['sites'][0] }}"
    status: "{{ nb_vm.json.results[0].status.value }}"

#                # not needed, part of hostvars
#                #tags: "{{ nb_vm.json.results[0].tags[0].slug }}"
#                #tags: "{{ nb_vm.json.results[0].tags | sum(start=[]) | map(attribute='slug') }}"
  tags:
    - init_dp
    - init_ssh