Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1495893
[minor_change] Add missing test cases for existing modules.
gmicol Jun 30, 2023
57d7c9b
[ignore] Add test case for aci_l3out_route_tag_policy.
gmicol Jun 30, 2023
767d933
[ignore] Add test cases for aci firmware policy/group/node and aci ma…
gmicol Jul 18, 2023
512a71d
[ignore] Add test cases for aci_interface_policy_fc and aci_interface…
gmicol Jul 18, 2023
beb561f
[ignore] Add test cases for interface policies lldp, mcp and port cha…
gmicol Jul 18, 2023
44d7d07
[ignore] Modify fabricNodeBlk class object for aci_maintenance_group_…
gmicol Jul 18, 2023
aae0a86
[ignore] Add test cases for aci_tenant_action_rule and aci_tenant_ep_…
gmicol Jul 19, 2023
fe80444
[ignore] Modify modules that were missing test cases.
gmicol Jul 20, 2023
faabf35
[ignore] Modify Python modules to check black and sanity tests.
gmicol Jul 20, 2023
d28e08b
[ignore] small changes
gmicol Jul 20, 2023
80d1e9a
[ignore] Modify documentations for aci_firmware and aci_maintenance m…
gmicol Jul 20, 2023
1155caa
Revert "[ignore] Modify documentations for aci_firmware and aci_maint…
gmicol Jul 20, 2023
f954a6e
[ignore] Modify Documentation for aci_fabric_scheduler to check sanit…
gmicol Jul 20, 2023
40217b6
[ignore] Add missing atttributes for aci_maintenance_policy and aci_f…
gmicol Jul 21, 2023
bc329b1
[ignore] Rebase 1.
gmicol Jul 27, 2023
bb28a87
[ignore] Rebase 2.
gmicol Jul 27, 2023
9ead5a7
[ignore] Modify python files for asserting sanity and formating checks.
gmicol Jul 27, 2023
183c17f
[ignore] Modify documentation for aci_interface_policy_fc.
gmicol Jul 27, 2023
6739017
[ignore] Modify names of tasks for test files.
gmicol Jul 28, 2023
8b5cc17
[ignore] Modify Documentations and module for aci_interface_policy_mcp.
gmicol Aug 1, 2023
e218500
[ignore] Modify Documentations for certain modules.
gmicol Aug 1, 2023
7f5f48c
[ignore] Modify formating for aci_interface_policy_mcp.
gmicol Aug 1, 2023
4a99c2b
Revert "[ignore] Modify formating for aci_interface_policy_mcp."
gmicol Aug 3, 2023
ce449ef
[ignore] Modify aci firmware group node, firmware policy and maintena…
gmicol Aug 3, 2023
d642df8
[ignore] Apply black and format the previous modified files.
gmicol Aug 3, 2023
160e112
[ignore] Modify type attribute for aci maintenance group and firmware…
gmicol Aug 3, 2023
1a6cd2d
[ignore] Modify aci_interface_policy_fc, aci_firmware_policy and aci_…
gmicol Aug 8, 2023
77ed551
[ignore] Apply Black for formating - after adding constants.
gmicol Aug 8, 2023
8e1734d
[ignore] Add aliases for attribute input ignore_compat in maintenance…
gmicol Aug 9, 2023
319641c
[ignore] modify run_mode attributes for aci_maintenance_policy.py
gmicol Aug 16, 2023
ad05c91
[ignore] Modify run_mode choices to check sanity test in aci_maintena…
gmicol Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions plugins/module_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,45 @@
redhat="Redhat",
vmware="VMware",
)

MATCH_TYPE_GROUP_MAPPING = {"all": "ALL", "all_in_pod": "ALL_IN_POD", "range": "range"}

MATCH_FC_FILL_PATTERN_MAPPING = {"arbff": "ARBFF", "idle": "IDLE"}

MATCH_FIRMWARE_NODES_TYPE_MAPPING = {
"c_apic_patch": "cApicPatch",
"catalog": "catalog",
"config": "config",
"controller": "controller",
"controller_patch": "controllerPatch",
"plugin": "plugin",
"plugin_package": "pluginPackage",
"switch": "switch",
"switch_patch": "switchPatch",
"vpod": "vpod",
}

MATCH_TRIGGER_MAPPING = {
"trigger": "trigger",
"trigger_immediate": "trigger-immediate",
"triggered": "triggered",
"untriggered": "untriggered",
}

INTERFACE_POLICY_FC_SPEED_LIST = ["auto", "unknown", "2G", "4G", "8G", "16G", "32G"]

MATCH_RUN_MODE_MAPPING = dict(
pause_always_between_sets="pauseAlwaysBetweenSets",
pause_only_on_failures="pauseOnlyOnFailures",
pause_never="pauseNever",
)

MATCH_NOTIFY_CONDITION_MAPPING = dict(
notify_always_between_sets="notifyAlwaysBetweenSets",
notify_never="notifyNever",
notify_only_on_failures="notifyOnlyOnFailures",
)

MATCH_SMU_OPERATION_MAPPING = dict(smu_install="smuInstall", smu_uninstall="smuUninstall")

MATCH_SMU_OPERATION_FLAGS_MAPPING = dict(smu_reload_immediate="smuReloadImmediate", smu_reload_skip="smuReloadSkip")
139 changes: 74 additions & 65 deletions plugins/modules/aci_fabric_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@

ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "supported_by": "community"}

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: aci_fabric_scheduler

short_description: This modules creates ACI schedulers.


short_description: This module creates ACI schedulers (trig:SchedP)
description:
- With the module you can create schedule policies that can be a shell, onetime execution or recurring

- With the module you can create schedule policies that can be a shell, one-time execution or recurring.
options:
name:
description:
Expand All @@ -32,44 +28,44 @@
aliases: [ descr ]
recurring:
description:
- If you want to make the Scheduler a recurring it would be a "True" and for a
oneTime execution it would be "False". For a shell just exclude this option from
the task
- If you want to make the scheduler a recurring operation, it should be set C(True) and for a one-time execution it should be C(False).
- For a shell, just exclude this option from the task.
type: bool
windowname:
description:
- This is the name for your what recurring or oneTime execution
- The name of the schedule window.
- This is mandatory for the child class object B(trig:AbsWinddowP)
type: str
concurCap:
description:
- This is the amount of devices that can be executed on at a time
- The amount of devices that can be executed on at a time.
type: int
maxTime:
description:
- This is the amount MAX amount of time a process can be executed
- The maximum amount of time a process can be executed.
type: str
date:
description:
- This is the date and time that the scheduler will execute
- The date and time that the scheduler will execute.
type: str
hour:
description:
- This set the hour of execution
- The number of hours of execution.
type: int
minute:
description:
- This sets the minute of execution, used in conjunction with hour
- The number of minutes of execution, used in conjunction with hour.
type: int
day:
description:
- This sets the day when execution will take place
- The number of days when execution will take place.
type: str
default: "every-day"
choices: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday', 'even-day', 'odd-day', 'every-day']
default: every-day
choices: [ Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, even-day, odd-day, every-day ]
state:
description:
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
type: str
default: present
choices: [ absent, present, query ]
Expand All @@ -82,56 +78,63 @@
- cisco.aci.annotation
- cisco.aci.owner

seealso:
- name: APIC Management Information Model reference
description: More information about the internal APIC class B(trig:SchedP).
link: https://developer.cisco.com/docs/apic-mim-ref/
author:
- Steven Gerhart (@sgerhart)
- Steven Gerhart (@sgerhart)
"""

EXAMPLES = r"""
- name: Simple Scheduler (Empty)
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: simpleScheduler
state: present
- name: Remove Simple Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: simpleScheduler
state: absent
- name: One Time Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: OneTime
windowname: OneTime
recurring: False
concurCap: 20
date: "2018-11-20T24:00:00"
state: present
- name: Recurring Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: Recurring
windowname: Recurring
recurring: True
concurCap: 20
hour: 13
minute: 30
day: Tuesday
state: present
- name: Simple Scheduler (Empty)
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: simpleScheduler
state: present

- name: Remove Simple Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: simpleScheduler
state: absent

- name: One Time Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: OneTime
windowname: OneTime
recurring: False
concurCap: 20
date: "2018-11-20T24:00:00"
state: present

- name: Recurring Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: false
name: Recurring
windowname: Recurring
recurring: True
concurCap: 20
hour: 13
minute: 30
day: Tuesday
state: present
"""

RETURN = """
RETURN = r"""
current:
description: The existing configuration from the APIC after the module has finished
returned: success
Expand Down Expand Up @@ -285,6 +288,11 @@ def main():
description = module.params.get("description")
name_alias = module.params.get("name_alias")

child_classes = [
"trigRecurrWindowP",
"trigAbsWindowP",
]

if recurring:
child_configs = [
dict(
Expand Down Expand Up @@ -324,6 +332,7 @@ def main():
target_filter={"name": name},
module_object=name,
),
child_classes=child_classes,
)

aci.get_existing()
Expand Down
Loading