2022-01-05 23:59:13 +01:00
---
2022-02-13 01:37:39 +01:00
- name : Define existing IP address
2022-01-05 23:59:13 +01:00
set_fact :
2022-02-13 01:37:39 +01:00
ip_address : "{{ nb_ip_1.json.results[0].address | ansible.netcommon.ipaddr('address') }}"
ip_address_cidr : "{{ nb_ip_1.json.results[0].address }}"
ip_address_type : "existing"
ipid : "{{ nb_ip_1.json.results[0].id }}"
when : "nb_ip_1.status|int == 200 and nb_ip_1.json.count|int != 0 and (nb_ip_1.json.results[0].status is defined and nb_ip_1.json.results[0].status.value == 'active')"
2022-02-13 16:56:12 +01:00
tags :
- init_dp
- init_ssh
2022-01-05 23:59:13 +01:00
2022-02-13 01:37:39 +01:00
- name : Define new IP address
set_fact :
ip_address : "{{ nb_ip_2.json[0].address | ansible.netcommon.ipaddr('address') }}"
ip_address_cidr : "{{ nb_ip_2.json[0].address }}"
ip_address_type : "new"
when : "nb_ip_2.status is defined and nb_ip_2.status|int == 200"
tags :
- init_dp
2022-02-13 16:56:12 +01:00
- init_ssh