From 64f35c890ca7dce1a6948c733ceadab3ca4734e1 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 20 Jan 2016 15:19:29 -0700 Subject: [PATCH] Handle timedatectl output format change timedatectl in 7.2 helpfully changes 'Timezone' to 'Time zone'. Use a regexp to handle both formats. Signed-off-by: Zack Cerza --- roles/common/tasks/yum_systems.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/common/tasks/yum_systems.yml b/roles/common/tasks/yum_systems.yml index 3b67438..0c647c3 100644 --- a/roles/common/tasks/yum_systems.yml +++ b/roles/common/tasks/yum_systems.yml @@ -8,7 +8,7 @@ - timezone - name: Get the current timezone (RHEL/CentOS 7) - shell: 'timedatectl | grep Timezone | sed -e "s/.*: \(.*\) (.*/\1/"' + shell: 'timedatectl | grep -E "Time ?zone" | sed -e "s/.*: \(.*\) (.*/\1/"' when: ansible_distribution_major_version == "7" register: current_tz changed_when: false -- 2.39.5