Add timezone role

Contains a handler to restart crond when tz is changed. Cron service
name differs across distros.

Removes the puppet-timezone usage.

Change-Id: I4e45d0e0ed37214ac491f373ff2d37750e720718
This commit is contained in:
David Shrewsbury 2018-08-21 16:12:37 -04:00 committed by James E. Blair
parent 360e0107a7
commit b3b698c6ff
8 changed files with 26 additions and 5 deletions

View File

@ -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/puppetlabs/puppetlabs-stdlib"]="4.17.0"
SOURCE_MODULES["https://github.com/rafaelfelix/puppet-pear"]="1.0.3" 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-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/stankevich/puppet-python"]="1.9.4"
SOURCE_MODULES["https://github.com/theforeman/puppet-dns"]="4.1.0" SOURCE_MODULES["https://github.com/theforeman/puppet-dns"]="4.1.0"
SOURCE_MODULES["https://github.com/vamsee/puppet-solr"]="0.0.8" SOURCE_MODULES["https://github.com/vamsee/puppet-solr"]="0.0.8"

View File

@ -10,10 +10,6 @@ class openstack_project::server (
$pypi_index_url = 'https://pypi.python.org/simple', $pypi_index_url = 'https://pypi.python.org/simple',
) { ) {
class { 'timezone':
timezone => 'Etc/UTC',
}
# Include ::apt while we work on the puppet->ansible transition # Include ::apt while we work on the puppet->ansible transition
if ($::osfamily == 'Debian') { if ($::osfamily == 'Debian') {
include ::apt include ::apt

View File

@ -8,6 +8,7 @@
- hosts: "!disabled" - hosts: "!disabled"
roles: roles:
- base-server - base-server
- timezone
- hosts: "puppet:!disabled" - hosts: "puppet:!disabled"
roles: roles:

View File

@ -0,0 +1,5 @@
Configures timezone to Etc/UTC and restarts crond when changed.
**Role Variables**
* None

View File

@ -0,0 +1,4 @@
- name: restart cron
service:
name: "{{ cron_service_name }}"
state: restarted

View File

@ -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

View File

@ -0,0 +1 @@
cron_service_name: cron

View File

@ -0,0 +1 @@
cron_service_name: crond