]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Handle timedatectl output format change 191/head
authorZack Cerza <zack@redhat.com>
Wed, 20 Jan 2016 22:19:29 +0000 (15:19 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 20 Jan 2016 22:19:29 +0000 (15:19 -0700)
timedatectl in 7.2 helpfully changes 'Timezone' to 'Time zone'. Use a
regexp to handle both formats.

Signed-off-by: Zack Cerza <zack@redhat.com>
roles/common/tasks/yum_systems.yml

index 3b6743844907206994c3290f2f4cbfd074b63ad1..0c647c3fb2c851c57caa12abaae763bdd032da8c 100644 (file)
@@ -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