diff --git a/modules.env b/modules.env index 637022c56f..97bfd0ea8e 100644 --- a/modules.env +++ b/modules.env @@ -64,7 +64,6 @@ SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-rabbitmq"]="5.2.3" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-stdlib"]="4.17.0" SOURCE_MODULES["https://github.com/rafaelfelix/puppet-pear"]="1.0.3" SOURCE_MODULES["https://github.com/saz/puppet-memcached"]="v2.6.0" -SOURCE_MODULES["https://github.com/saz/puppet-timezone"]="v3.3.0" SOURCE_MODULES["https://github.com/stankevich/puppet-python"]="1.9.4" SOURCE_MODULES["https://github.com/theforeman/puppet-dns"]="4.1.0" SOURCE_MODULES["https://github.com/vamsee/puppet-solr"]="0.0.8" diff --git a/modules/openstack_project/manifests/server.pp b/modules/openstack_project/manifests/server.pp index 0e6066199d..1cff766ce7 100644 --- a/modules/openstack_project/manifests/server.pp +++ b/modules/openstack_project/manifests/server.pp @@ -10,10 +10,6 @@ class openstack_project::server ( $pypi_index_url = 'https://pypi.python.org/simple', ) { - class { 'timezone': - timezone => 'Etc/UTC', - } - # Include ::apt while we work on the puppet->ansible transition if ($::osfamily == 'Debian') { include ::apt diff --git a/playbooks/base.yaml b/playbooks/base.yaml index 9b18ee9954..dba4d2ffcb 100644 --- a/playbooks/base.yaml +++ b/playbooks/base.yaml @@ -8,6 +8,7 @@ - hosts: "!disabled" roles: - base-server + - timezone - hosts: "puppet:!disabled" roles: diff --git a/playbooks/roles/timezone/README.rst b/playbooks/roles/timezone/README.rst new file mode 100644 index 0000000000..19b8aaad87 --- /dev/null +++ b/playbooks/roles/timezone/README.rst @@ -0,0 +1,5 @@ +Configures timezone to Etc/UTC and restarts crond when changed. + +**Role Variables** + +* None diff --git a/playbooks/roles/timezone/handlers/main.yaml b/playbooks/roles/timezone/handlers/main.yaml new file mode 100644 index 0000000000..5ec3801337 --- /dev/null +++ b/playbooks/roles/timezone/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: restart cron + service: + name: "{{ cron_service_name }}" + state: restarted diff --git a/playbooks/roles/timezone/tasks/main.yaml b/playbooks/roles/timezone/tasks/main.yaml new file mode 100644 index 0000000000..26bcffbeec --- /dev/null +++ b/playbooks/roles/timezone/tasks/main.yaml @@ -0,0 +1,14 @@ +- name: Include OS-specific variables + include_vars: "{{ lookup('first_found', params) }}" + vars: + params: + files: "{{ distro_lookup_path }}" + paths: + - 'vars' + +- name: Set timezone to Etc/UTC + timezone: + name: Etc/UTC + # The timezone Ansible module recommends restarting cron after tz change. + notify: + - restart cron diff --git a/playbooks/roles/timezone/vars/Debian.yaml b/playbooks/roles/timezone/vars/Debian.yaml new file mode 100644 index 0000000000..983c51a9eb --- /dev/null +++ b/playbooks/roles/timezone/vars/Debian.yaml @@ -0,0 +1 @@ +cron_service_name: cron diff --git a/playbooks/roles/timezone/vars/RedHat.yaml b/playbooks/roles/timezone/vars/RedHat.yaml new file mode 100644 index 0000000000..533b421b24 --- /dev/null +++ b/playbooks/roles/timezone/vars/RedHat.yaml @@ -0,0 +1 @@ +cron_service_name: crond