lowlydba.sqlserver.agent_job_schedule module – Configures a SQL Agent job schedule
Note
This module is part of the lowlydba.sqlserver collection (version 2.3.4).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install lowlydba.sqlserver
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: lowlydba.sqlserver.agent_job_schedule
.
New in lowlydba.sqlserver 0.1.0
Synopsis
Configures settings for an agent schedule that can be applied to one or more agent jobs.
Requirements
The below requirements are needed on the host that executes this module.
dbatools PowerShell module
Parameters
Parameter |
Comments |
---|---|
Whether the schedule is enabled or disabled. Choices:
|
|
The date on which execution of a job can stop. If force=true the end date will be Format is |
|
The time on any day to end execution of a job. Format If (force=true) the start time will be |
|
The force option will ignore some errors in the options and assume defaults. It will also remove the any present schedules with the same name for the specific job. Choices:
|
|
The days that a job is executed. Allowed values for frequency_type=Daily - Allowed values for frequency_type=Weekly - Allowed values for frequency_type=Monthly - Numbers If If force=true the default will be |
|
The number of weeks or months between the scheduled execution of a job. Required if frequency_type=Weekly, frequency_type=Monthly or frequency_type=MonthlyRelative. |
|
A job’s occurrence of frequency_interval in each month. If frequency_interval=32 ( Choices:
|
|
The number of subday type periods to occur between each execution of a job. |
|
Specifies the units for the subday frequency_interval. Choices:
|
|
A value indicating when a job is to be executed. If force=true the default will be Choices:
|
|
The name of the job that has the schedule. Schedules and jobs can also be associated via lowlydba.sqlserver.agent_job. See https://docs.dbatools.io/New-DbaAgentSchedule for more detailed usage. |
|
The name of the schedule. |
|
The SQL Server instance to modify. |
|
Password for SQL Authentication. |
|
Username for SQL Authentication. |
|
The date on which execution of a job can begin. If force=true the start date will be the current day. Format is |
|
The time on any day to begin execution of a job. Format If force=true the start time will be |
|
Whether or not the object should be Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in check_mode and return changed status prediction without modifying target. |
|
Platforms: all |
Target OS/families that can be operated against. |
Examples
- name: Create a job schedule
lowlydba.sqlserver.agent_job_schedule:
sql_instance: sql-01.myco.io
schedule: DailySchedule
force: true
enabled: true
start_date: 2020-05-25 # May 25, 2020
end_date: 2099-05-25 # May 25, 2099
start_time: 010500 # 01:05:00 AM
end_time: 140030 # 02:00:30 PM
state: present
- name: Create a job with schedule
lowlydba.sqlserver.agent_job:
sql_instance: sql-01.myco.io
job: MyJob
force: true
schedule: DailySchedule
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Output from the Returned: success, but not in check_mode. |