1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00
community.general/tests/integration/targets/callback_timestamp/tasks/main.yml
Felix Fontein eaa5e07b28
Adjust YAML files (#10233)
Adjust YAML files.
2025-06-15 09:13:16 +02:00

64 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 "