[icinga-checkins] icinga.org: icinga2-ansible/fix/configure-timezone-centos: Added timezone configuration on CentOS family

git at icinga.org git at icinga.org
Thu Jun 12 14:34:14 CEST 2014


Module: icinga2-ansible
Branch: fix/configure-timezone-centos
Commit: db73f048ed745a464fcc5e9ec1215923f2cbda29
URL:    https://git.icinga.org/?p=icinga2-ansible.git;a=commit;h=db73f048ed745a464fcc5e9ec1215923f2cbda29

Author: Valentino Gagliardi <valentino.g at servermanaged.it>
Date:   Thu Jun 12 14:33:56 2014 +0200

Added timezone configuration on CentOS family

---

 tasks/icinga2_new_web_install_RedHat.yml |    4 ++++
 tasks/timezone_RedHat.yml                |   14 ++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/tasks/icinga2_new_web_install_RedHat.yml b/tasks/icinga2_new_web_install_RedHat.yml
index 818bc2e..4ebdcda 100644
--- a/tasks/icinga2_new_web_install_RedHat.yml
+++ b/tasks/icinga2_new_web_install_RedHat.yml
@@ -30,6 +30,10 @@
   notify:
    - restart icinga2
 
+- include: timezone_RedHat.yml
+  when: ansible_os_family == 'RedHat' and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6'
+        and icinga2_new_web_mysql == 'yes'
+
 - name: Configure Icinga Web Command Access on CentOS OS family
   template: src={{ item.template }}
             dest={{ item.conf }}
diff --git a/tasks/timezone_RedHat.yml b/tasks/timezone_RedHat.yml
new file mode 100644
index 0000000..f0e7b87
--- /dev/null
+++ b/tasks/timezone_RedHat.yml
@@ -0,0 +1,14 @@
+---
+- name: Set System Timezone on CentOS OS family
+  file: src=/usr/share/zoneinfo/{{ icinga2_new_web_timezone }}
+        dest={{ localtime }}
+        force=yes
+        state=link
+
+- name: Set System Timezone on CentOS OS family
+  lineinfile: dest=/etc/php.ini
+              regexp='^;date.timezone\s?='
+              line='date.timezone = "{{ icinga2_new_web_timezone }}"'
+  notify:
+   - restart apache
+   - restart mysql_server



More information about the icinga-checkins mailing list