Skip to content

Commit

Permalink
Create /etc/localtime if it doesn't exist
Browse files Browse the repository at this point in the history
/etc/localtime does not exist by default in bootc images. Since the
logrotate_crond container assumes it exists to use a volume mount, it
must be created if it doesn't exist.

Signed-off-by: James Slagle <[email protected]>
  • Loading branch information
slagle committed Jan 21, 2025
1 parent 3816fa5 commit 9ad1c45
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions roles/edpm_timezone/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@
# under the License.


# TODO(slagle): should this be in edpm-image-builder instead?
- name: Manage /etc/localtime
when: ansible_local.bootc
block:
- name: Check for /etc/localtime
stat:
path: /etc/localtime
register: localtime_stat

- name: Symlink /etc/localtime to timezone file if it doesn't exist
become: true
file:
state: link
path: /etc/localtime
src: /usr/share/zoneinfo/{{ edpm_timezone }}
when: not localtime_stat.stat.exists

- name: Set timezone
become: true
community.general.timezone:
Expand Down

0 comments on commit 9ad1c45

Please sign in to comment.