From: Zack Cerza Date: Wed, 20 Jan 2016 17:36:56 +0000 (-0700) Subject: Set timezone for apt systems X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d73e1a80637abadb7697e0baa0831fe8318b09b3;p=ceph-cm-ansible.git Set timezone for apt systems Signed-off-by: Zack Cerza --- diff --git a/roles/common/tasks/apt_systems.yml b/roles/common/tasks/apt_systems.yml new file mode 100644 index 0000000..619be91 --- /dev/null +++ b/roles/common/tasks/apt_systems.yml @@ -0,0 +1,26 @@ +--- +- name: Get the current timezone + shell: cat /etc/timezone + register: current_tz + changed_when: false + tags: + - timezone + +- name: Set the timezone in /etc/timezone + copy: + content: "{{ timezone }}" + dest: /etc/timezone + owner: root + group: root + mode: 0644 + # Default is used below to avoid breaking check mode + when: current_tz.stdout|default("") != timezone + register: etc_timezone + tags: + - timezone + +- name: Inform the OS of the new timezone + command: dpkg-reconfigure --frontend noninteractive tzdata + when: etc_timezone|changed + tags: + - timezone diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index bfb22a9..bf065e3 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -18,6 +18,10 @@ - include: yum_systems.yml when: ansible_pkg_mgr == "yum" +# configure things specific to apt systems +- include: apt_systems.yml + when: ansible_pkg_mgr == "apt" + # configure Kerberos - include: kerberos.yml tags: