Skip to content

Instantly share code, notes, and snippets.

@ptoal
Last active July 2, 2020 18:03
Show Gist options
  • Save ptoal/d40577dd6c2eba9bcb5f3cb7c40b5ca3 to your computer and use it in GitHub Desktop.
Save ptoal/d40577dd6c2eba9bcb5f3cb7c40b5ca3 to your computer and use it in GitHub Desktop.
- name: Map Netbox fields to linux-system-roles/network
set_fact:
network_connections: >-
{{ network_connections|default([]) + [{
'name': item.name,
'state': item.enabled |ternary('up','down'),
'persistent_state': item.enabled |ternary('present','absent'),
}] }}
loop: "{{ interfaces }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment