Skip to content

Commit

Permalink
Removing references of cred.yml from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
obrigg committed Jul 10, 2023
1 parent 79d3dd2 commit 91e8519
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 73 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ Install the collection ([Galaxy link](https://galaxy.ansible.com/cisco/meraki))
ansible-galaxy collection install cisco.meraki
```
## Use
First, define a `credentials.yml` ([example](https://github.com/cisco-en-programmability/meraki-ansible/blob/main/playbooks/credentials.template)) file where you specify your Meraki credentials as Ansible variables:
First, your Meraki API key needs to be available for the playbook to use. You can leverage environment variables `export MERAKI_DASHBOARD_API_KEY=093b24e85df15a3e66f1fc359f4c48493eaa1b73`, or create a `credentials.yml` ([example](https://github.com/cisco-en-programmability/meraki-ansible/blob/main/playbooks/credentials.template)) file.
**Note:** storing your API key in an unencrypted text file is not recommended for security reasons.
```
---
meraki_api_key: "ABC"
Expand Down Expand Up @@ -93,13 +94,11 @@ Then, create a playbook `myplaybook.yml` ([example](https://github.com/cisco-en-
```
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all administered _identities _me
cisco.meraki.administered_identities_me_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
register: result
```
Expand Down
9 changes: 6 additions & 3 deletions playbooks/administered_identities_me_info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all administered _identities _me
cisco.meraki.administered_identities_me_info:
meraki_api_key: "{{meraki_api_key}}"
# meraki_api_key: "{{meraki_api_key}}"
# meraki_username: "{{meraki_username}}"
# meraki_password: "{{meraki_password}}"
# meraki_verify: "{{meraki_verify}}"
Expand All @@ -22,4 +20,9 @@
# organizationId: "575334852396583071"
# api:
# enabled: false
meraki_suppress_logging: true
register: result

- name: Show result
ansible.builtin.debug:
msg: "{{ result }}"
6 changes: 2 additions & 4 deletions playbooks/device_blink_leds.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.devices_blink_leds:
meraki_api_key: "{{meraki_api_key}}"
# meraki_base_url: "{{meraki_base_url}}"
# meraki_single_request_timeout: "{{meraki_single_request_timeout}}"
# meraki_certificate_path: "{{meraki_certificate_path}}"
Expand All @@ -27,7 +24,8 @@
# meraki_caller: "{{meraki_caller}}"
# meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}"
# meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}"
meraki_suppress_logging: true
duration: 20
duty: 50
period: 160
serial: QBSB-AX45-LY9A
serial: "QBSB-AX45-LY9A"
4 changes: 1 addition & 3 deletions playbooks/devices.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Update by id
cisco.meraki.devices:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
lat: "37.4180951010364"
lng: "-122.098531723021"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/devices_info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get Device
cisco.meraki.devices_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
organizationId: "828099381482762270"
# serial: QBSD-36C3-473D
# tags: ["recently-added"]
Expand Down
4 changes: 1 addition & 3 deletions playbooks/devices_live_tools_ping.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.devices_live_tools_ping:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
# meraki_base_url: "{{meraki_base_url}}"
# meraki_single_request_timeout: "{{meraki_single_request_timeout}}"
# meraki_certificate_path: "{{meraki_certificate_path}}"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/devices_switch_routing_interfaces.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.devices_switch_routing_interfaces:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
defaultGateway: 192.168.1.1
interfaceIp: 192.168.1.2
Expand Down
4 changes: 1 addition & 3 deletions playbooks/networks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
# - name: Get all networks
Expand All @@ -17,7 +15,7 @@
# register: result
- name: Create
cisco.meraki.networks:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
# copyFromNetworkId: N_24329156
name: Site 1
Expand Down
4 changes: 1 addition & 3 deletions playbooks/networks_appliance_vlans.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.networks_appliance_vlans:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
applianceIp: 192.168.1.2
cidr: 192.168.1.0/24
Expand Down
4 changes: 1 addition & 3 deletions playbooks/networks_wireless_ssids_identityPsks.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.networks_wireless_ssids_identity_psks:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
expiresAt: '2018-02-11T00:00:00.090210Z'
groupPolicyId: '101'
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organization.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
# meraki_username: "{{meraki_username}}"
# meraki_password: "{{meraki_password}}"
# meraki_verify: "{{meraki_verify}}"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organization_info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all Organizations
cisco.meraki.organizations_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
# meraki_username: "{{meraki_username}}"
# meraki_password: "{{meraki_password}}"
# meraki_verify: "{{meraki_verify}}"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organizations_adaptivePolicy_acls.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_adaptive_policy_acls:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
description: Blocks sensitive web traffic 2
ipVersion: ipv6
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organizations_adaptive_policy_groups.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_adaptive_policy_groups:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
# description: Group of XYZ Corp Employees
# isDefaultGroup: false
Expand Down
9 changes: 4 additions & 5 deletions playbooks/organizations_admin.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_admins:
meraki_api_key: "{{meraki_api_key}}"
state: present
meraki_suppress_logging: true
meraki_caller: "test 123"
state: absent
name: DevNet Admin 3455
email: devnetmerakiadmin23@cisco.com
email: devnetmerakiadmin23@yopmail.com
authenticationMethod: Email
orgAccess: full
networks: []
Expand Down
10 changes: 6 additions & 4 deletions playbooks/organizations_admin_info.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all Organizations Admins
cisco.meraki.organizations_admins_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
organizationId: "828099381482762270"
register: result
register: result

- name: Show result
ansible.builtin.debug:
msg: "{{ result }}"
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_camera_custom_analytics_artifacts:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
name: Test Ansible 2
organizationId: "828099381482762270"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organizations_clients_search_info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all organizations _clients _search
cisco.meraki.organizations_clients_search_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
mac: "4c:c8:a1:01:01:c2"
perPage: 3
total_pages: -1
Expand Down
8 changes: 3 additions & 5 deletions playbooks/organizations_config_templates.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_config_templates:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
name: "My config template"
organizationId: "828099381482762270"
timeZone: "America/Los_Angeles"

# - name: Update by id
# cisco.meraki.organizations_config_templates:
# meraki_api_key: "{{meraki_api_key}}"
# meraki_suppress_logging: true
# state: present
# configTemplateId: string
# name: My config template
Expand All @@ -23,7 +21,7 @@

# - name: Delete by id
# cisco.meraki.organizations_config_templates:
# meraki_api_key: "{{meraki_api_key}}"
# meraki_suppress_logging: true
# meraki_caller: "{{meraki_caller}}"
# meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}"
# meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}"
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organizations_config_templates_info.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all organizations _configtemplates
cisco.meraki.organizations_config_templates_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
organizationId: "828099381482762270"
register: result
4 changes: 1 addition & 3 deletions playbooks/organizations_devices_info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Get all organizations _devices
cisco.meraki.organizations_devices_info:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
perPage: 3
total_pages: -1
# startingAfter: string
Expand Down
4 changes: 1 addition & 3 deletions playbooks/organizations_saml_idps.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
- hosts: meraki_servers
vars_files:
- credentials.yml
gather_facts: false
tasks:
- name: Create
cisco.meraki.organizations_saml_idps:
meraki_api_key: "{{meraki_api_key}}"
meraki_suppress_logging: true
state: present
organizationId: "828099381482762270"
sloLogoutUrl: https://somewhere.com
Expand Down
18 changes: 18 additions & 0 deletions playbooks/wifi_deploy_one.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

- hosts: meraki_servers
vars:
org_id: "828099381482762270"
corp_name: "ACME"
network_id: "L_828099381482770865"
gather_facts: false
tasks:

- name: Create corporate SSID
cisco.meraki.networks_wireless_ssids:
meraki_suppress_logging: true
state: present
enabled: true
name: "{{corp_name}}"
networkId: "{{ network_id }}"
number: "1"

0 comments on commit 91e8519

Please sign in to comment.