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:
parent
360e0107a7
commit
b3b698c6ff
@ -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"
|
||||||
|
@ -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
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
- hosts: "!disabled"
|
- hosts: "!disabled"
|
||||||
roles:
|
roles:
|
||||||
- base-server
|
- base-server
|
||||||
|
- timezone
|
||||||
|
|
||||||
- hosts: "puppet:!disabled"
|
- hosts: "puppet:!disabled"
|
||||||
roles:
|
roles:
|
||||||
|
5
playbooks/roles/timezone/README.rst
Normal file
5
playbooks/roles/timezone/README.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Configures timezone to Etc/UTC and restarts crond when changed.
|
||||||
|
|
||||||
|
**Role Variables**
|
||||||
|
|
||||||
|
* None
|
4
playbooks/roles/timezone/handlers/main.yaml
Normal file
4
playbooks/roles/timezone/handlers/main.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- name: restart cron
|
||||||
|
service:
|
||||||
|
name: "{{ cron_service_name }}"
|
||||||
|
state: restarted
|
14
playbooks/roles/timezone/tasks/main.yaml
Normal file
14
playbooks/roles/timezone/tasks/main.yaml
Normal 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
|
1
playbooks/roles/timezone/vars/Debian.yaml
Normal file
1
playbooks/roles/timezone/vars/Debian.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
cron_service_name: cron
|
1
playbooks/roles/timezone/vars/RedHat.yaml
Normal file
1
playbooks/roles/timezone/vars/RedHat.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
cron_service_name: crond
|
Loading…
Reference in New Issue
Block a user