sanity and tox fixed

pull/156/head
KB-perByte 2022-04-05 15:44:37 +05:30
parent 234b503842
commit 3f98e8ae7a
No known key found for this signature in database
GPG Key ID: F49472BE1744C3D5
3 changed files with 742 additions and 731 deletions

View File

@ -185,9 +185,10 @@ Examples
.. code-block:: yaml
# Consolidated facts example
# ------------
# --------------------------
##facts.yml
interfaces:
- name: GigabitEthernet0/0
enabled: true
@ -431,7 +432,7 @@ Examples
# }
# Read vars_file 'facts.yml'
# TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
# TASK [Combine all the facts based on match_keys]
# ok: [localhost] => {
# "ansible_facts": {
# "combined": {
@ -674,150 +675,151 @@ Examples
combined: "{{ data_source|ansible.utils.consolidate(fail_missing_match_value=True) }}"
##Output
ok: [localhost] => {
"ansible_facts": {
"data_source": [
{
"data": [
{
"duplex": "auto",
"enabled": true,
"name": "GigabitEthernet0/0",
"note": [
"Connected green wire"
],
"speed": "auto"
},
{
"description": "Configured by Ansible - Interface 1",
"duplex": "auto",
"enabled": true,
"mtu": 1500,
"name": "GigabitEthernet0/1",
"note": [
"Connected blue wire",
"Configured by Paul"
],
"speed": "auto",
"vifs": [
{
"comment": "Needs reconfiguration",
"description": "Eth1 - VIF 100",
"enabled": true,
"mtu": 400,
"vlan_id": 100
},
{
"description": "Eth1 - VIF 101",
"enabled": true,
"vlan_id": 101
}
]
},
{
"description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
"enabled": false,
"mtu": 600,
"name": "GigabitEthernet0/2"
}
],
"match_key": "name",
"prefix": "interfaces"
},
{
"data": [
{
"name": "GigabitEthernet0/0"
},
{
"mode": "access",
"name": "GigabitEthernet0/1",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
]
}
},
{
"mode": "trunk",
"name": "GigabitEthernet0/2",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
],
"encapsulation": "dot1q"
}
}
],
"match_key": "name",
"prefix": "l2_interfaces"
},
{
"data": [
{
"ipv4": [
{
"address": "192.168.0.2/24"
}
],
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/1"
},
{
"name": "GigabitEthernet0/2"
},
{
"name": "Loopback888"
},
{
"name": "Loopback999"
}
],
"match_key": "name",
"prefix": "l3_interfaces"
}
]
},
"changed": false
}
Read vars_file 'facts.yml'
# ok: [localhost] => {
# "ansible_facts": {
# "data_source": [
# {
# "data": [
# {
# "duplex": "auto",
# "enabled": true,
# "name": "GigabitEthernet0/0",
# "note": [
# "Connected green wire"
# ],
# "speed": "auto"
# },
# {
# "description": "Configured by Ansible - Interface 1",
# "duplex": "auto",
# "enabled": true,
# "mtu": 1500,
# "name": "GigabitEthernet0/1",
# "note": [
# "Connected blue wire",
# "Configured by Paul"
# ],
# "speed": "auto",
# "vifs": [
# {
# "comment": "Needs reconfiguration",
# "description": "Eth1 - VIF 100",
# "enabled": true,
# "mtu": 400,
# "vlan_id": 100
# },
# {
# "description": "Eth1 - VIF 101",
# "enabled": true,
# "vlan_id": 101
# }
# ]
# },
# {
# "description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
# "enabled": false,
# "mtu": 600,
# "name": "GigabitEthernet0/2"
# }
# ],
# "match_key": "name",
# "prefix": "interfaces"
# },
# {
# "data": [
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "mode": "access",
# "name": "GigabitEthernet0/1",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ]
# }
# },
# {
# "mode": "trunk",
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ],
# "encapsulation": "dot1q"
# }
# }
# ],
# "match_key": "name",
# "prefix": "l2_interfaces"
# },
# {
# "data": [
# {
# "ipv4": [
# {
# "address": "192.168.0.2/24"
# }
# ],
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "name": "Loopback888"
# },
# {
# "name": "Loopback999"
# }
# ],
# "match_key": "name",
# "prefix": "l3_interfaces"
# }
# ]
# },
# "changed": false
# }
# Read vars_file 'facts.yml'
TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
fatal: [localhost]: FAILED! => {
"msg": "Error when using plugin 'consolidate': 'fail_missing_match_value' reported Missing match value Loopback999, Loopback888 in data source 0, Missing match value Loopback999, Loopback888 in data source 1"
}
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_value' reported Missing match value Loopback999,
# Loopback888 in data source 0, Missing match value Loopback999, Loopback888 in data source 1"
# }
# Failing on missing match keys
# -----------------------------
@ -1066,9 +1068,13 @@ Examples
# }
# Read vars_file 'facts.yml'
# TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_key' reported Missing match key 'name' in data source 2 in list entry 0, Missing match key 'name' in data source 2 in list entry 1, Missing match key 'name' in data source 2 in list entry 2, Missing match key 'name' in data source 2 in list entry 3, Missing match key 'name' in data source 2 in list entry 4"
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_key' reported Missing match
# key 'name' in data source 2 in list entry 0, Missing match key 'name' in data
# source 2 in list entry 1, Missing match key 'name' in data source 2 in list
# entry 2, Missing match key 'name' in data source 2 in list entry 3, Missing
# match key 'name' in data source 2 in list entry 4"
# }
# Failing on duplicate values in facts
@ -1179,153 +1185,153 @@ Examples
combined: "{{ data_source|ansible.utils.consolidate(fail_duplicate=True) }}"
##Output
ok: [localhost] => {
"ansible_facts": {
"data_source": [
{
"data": [
{
"duplex": "auto",
"enabled": true,
"name": "GigabitEthernet0/0",
"note": [
"Connected green wire"
],
"speed": "auto"
},
{
"description": "Configured by Ansible - Interface 1",
"duplex": "auto",
"enabled": true,
"mtu": 1500,
"name": "GigabitEthernet0/1",
"note": [
"Connected blue wire",
"Configured by Paul"
],
"speed": "auto",
"vifs": [
{
"comment": "Needs reconfiguration",
"description": "Eth1 - VIF 100",
"enabled": true,
"mtu": 400,
"vlan_id": 100
},
{
"description": "Eth1 - VIF 101",
"enabled": true,
"vlan_id": 101
}
]
},
{
"description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
"enabled": false,
"mtu": 600,
"name": "GigabitEthernet0/2"
}
],
"match_key": "name",
"prefix": "interfaces"
},
{
"data": [
{
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/0"
},
{
"mode": "access",
"name": "GigabitEthernet0/1",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
]
}
},
{
"mode": "trunk",
"name": "GigabitEthernet0/2",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
],
"encapsulation": "dot1q"
}
}
],
"match_key": "name",
"prefix": "l2_interfaces"
},
{
"data": [
{
"ipv4": [
{
"address": "192.168.0.2/24"
}
],
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/1"
},
{
"name": "GigabitEthernet0/2"
},
{
"name": "Loopback888"
},
{
"name": "Loopback999"
}
],
"match_key": "name",
"prefix": "l3_interfaces"
}
]
},
"changed": false
}
Read vars_file 'facts.yml'
# ok: [localhost] => {
# "ansible_facts": {
# "data_source": [
# {
# "data": [
# {
# "duplex": "auto",
# "enabled": true,
# "name": "GigabitEthernet0/0",
# "note": [
# "Connected green wire"
# ],
# "speed": "auto"
# },
# {
# "description": "Configured by Ansible - Interface 1",
# "duplex": "auto",
# "enabled": true,
# "mtu": 1500,
# "name": "GigabitEthernet0/1",
# "note": [
# "Connected blue wire",
# "Configured by Paul"
# ],
# "speed": "auto",
# "vifs": [
# {
# "comment": "Needs reconfiguration",
# "description": "Eth1 - VIF 100",
# "enabled": true,
# "mtu": 400,
# "vlan_id": 100
# },
# {
# "description": "Eth1 - VIF 101",
# "enabled": true,
# "vlan_id": 101
# }
# ]
# },
# {
# "description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
# "enabled": false,
# "mtu": 600,
# "name": "GigabitEthernet0/2"
# }
# ],
# "match_key": "name",
# "prefix": "interfaces"
# },
# {
# "data": [
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "mode": "access",
# "name": "GigabitEthernet0/1",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ]
# }
# },
# {
# "mode": "trunk",
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ],
# "encapsulation": "dot1q"
# }
# }
# ],
# "match_key": "name",
# "prefix": "l2_interfaces"
# },
# {
# "data": [
# {
# "ipv4": [
# {
# "address": "192.168.0.2/24"
# }
# ],
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "name": "Loopback888"
# },
# {
# "name": "Loopback999"
# }
# ],
# "match_key": "name",
# "prefix": "l3_interfaces"
# }
# ]
# },
# "changed": false
# }
# Read vars_file 'facts.yml'
TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
fatal: [localhost]: FAILED! => {
"msg": "Error when using plugin 'consolidate': 'fail_duplicate' reported Duplicate values in data source 1"
}
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_duplicate' reported Duplicate values in data source 1"
# }

View File

@ -52,9 +52,10 @@ DOCUMENTATION = """
EXAMPLES = r"""
# Consolidated facts example
# ------------
# --------------------------
##facts.yml
interfaces:
- name: GigabitEthernet0/0
enabled: true
@ -137,9 +138,9 @@ l3_interfaces:
- name: Loopback999
##Playbook
vars_files:
vars_files:
- "facts.yml"
tasks:
tasks:
- name: Build the facts collection
set_fact:
data_source:
@ -298,7 +299,7 @@ l3_interfaces:
# }
# Read vars_file 'facts.yml'
# TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
# TASK [Combine all the facts based on match_keys]
# ok: [localhost] => {
# "ansible_facts": {
# "combined": {
@ -520,9 +521,9 @@ l3_interfaces:
- name: Loopback999
##Playbook
vars_files:
vars_files:
- "facts.yml"
tasks:
tasks:
- name: Build the facts collection
set_fact:
data_source:
@ -541,150 +542,151 @@ l3_interfaces:
combined: "{{ data_source|ansible.utils.consolidate(fail_missing_match_value=True) }}"
##Output
ok: [localhost] => {
"ansible_facts": {
"data_source": [
{
"data": [
{
"duplex": "auto",
"enabled": true,
"name": "GigabitEthernet0/0",
"note": [
"Connected green wire"
],
"speed": "auto"
},
{
"description": "Configured by Ansible - Interface 1",
"duplex": "auto",
"enabled": true,
"mtu": 1500,
"name": "GigabitEthernet0/1",
"note": [
"Connected blue wire",
"Configured by Paul"
],
"speed": "auto",
"vifs": [
{
"comment": "Needs reconfiguration",
"description": "Eth1 - VIF 100",
"enabled": true,
"mtu": 400,
"vlan_id": 100
},
{
"description": "Eth1 - VIF 101",
"enabled": true,
"vlan_id": 101
}
]
},
{
"description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
"enabled": false,
"mtu": 600,
"name": "GigabitEthernet0/2"
}
],
"match_key": "name",
"prefix": "interfaces"
},
{
"data": [
{
"name": "GigabitEthernet0/0"
},
{
"mode": "access",
"name": "GigabitEthernet0/1",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
]
}
},
{
"mode": "trunk",
"name": "GigabitEthernet0/2",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
],
"encapsulation": "dot1q"
}
}
],
"match_key": "name",
"prefix": "l2_interfaces"
},
{
"data": [
{
"ipv4": [
{
"address": "192.168.0.2/24"
}
],
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/1"
},
{
"name": "GigabitEthernet0/2"
},
{
"name": "Loopback888"
},
{
"name": "Loopback999"
}
],
"match_key": "name",
"prefix": "l3_interfaces"
}
]
},
"changed": false
}
Read vars_file 'facts.yml'
# ok: [localhost] => {
# "ansible_facts": {
# "data_source": [
# {
# "data": [
# {
# "duplex": "auto",
# "enabled": true,
# "name": "GigabitEthernet0/0",
# "note": [
# "Connected green wire"
# ],
# "speed": "auto"
# },
# {
# "description": "Configured by Ansible - Interface 1",
# "duplex": "auto",
# "enabled": true,
# "mtu": 1500,
# "name": "GigabitEthernet0/1",
# "note": [
# "Connected blue wire",
# "Configured by Paul"
# ],
# "speed": "auto",
# "vifs": [
# {
# "comment": "Needs reconfiguration",
# "description": "Eth1 - VIF 100",
# "enabled": true,
# "mtu": 400,
# "vlan_id": 100
# },
# {
# "description": "Eth1 - VIF 101",
# "enabled": true,
# "vlan_id": 101
# }
# ]
# },
# {
# "description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
# "enabled": false,
# "mtu": 600,
# "name": "GigabitEthernet0/2"
# }
# ],
# "match_key": "name",
# "prefix": "interfaces"
# },
# {
# "data": [
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "mode": "access",
# "name": "GigabitEthernet0/1",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ]
# }
# },
# {
# "mode": "trunk",
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ],
# "encapsulation": "dot1q"
# }
# }
# ],
# "match_key": "name",
# "prefix": "l2_interfaces"
# },
# {
# "data": [
# {
# "ipv4": [
# {
# "address": "192.168.0.2/24"
# }
# ],
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "name": "Loopback888"
# },
# {
# "name": "Loopback999"
# }
# ],
# "match_key": "name",
# "prefix": "l3_interfaces"
# }
# ]
# },
# "changed": false
# }
# Read vars_file 'facts.yml'
TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
fatal: [localhost]: FAILED! => {
"msg": "Error when using plugin 'consolidate': 'fail_missing_match_value' reported Missing match value Loopback999, Loopback888 in data source 0, Missing match value Loopback999, Loopback888 in data source 1"
}
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_value' reported Missing match value Loopback999,
# Loopback888 in data source 0, Missing match value Loopback999, Loopback888 in data source 1"
# }
# Failing on missing match keys
# -----------------------------
@ -772,9 +774,9 @@ l3_interfaces:
- inft_name: Loopback999
##Playbook
vars_files:
vars_files:
- "facts.yml"
tasks:
tasks:
- name: Build the facts collection
set_fact:
data_source:
@ -933,9 +935,13 @@ l3_interfaces:
# }
# Read vars_file 'facts.yml'
# TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_key' reported Missing match key 'name' in data source 2 in list entry 0, Missing match key 'name' in data source 2 in list entry 1, Missing match key 'name' in data source 2 in list entry 2, Missing match key 'name' in data source 2 in list entry 3, Missing match key 'name' in data source 2 in list entry 4"
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_key' reported Missing match
# key 'name' in data source 2 in list entry 0, Missing match key 'name' in data
# source 2 in list entry 1, Missing match key 'name' in data source 2 in list
# entry 2, Missing match key 'name' in data source 2 in list entry 3, Missing
# match key 'name' in data source 2 in list entry 4"
# }
# Failing on duplicate values in facts
@ -1025,9 +1031,9 @@ l3_interfaces:
- name: Loopback999
##Playbook
vars_files:
vars_files:
- "facts.yml"
tasks:
tasks:
- name: Build the facts collection
set_fact:
data_source:
@ -1046,153 +1052,153 @@ l3_interfaces:
combined: "{{ data_source|ansible.utils.consolidate(fail_duplicate=True) }}"
##Output
ok: [localhost] => {
"ansible_facts": {
"data_source": [
{
"data": [
{
"duplex": "auto",
"enabled": true,
"name": "GigabitEthernet0/0",
"note": [
"Connected green wire"
],
"speed": "auto"
},
{
"description": "Configured by Ansible - Interface 1",
"duplex": "auto",
"enabled": true,
"mtu": 1500,
"name": "GigabitEthernet0/1",
"note": [
"Connected blue wire",
"Configured by Paul"
],
"speed": "auto",
"vifs": [
{
"comment": "Needs reconfiguration",
"description": "Eth1 - VIF 100",
"enabled": true,
"mtu": 400,
"vlan_id": 100
},
{
"description": "Eth1 - VIF 101",
"enabled": true,
"vlan_id": 101
}
]
},
{
"description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
"enabled": false,
"mtu": 600,
"name": "GigabitEthernet0/2"
}
],
"match_key": "name",
"prefix": "interfaces"
},
{
"data": [
{
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/0"
},
{
"mode": "access",
"name": "GigabitEthernet0/1",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
]
}
},
{
"mode": "trunk",
"name": "GigabitEthernet0/2",
"trunk": {
"allowed_vlans": [
"11",
"12",
"59",
"67",
"75",
"77",
"81",
"100",
"400-408",
"411-413",
"415",
"418",
"982",
"986",
"988",
"993"
],
"encapsulation": "dot1q"
}
}
],
"match_key": "name",
"prefix": "l2_interfaces"
},
{
"data": [
{
"ipv4": [
{
"address": "192.168.0.2/24"
}
],
"name": "GigabitEthernet0/0"
},
{
"name": "GigabitEthernet0/1"
},
{
"name": "GigabitEthernet0/2"
},
{
"name": "Loopback888"
},
{
"name": "Loopback999"
}
],
"match_key": "name",
"prefix": "l3_interfaces"
}
]
},
"changed": false
}
Read vars_file 'facts.yml'
# ok: [localhost] => {
# "ansible_facts": {
# "data_source": [
# {
# "data": [
# {
# "duplex": "auto",
# "enabled": true,
# "name": "GigabitEthernet0/0",
# "note": [
# "Connected green wire"
# ],
# "speed": "auto"
# },
# {
# "description": "Configured by Ansible - Interface 1",
# "duplex": "auto",
# "enabled": true,
# "mtu": 1500,
# "name": "GigabitEthernet0/1",
# "note": [
# "Connected blue wire",
# "Configured by Paul"
# ],
# "speed": "auto",
# "vifs": [
# {
# "comment": "Needs reconfiguration",
# "description": "Eth1 - VIF 100",
# "enabled": true,
# "mtu": 400,
# "vlan_id": 100
# },
# {
# "description": "Eth1 - VIF 101",
# "enabled": true,
# "vlan_id": 101
# }
# ]
# },
# {
# "description": "Configured by Ansible - Interface 2 (ADMIN DOWN)",
# "enabled": false,
# "mtu": 600,
# "name": "GigabitEthernet0/2"
# }
# ],
# "match_key": "name",
# "prefix": "interfaces"
# },
# {
# "data": [
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "mode": "access",
# "name": "GigabitEthernet0/1",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ]
# }
# },
# {
# "mode": "trunk",
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "11",
# "12",
# "59",
# "67",
# "75",
# "77",
# "81",
# "100",
# "400-408",
# "411-413",
# "415",
# "418",
# "982",
# "986",
# "988",
# "993"
# ],
# "encapsulation": "dot1q"
# }
# }
# ],
# "match_key": "name",
# "prefix": "l2_interfaces"
# },
# {
# "data": [
# {
# "ipv4": [
# {
# "address": "192.168.0.2/24"
# }
# ],
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "name": "Loopback888"
# },
# {
# "name": "Loopback999"
# }
# ],
# "match_key": "name",
# "prefix": "l3_interfaces"
# }
# ]
# },
# "changed": false
# }
# Read vars_file 'facts.yml'
TASK [Combine all the facts based on match_keys] ****************************************************************************************************************
fatal: [localhost]: FAILED! => {
"msg": "Error when using plugin 'consolidate': 'fail_duplicate' reported Duplicate values in data source 1"
}
# TASK [Combine all the facts based on match_keys]
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_duplicate' reported Duplicate values in data source 1"
# }
"""
from ansible.errors import AnsibleFilterError

View File

@ -106,4 +106,3 @@ combined_facts:
l3_interfaces:
name: Loopback999
ospf_interfaces: {}