-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.yaml
More file actions
33 lines (26 loc) · 1.04 KB
/
Copy pathdate.yaml
File metadata and controls
33 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: DateTime Information Playbook
hosts: all
gather_facts: true
tasks:
- name: Display current date and time
ansible.builtin.debug:
msg: "Current timestamp (ISO 8601): {{ ansible_date_time.iso8601 }}"
- name: Display date in human-readable format
ansible.builtin.debug:
msg: "Date: {{ ansible_date_time.date }}"
- name: Display time in human-readable format
ansible.builtin.debug:
msg: "Time: {{ ansible_date_time.time }}"
- name: Display timezone information
ansible.builtin.debug:
msg: "Timezone: {{ ansible_date_time.tz }}"
- name: Display Unix epoch time
ansible.builtin.debug:
msg: "Unix Epoch: {{ ansible_date_time.epoch }}"
- name: Display day of week
ansible.builtin.debug:
msg: "Day of Week: {{ ansible_date_time.weekday_number }} ({{ ansible_date_time.weekday }})"
- name: Show completion message
ansible.builtin.debug:
msg: "✓ DateTime playbook completed successfully! TAKE 4"