List of Meraki auth user configurations.
The network ID.
The state of the resource.
A template task showing all available parameters with their defaults or example values.
- name: Meraki Auth Users task cisco.meraki_rm.meraki_auth_users: network_id: "192.168.1.0/24" config: - account_type: "account_type_value" authorizations: - {} email: "email_value" email_password_to_user: true is_admin: true meraki_auth_user_id: "admin" name: "example_name" password: "{{ vault_password }}" state: merged
- name: Meraki Auth Users task cisco.meraki_rm.meraki_auth_users: network_id: "192.168.1.0/24" config: # optional - account_type: "account_type_value" # optional authorizations: # optional - {} email: "email_value" # optional email_password_to_user: true # optional is_admin: true # optional meraki_auth_user_id: "admin" # optional name: "example_name" # optional password: "{{ vault_password }}" # optional state: merged # optional
- name: Meraki Auth Users task cisco.meraki_rm.meraki_auth_users: network_id: "192.168.1.0/24" # (str, required) The network ID. config: # (list, optional) List of Meraki auth user configurations. - account_type: "account_type_value" # (str, optional) Authorization type for user. authorizations: # (list, optional) User authorization info. - {} email: "email_value" # (str, optional) Email address of the user. email_password_to_user: true # (bool, optional) Whether Meraki should email the password to user. is_admin: true # (bool, optional) Whether the user is a Dashboard administrator. meraki_auth_user_id: "admin" # (str, optional) Server-assigned ID, resolved automatically by matching on... name: "example_name" # (str, optional) Name of the user. password: "{{ vault_password }}" # (str, optional) Password for the user account. state: merged # (str, optional) The state of the resource.
email — identifies the auth user in playbooks.meraki_auth_user_id — server-assigned, resolved automatically from gathered state.meraki_auth_user_id unless disambiguating duplicate emails.- name: Define expected configuration ansible.builtin.set_fact: expected_config: name: Test-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true
- name: Create auth_users with merged state cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: merged config: - "{{ expected_config }}" register: merge_result
- name: Assert resource was created ansible.builtin.assert: that: - merge_result is changed - merge_result.config | length == 1
- name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ merge_result.config[0] | ansible.utils.to_paths }}"
- name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}"
- name: Define replacement configuration ansible.builtin.set_fact: expected_config: name: Replaced-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true
- name: Replace auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: replaced config: - "{{ expected_config }}" register: replace_result
- name: Assert resource was replaced ansible.builtin.assert: that: - replace_result is changed - replace_result.config | length == 1
- name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ replace_result.config[0] | ansible.utils.to_paths }}"
- name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}"
- name: Define desired-state configuration ansible.builtin.set_fact: expected_config: name: Replaced-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true
- name: Override all auth_users — desired state only cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: overridden config: - "{{ expected_config }}" register: override_result
- name: Assert resources were overridden ansible.builtin.assert: that: - override_result is changed - override_result.config | length == 1
- name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ override_result.config[0] | ansible.utils.to_paths }}"
- name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}"
- name: Gather current auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: gathered register: gathered
- name: Assert gathered config is not empty ansible.builtin.assert: that: - gathered.config is defined - gathered.config | length > 0 fail_msg: "Gathered config is empty — expected at least one resource"
- name: Display gathered configuration ansible.builtin.debug: var: gathered.config
- name: Define resource to delete ansible.builtin.set_fact: expected_config: email: "admin@example.com"
- name: Delete auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: deleted config: - "{{ expected_config }}" register: delete_result
- name: Assert resource was deleted ansible.builtin.assert: that: - delete_result is changed - delete_result is not failed
--- # Manage Meraki dashboard authentication users — create or update - name: Define expected configuration ansible.builtin.set_fact: expected_config: name: Test-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true - name: Create auth_users with merged state cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: merged config: - "{{ expected_config }}" register: merge_result - name: Assert resource was created ansible.builtin.assert: that: - merge_result is changed - merge_result.config | length == 1 - name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ merge_result.config[0] | ansible.utils.to_paths }}" - name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}" # Manage Meraki dashboard authentication users — full resource replacement - name: Define replacement configuration ansible.builtin.set_fact: expected_config: name: Replaced-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true - name: Replace auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: replaced config: - "{{ expected_config }}" register: replace_result - name: Assert resource was replaced ansible.builtin.assert: that: - replace_result is changed - replace_result.config | length == 1 - name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ replace_result.config[0] | ansible.utils.to_paths }}" - name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}" # Manage Meraki dashboard authentication users — override all instances # Ensures ONLY these resources exist; any not listed are deleted. - name: Define desired-state configuration ansible.builtin.set_fact: expected_config: name: Replaced-Config email: "admin@example.com" password: example account_type: example is_admin: true email_password_to_user: true - name: Override all auth_users — desired state only cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: overridden config: - "{{ expected_config }}" register: override_result - name: Assert resources were overridden ansible.builtin.assert: that: - override_result is changed - override_result.config | length == 1 - name: Compare expected paths to result (subset check) ansible.builtin.set_fact: path_check: "{{ expected_paths | cisco.meraki_rm.path_contained_in(result_paths) }}" vars: expected_paths: "{{ expected_config | ansible.utils.to_paths }}" result_paths: "{{ override_result.config[0] | ansible.utils.to_paths }}" - name: Assert all expected fields are present and match ansible.builtin.assert: that: path_check.contained | bool success_msg: "{{ success_msg }}" fail_msg: "{{ fail_msg }}" vars: success_msg: "All expected fields match. Extras: {{ path_check.extras }}" fail_msg: "Missing or mismatch: {{ path_check.missing }}. Extras: {{ path_check.extras }}" # Manage Meraki dashboard authentication users — gather current configuration - name: Gather current auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: gathered register: gathered - name: Assert gathered config is not empty ansible.builtin.assert: that: - gathered.config is defined - gathered.config | length > 0 fail_msg: "Gathered config is empty — expected at least one resource" - name: Display gathered configuration ansible.builtin.debug: var: gathered.config # Manage Meraki dashboard authentication users — remove configuration - name: Define resource to delete ansible.builtin.set_fact: expected_config: email: "admin@example.com" - name: Delete auth_users configuration cisco.meraki_rm.meraki_auth_users: network_id: "N_123456789012345678" state: deleted config: - "{{ expected_config }}" register: delete_result - name: Assert resource was deleted ansible.builtin.assert: that: - delete_result is changed - delete_result is not failed