1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/callback_timestamp/tasks/main.yml
kurokobo bb73f28bf5
feat: implement timestamp callback plugin to show simple timestamp for each header (#8308)
* feat: add community.general.timestamp callback plugin

* feat: add minimal integration tests for timestamp callback plugin

* feat: add maintainers for timestamp callback plugin

* fix: correct license

* fix: remove type annotation for the older python environment

* fix: remove unnecessary comment

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: add trailing period

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: split long description into list

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: remove default and add type

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix; add type

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: split long description into list

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: improve description for format_string to describe usable format codes

* fix: clarify the original codes and add copyright from that

* fix: shorten long lines

* fix: correct link format

* fix: add seealso section

* fix: add ignore entries for EOL CI

* fix: update seealso to correctly associate with related plugin

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-18 15:41:34 +02:00

66 lines
2.6 KiB
YAML

---
####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
# Copyright (c) 2024, kurokobo <kurokobo@protonmail.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Run tests
include_role:
name: callback
vars:
tests:
- name: Enable timestamp in the default length
environment:
ANSIBLE_NOCOLOR: 'true'
ANSIBLE_FORCE_COLOR: 'false'
ANSIBLE_STDOUT_CALLBACK: community.general.timestamp
ANSIBLE_CALLBACK_TIMESTAMP_FORMAT_STRING: "15:04:05"
playbook: |
- hosts: testhost
gather_facts: false
tasks:
- name: Sample task name
debug:
msg: sample debug msg
expected_output: [
"",
"PLAY [testhost] ******************************************************* 15:04:05",
"",
"TASK [Sample task name] *********************************************** 15:04:05",
"ok: [testhost] => {",
" \"msg\": \"sample debug msg\"",
"}",
"",
"PLAY RECAP ************************************************************ 15:04:05",
"testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
]
- name: Enable timestamp in the longer length
environment:
ANSIBLE_NOCOLOR: 'true'
ANSIBLE_FORCE_COLOR: 'false'
ANSIBLE_STDOUT_CALLBACK: community.general.timestamp
ANSIBLE_CALLBACK_TIMESTAMP_FORMAT_STRING: "2006-01-02T15:04:05"
playbook: |
- hosts: testhost
gather_facts: false
tasks:
- name: Sample task name
debug:
msg: sample debug msg
expected_output: [
"",
"PLAY [testhost] ******************************************** 2006-01-02T15:04:05",
"",
"TASK [Sample task name] ************************************ 2006-01-02T15:04:05",
"ok: [testhost] => {",
" \"msg\": \"sample debug msg\"",
"}",
"",
"PLAY RECAP ************************************************* 2006-01-02T15:04:05",
"testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
]