Skip to content

Commit

Permalink
Fix a bug in provisioning network
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed May 15, 2023
1 parent f0c2c78 commit 7e2bad0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions templates/kiss/tasks/commission/network-ethernet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
- name: Populate facts
setup:

- name: Populate service facts
service_facts:

Expand Down Expand Up @@ -69,21 +66,24 @@
# filter the physical devices that has connected to the specific network as ethernet
when: >
item in ansible_facts
and (
item == ansible_facts.default_ipv4.interface
or 'ipv4' in ansible_facts[item]
and 'netmask' in ansible_facts[item].ipv4
and ansible_facts[item].ipv4.netmask == kiss_network_ipv4_subnet_mask
and 'network' in ansible_facts[item].ipv4
and ansible_facts[item].ipv4.network == kiss_network_ipv4_subnet_address
)
and ansible_facts[item].active
and 'ipv4' in ansible_facts[item]
and 'macaddress' in ansible_facts[item]
and 'module' in ansible_facts[item]
and 'netmask' in ansible_facts[item].ipv4
and ansible_facts[item].ipv4.netmask == kiss_network_ipv4_subnet_mask
and 'network' in ansible_facts[item].ipv4
and ansible_facts[item].ipv4.network == kiss_network_ipv4_subnet_address
and 'type' in ansible_facts[item]
and ansible_facts[item].type == 'ether'
set_fact:
interfaces: >
{{ interfaces + [{
'name': item,
'address_ipv4': ansible_facts[item].ipv4.address,
'address_ipv4': ansible_facts.default_ipv4.address if item == ansible_facts.default_ipv4.interface else ansible_facts[item].ipv4.address,
'address_ipv4_netmask': kiss_network_ipv4_subnet_mask_prefix,
'address_ipv4_gateway': ansible_default_ipv4.gateway,
'dns': [
Expand Down

0 comments on commit 7e2bad0

Please sign in to comment.