Files
infra-meraki/config.yaml
Luke Tainton 96cf3d48fa
Some checks failed
Deploy / deploy (push) Failing after 33s
Fix quoting
2026-02-22 21:10:15 +00:00

91 lines
2.4 KiB
YAML

---
- hosts: localhost
gather_facts: false
vars:
nid: L_671599294431642401 # TaintonNet
vlans:
- id: 1
name: Default
dhcp: false
- id: 5
name: Native
dhcp: false
- id: 6
name: CiscoEquip
dhcp: true
- id: 10
name: Infra
dhcp: true
- id: 25
name: Trusted Clients
dhcp: true
- id: 35
name: IoT
dhcp: true
- id: 40
name: DMZ
dhcp: true
tasks:
- name: Get Me
cisco.meraki.administered_identities_me_info:
meraki_suppress_logging: true
register: me
- name: Show current Meraki administrator
ansible.builtin.debug:
msg: "{{ me.meraki_response.name }} - {{me.meraki_response.email}}"
- name: Get all Organizations
cisco.meraki.organizations_info:
meraki_suppress_logging: true
register: organizations
- name: Show Organizations List
ansible.builtin.debug:
msg: "{{ organizations | json_query('meraki_response[*].name') }}"
- name: Enable Vlans on the MX
cisco.meraki.networks_appliance_vlans_settings:
state: present
networkId: "{{ nid }}"
vlansEnabled: true
- name: Show VLANs
ansible.builtin.debug:
msg: "{{ vlans }}"
- name: Create VLANs on MX
cisco.meraki.networks_appliance_vlans:
state: present
applianceIp: "192.168.{{ item.id }}.1"
# cidr: "192.168.{{ item.id }}.0/24"
id: "{{ item.id }}"
vlanId: "{{ item.id }}"
name: "{{ item.name }}"
networkId: "{{ nid }}"
subnet: "192.168.{{ item.id }}.0/24"
loop: vlans
- name: Enable DHCP on Relevant VLANs
cisco.meraki.networks_appliance_vlans:
state: present
id: "{{ item.id }}"
vlanId: "{{ item.id }}"
dhcpHandling: "Run a DHCP server"
dhcpLeaseTime: "1 day"
dnsNameservers: |
9.9.9.9
149.112.112.112
loop: vlans
when: item.dhcp
- name: Disable DHCP on Relevant VLANs
cisco.meraki.networks_appliance_vlans:
state: present
id: "{{ item.id }}"
vlanId: "{{ item.id }}"
dhcpHandling: "Do not respond to DHCP requests"
loop: vlans
when: not item.dhcp