New in version 1.5.0.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| alicloud_access_key |
Aliyun Cloud access key. If not set then the value of environment variable
ALICLOUD_ACCESS_KEY, ALICLOUD_ACCESS_KEY_ID will be used instead.aliases: access_key_id, access_key |
|
| alicloud_region |
The Aliyun Cloud region to use. If not specified then the value of environment variable
ALICLOUD_REGION, ALICLOUD_REGION_ID will be used instead.aliases: region, region_id |
|
| alicloud_secret_key |
Aliyun Cloud secret key. If not set then the value of environment variable
ALICLOUD_SECRET_KEY, ALICLOUD_SECRET_ACCESS_KEY will be used instead.aliases: secret_access_key, secret_key |
|
| alicloud_security_token |
The Aliyun Cloud security token. If not specified then the value of environment variable
ALICLOUD_SECURITY_TOKEN will be used instead.aliases: security_token |
|
| description |
Description of the scheduled task, which is 2-200 characters (English or Chinese) long.
|
|
|
enabled
bool |
|
Whether to enable the scheduled task.
|
| id |
The ID of existing scheduled task.
aliases: task_id |
|
| launch_expiration |
Default: 600
|
Time period within which the failed scheduled task is retried, in second. Value range [0, 21600].
aliases: expiration |
| launch_time |
Time point at which the scheduled task is triggered.
The date format follows the ISO8601 standard and uses UTC time. It is in the format of YYYY-MM-DDThh:mmZ.
If recurrence_type, the time point specified by this attribute is the default time point at which the circle is executed. Otherwise, the task is executed once on the designated date and time.
A time point 90 days after creation or modification cannot be inputted.
Required when
state=present. |
|
| name |
Display name of the scheduled task.
It must be 2-40 characters (English or Chinese) long, and begin with a number, an upper/lower-case letter or a Chinese character and may contain numbers, "_", "-" or ".".
Default to scheduled task ID.
aliases: task_name |
|
| recurrence_endtime |
End time of the scheduled task to be repeated. The date format follows the ISO8601 standard and uses UTC time. It is in the format of YYYY-MM-DDThh:mmZ. A time point 90 days after creation or modification cannot be inputted.
recurrence_type, recurrence_value, recurrence_endtime must be specified or not at the same time.
aliases: endtime |
|
| recurrence_type |
|
Type of the scheduled task to be repeated. Optional values 'Daily', 'Weekly' and 'Monthly' to indicates recurrence interval by day, week or month for a scheduled task.
recurrence_type, recurrence_value, recurrence_endtime must be specified or not at the same time.
aliases: type |
| recurrence_value |
Value of the scheduled task to be repeated.
Daily should only supported one value in the range [1,31].
Weekly support multiple values. The values of Sunday to Saturday are 0 to 6 in sequence. Multiple values shall be separated by a comma ",".
Monthly use format A-B and the value range of A and B is 1 to 31, and the B value must be greater than the A value.
recurrence_type, recurrence_value, recurrence_endtime must be specified or not at the same time.
aliases: value |
|
| rule_id |
ID of the scaling rule of a scheduled task. Required when
state=present |
|
| state |
|
present to create a scheduled task and absent to delete it.
|
Note
ALICLOUD_ACCESS_KEY or ALICLOUD_ACCESS_KEY_ID, ALICLOUD_SECRET_KEY or ALICLOUD_SECRET_ACCESS_KEY, ALICLOUD_REGION or ALICLOUD_REGION_ID, ALICLOUD_SECURITY_TOKENALICLOUD_REGION or ALICLOUD_REGION_ID can be typically be used to specify the ALICLOUD region, when required, but this can also be configured in the footmark config file- name: basic provisioning example
hosts: localhost
vars:
alicloud_access_key: <your-alicloud-access-key-id>
alicloud_secret_key: <your-alicloud-access-secret-key>
alicloud_region: cn-beijing
rule_id: asr-2zefe4bi0jpctd6z726p
launch_time: 2018-01-09T15:00Z
launch_expiration: 300
recurrence_type: 'Daily'
recurrence_value: 10
recurrence_endtime: 2018-02-10T15:00Z
name: task-from-ansible
tasks:
- name: launch scheduled task
ali_ess_task:
alicloud_access_key: '{{ alicloud_access_key }}'
alicloud_secret_key: '{{ alicloud_secret_key }}'
alicloud_region: '{{ alicloud_region }}'
name: '{{ name }}'
rule_id: '{{ rule.id }}'
launch_time: '{{ launch_time }}'
launch_expiration: '{{ launch_expiration }}'
recurrence_type: '{{ recurrence_type }}'
recurrence_value: '{{ recurrence_value }}'
recurrence_endtime: '{{ recurrence_endtime }}'
- name: delete specified scheduled task
ali_ess_task:
alicloud_access_key: '{{ alicloud_access_key }}'
alicloud_secret_key: '{{ alicloud_secret_key }}'
alicloud_region: '{{ alicloud_region }}'
name: '{{ name }}'
state: absent
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
id
str
|
expect absent |
Scheduled Task ID.
Sample:
cItPa1ec7ii6dryMmEbBnJZP
|
|
name
str
|
expect absent |
Scheduled Task name.
Sample:
ess-task-foo
|
|
task
dict
|
expect absent |
The details of a scheduled task.
Sample:
{'recurrence_value': '10', 'recurrence_endtime': '2018-02-10T15:00Z', 'description': None, 'launch_time': '2018-01-09T15:00Z', 'enabled': True, 'id': 'cItPa1ec7ii6dryMmEbBnJZP', 'recurrence_type': 'Daily', 'launch_expiration': 300, 'rule_ari': 'ari:acs:ess:cn-beijing:1204663572767468:scalingrule/asr-2zefe4bi0jpctd6z726p', 'name': 'ess-task-foo'}
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.