ublue-os / forge

On-prem Universal Blue
Apache License 2.0
28 stars 1 forks source link

Ansible should display log output in time zone format of the host system #30

Open tepene opened 2 months ago

tepene commented 2 months ago

Would be nice to set the timezone of the ansible container to the same value as the host system, so the output of the commands show the same time..

❯ just -f forge.just forge_clone-repository
podman exec ublue-os_forge-anvil-ansible.ublue.local ansible-playbook playbooks/project_clone.yml

PLAY [Clone project] ***********************************************************
Thursday 02 May 2024  06:14:15 +0000 (0:00:00.008)       0:00:00.008 ********** 

TASK [Gathering Facts] *********************************************************
ok: [host.ublue.local]
Thursday 02 May 2024  06:14:17 +0000 (0:00:01.734)       0:00:01.743 ********** 

TASK [Clone project] ***********************************************************
changed: [host.ublue.local]

PLAY RECAP *********************************************************************
host.ublue.local           : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Thursday 02 May 2024  06:14:19 +0000 (0:00:01.726)       0:00:03.470 ********** 
=============================================================================== 
Gathering Facts --------------------------------------------------------- 1.73s
Clone project ----------------------------------------------------------- 1.73s
tepene commented 1 month ago

I think this could be done by setting the TZ environment variable for the ansible and also for all other containers. The value can be looked up during setup with the timedatectl command. Needs some parsing though. But nothing very complicated