From 36aefd0c48bf80f2b54ea3d56cb65d20c69a87a4 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 28 Feb 2013 14:31:14 -0500 Subject: [PATCH] Split out tmp clean and auto upgrades. Create abstractions for tmpcleanup and automatic_upgrades which can be used to install/include distro specific modules modules for these features. On Ubuntu this will still install unattended_upgrades and tmpreaper. On RHEL we need to implement similar functionality and modules. Change-Id: I9209610582e23c86dccb5e70691bb598dad36950 Reviewed-on: https://review.openstack.org/23197 Reviewed-by: Jeremy Stanley Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins --- .../manifests/automatic_upgrades.pp | 12 ++++++++++++ modules/openstack_project/manifests/pypi.pp | 4 ++-- modules/openstack_project/manifests/slave.pp | 4 ++-- modules/openstack_project/manifests/template.pp | 2 +- modules/openstack_project/manifests/tmpcleanup.pp | 13 +++++++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 modules/openstack_project/manifests/automatic_upgrades.pp create mode 100644 modules/openstack_project/manifests/tmpcleanup.pp diff --git a/modules/openstack_project/manifests/automatic_upgrades.pp b/modules/openstack_project/manifests/automatic_upgrades.pp new file mode 100644 index 0000000000..8b5b97a615 --- /dev/null +++ b/modules/openstack_project/manifests/automatic_upgrades.pp @@ -0,0 +1,12 @@ +# == Class: openstack_project::automatic_upgrades +# +class openstack_project::automatic_upgrades ( +) { + + if $::operatingsystem == 'Ubuntu' { + include unattended_upgrades + } + + #FIXME need to implement an automatic upgrades module for RHEL + +} diff --git a/modules/openstack_project/manifests/pypi.pp b/modules/openstack_project/manifests/pypi.pp index 450ed7413e..4dc4845d4e 100644 --- a/modules/openstack_project/manifests/pypi.pp +++ b/modules/openstack_project/manifests/pypi.pp @@ -3,8 +3,8 @@ class openstack_project::pypi ( $sysadmins = [] ) { - include tmpreaper - include unattended_upgrades + include openstack_project::tmpcleanup + include openstack_project::automatic_upgrades # include jenkins slave so that build deps are there for the pip download class { 'jenkins::slave': diff --git a/modules/openstack_project/manifests/slave.pp b/modules/openstack_project/manifests/slave.pp index 8dd70fd4b4..b700b3de69 100644 --- a/modules/openstack_project/manifests/slave.pp +++ b/modules/openstack_project/manifests/slave.pp @@ -6,8 +6,8 @@ class openstack_project::slave ( $sysadmins = [] ) { include openstack_project - include tmpreaper - include unattended_upgrades + include openstack_project::tmpcleanup + include openstack_project::automatic_upgrades class { 'openstack_project::server': iptables_public_tcp_ports => [], certname => $certname, diff --git a/modules/openstack_project/manifests/template.pp b/modules/openstack_project/manifests/template.pp index 2d2a41703b..5a341ec1bd 100644 --- a/modules/openstack_project/manifests/template.pp +++ b/modules/openstack_project/manifests/template.pp @@ -11,7 +11,7 @@ class openstack_project::template ( ) { include ssh include snmpd - include unattended_upgrades + include openstack_project::automatic_upgrades class { 'iptables': public_tcp_ports => $iptables_public_tcp_ports, diff --git a/modules/openstack_project/manifests/tmpcleanup.pp b/modules/openstack_project/manifests/tmpcleanup.pp new file mode 100644 index 0000000000..d28a7e0d7f --- /dev/null +++ b/modules/openstack_project/manifests/tmpcleanup.pp @@ -0,0 +1,13 @@ +# == Class: openstack_project::tmpcleanup +# +class openstack_project::tmpcleanup ( +) { + + if $::operatingsystem == 'Ubuntu' { + include tmpreaper + } + + # FIXME need to implement an something on RHEL to fine tune the + # temp directory cleanup. + +}