Skip to content

Instantly share code, notes, and snippets.

@nleiva
Last active July 9, 2020 13:42
Show Gist options
  • Save nleiva/368ef09ace48a8ea9875ea17575b4c5c to your computer and use it in GitHub Desktop.
Save nleiva/368ef09ace48a8ea9875ea17575b4c5c to your computer and use it in GitHub Desktop.
vars:
map:
ios: "cisco"
junos: "juniper"
CentOS: "iptables"
RedHat: "iptables"
tasks:
- name: Set platform for Networking devices
set_fact:
platform: "{{ map[ansible_net_system] }}"
when: ansible_net_system is defined
- name: Set platform for Linux systems
set_fact:
platform: "{{ map[ansible_distribution] }}"
when: ansible_distribution is defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment