Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/callback_timestamp/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) 2024, kurokobo <[email protected]>
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Run tests
12 include_role:
13 name: callback
14 vars:
15 tests:
16 - name: Enable timestamp in the default length
17 environment:
18 ANSIBLE_NOCOLOR: 'true'
19 ANSIBLE_FORCE_COLOR: 'false'
20 ANSIBLE_STDOUT_CALLBACK: community.general.timestamp
21 ANSIBLE_CALLBACK_TIMESTAMP_FORMAT_STRING: "15:04:05"
22 playbook: |
23 - hosts: testhost
24 gather_facts: false
25 tasks:
26 - name: Sample task name
27 debug:
28 msg: sample debug msg
29 expected_output:
30 - ""
31 - "PLAY [testhost] ******************************************************* 15:04:05"
32 - ""
33 - "TASK [Sample task name] *********************************************** 15:04:05"
34 - "ok: [testhost] => {"
35 - " \"msg\": \"sample debug msg\""
36 - "}"
37 - ""
38 - "PLAY RECAP ************************************************************ 15:04:05"
39 - "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
40
41 - name: Enable timestamp in the longer length
42 environment:
43 ANSIBLE_NOCOLOR: 'true'
44 ANSIBLE_FORCE_COLOR: 'false'
45 ANSIBLE_STDOUT_CALLBACK: community.general.timestamp
46 ANSIBLE_CALLBACK_TIMESTAMP_FORMAT_STRING: "2006-01-02T15:04:05"
47 playbook: |
48 - hosts: testhost
49 gather_facts: false
50 tasks:
51 - name: Sample task name
52 debug:
53 msg: sample debug msg
54 expected_output:
55 - ""
56 - "PLAY [testhost] ******************************************** 2006-01-02T15:04:05"
57 - ""
58 - "TASK [Sample task name] ************************************ 2006-01-02T15:04:05"
59 - "ok: [testhost] => {"
60 - " \"msg\": \"sample debug msg\""
61 - "}"
62 - ""
63 - "PLAY RECAP ************************************************* 2006-01-02T15:04:05"
64 - "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "