List of configuration template configurations.
The organization ID.
The state of the resource.
A template task showing all available parameters with their defaults or example values.
- name: Meraki Organization Config Templates task cisco.meraki_rm.meraki_organization_config_templates: organization_id: "organization_id_value" config: - config_template_id: "config_template_id_value" copy_from_network_id: "192.168.1.0/24" name: "example_name" product_types: - "product_types_item" time_zone: "time_zone_value" state: merged
- name: Meraki Organization Config Templates task cisco.meraki_rm.meraki_organization_config_templates: organization_id: "organization_id_value" config: # optional - config_template_id: "config_template_id_value" # optional copy_from_network_id: "192.168.1.0/24" # optional name: "example_name" # optional product_types: # optional - "product_types_item" time_zone: "time_zone_value" # optional state: merged # optional
- name: Meraki Organization Config Templates task cisco.meraki_rm.meraki_organization_config_templates: organization_id: "organization_id_value" # (str, required) The organization ID. config: # (list, optional) List of configuration template configurations. - config_template_id: "config_template_id_value" # (str, optional) Server-assigned ID, resolved automatically by matching on... copy_from_network_id: "192.168.1.0/24" # (str, optional) Network or template ID to copy configuration from. name: "example_name" # (str, optional) Name of the configuration template. product_types: # (list, optional) Product types (e.g. wireless, switch, appliance). - "product_types_item" time_zone: "time_zone_value" # (str, optional) Timezone of the configuration template. state: merged # (str, optional) The state of the resource.
name — identifies the resource in playbooks.config_template_id — server-assigned, resolved automatically from gathered state.config_template_id unless disambiguating duplicate names.- name: Define expected configuration ansible.builtin.set_fact: expected_config: name: Test-Config time_zone: example copy_from_network_id: example
- name: Create organization_config_templates with merged state cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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: Test-Config time_zone: example copy_from_network_id: example
- name: Replace organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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: Test-Config time_zone: example copy_from_network_id: example
- name: Override all organization_config_templates — desired state only cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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: name: Test-Config
- name: Delete organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization configuration templates — create or update - name: Define expected configuration ansible.builtin.set_fact: expected_config: name: Test-Config time_zone: example copy_from_network_id: example - name: Create organization_config_templates with merged state cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization configuration templates — full resource replacement - name: Define replacement configuration ansible.builtin.set_fact: expected_config: name: Test-Config time_zone: example copy_from_network_id: example - name: Replace organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization configuration templates — 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: Test-Config time_zone: example copy_from_network_id: example - name: Override all organization_config_templates — desired state only cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization configuration templates — gather current configuration - name: Gather current organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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 organization configuration templates — remove configuration - name: Define resource to delete ansible.builtin.set_fact: expected_config: name: Test-Config - name: Delete organization_config_templates configuration cisco.meraki_rm.meraki_organization_config_templates: organization_id: "123456" 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