mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Adding field change to readme and example and test of custom messages
This commit is contained in:
committed by
beeankha
parent
649aafb454
commit
eb4db4ed43
@@ -51,6 +51,7 @@ The following notes are changes that may require changes to playbooks:
|
|||||||
- Specified `tower_config` file used to handle `k=v` pairs on a single line; this is no longer supported. Please use a file formatted as `yaml`, `json` or `ini` only.
|
- Specified `tower_config` file used to handle `k=v` pairs on a single line; this is no longer supported. Please use a file formatted as `yaml`, `json` or `ini` only.
|
||||||
- Some return values (e.g., `credential_type`) have been removed. Use of `id` is recommended.
|
- Some return values (e.g., `credential_type`) have been removed. Use of `id` is recommended.
|
||||||
- `tower_job_template` no longer supports the deprecated `extra_vars_path` parameter, please use `extra_vars` with the lookup plugin to replace this functionality.
|
- `tower_job_template` no longer supports the deprecated `extra_vars_path` parameter, please use `extra_vars` with the lookup plugin to replace this functionality.
|
||||||
|
- `notification_configration` parameter of `tower_notification` has changed from a string to a dict. Please use the `lookup` plugin to read an existing file into a dict.
|
||||||
|
|
||||||
## Running Unit Tests
|
## Running Unit Tests
|
||||||
|
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ EXAMPLES = '''
|
|||||||
- name: Add Slack notification
|
- name: Add Slack notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: slack notification
|
name: slack notification
|
||||||
|
organization: Default
|
||||||
notification_type: slack
|
notification_type: slack
|
||||||
channels:
|
channels:
|
||||||
- general
|
- general
|
||||||
@@ -236,6 +237,20 @@ EXAMPLES = '''
|
|||||||
state: present
|
state: present
|
||||||
tower_config_file: "~/tower_cli.cfg"
|
tower_config_file: "~/tower_cli.cfg"
|
||||||
|
|
||||||
|
- name: Add custom messages to our notification
|
||||||
|
tower_notification:
|
||||||
|
name: slack notification
|
||||||
|
notification_type: slack
|
||||||
|
organization: Default
|
||||||
|
messages:
|
||||||
|
started:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{' }}' }} {{ '{{' }} job.id {{' }}' }} started"
|
||||||
|
success:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{ '}}' }} completed in {{ '{{' }} job.elapsed {{ '}}' }} seconds"
|
||||||
|
error:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{ '}}' }} FAILED! Please look at {{ '{{' }} job.url {{ '}}' }}"
|
||||||
|
tower_config_file: "~/tower_cli.cfg"
|
||||||
|
|
||||||
- name: Add webhook notification
|
- name: Add webhook notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: webhook notification
|
name: webhook notification
|
||||||
@@ -319,6 +334,7 @@ EXAMPLES = '''
|
|||||||
notification_type: email
|
notification_type: email
|
||||||
state: absent
|
state: absent
|
||||||
tower_config_file: "~/tower_cli.cfg"
|
tower_config_file: "~/tower_cli.cfg"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
# The 27 can be count from the size of the OLD_INPUT_NAMES list in the module
|
# The 27 can be count from the size of the OLD_INPUT_NAMES list in the module
|
||||||
- result['deprecations'] | length() == 27
|
- result['deprecations'] | length() == 27
|
||||||
|
|
||||||
- name: Create Slack notification
|
- name: Create Slack notification with custom messages
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: "{{ slack_not }}"
|
name: "{{ slack_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
@@ -74,6 +74,13 @@
|
|||||||
token: a_token
|
token: a_token
|
||||||
channels:
|
channels:
|
||||||
- general
|
- general
|
||||||
|
messages:
|
||||||
|
started:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{' }}' }} {{ '{{' }} job.id {{' }}' }} started"
|
||||||
|
success:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{ '}}' }} completed in {{ '{{' }} job.elapsed {{ '}}' }} seconds"
|
||||||
|
error:
|
||||||
|
message: "{{ '{{' }} job_friendly_name {{ '}}' }} FAILED! Please look at {{ '{{' }} job.url {{ '}}' }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user