From 740734a79b143b572da440e203dbadcb471f2e4e Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Tue, 17 Jan 2017 11:03:14 -0200 Subject: Rename extensions module to autorestart --- puppet/modules/site_apache/files/auto_restart.conf | 2 -- puppet/modules/site_apache/files/autorestart.conf | 2 ++ puppet/modules/site_apache/manifests/common.pp | 2 +- .../modules/site_apache/manifests/common/autorestart.pp | 15 +++++++++++++++ puppet/modules/site_apache/manifests/common/extensions.pp | 12 ------------ puppet/modules/site_apache/spec/classes/autorestart.rb | 7 +++++++ puppet/modules/site_apache/spec/classes/extensions.rb | 7 ------- 7 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 puppet/modules/site_apache/files/auto_restart.conf create mode 100644 puppet/modules/site_apache/files/autorestart.conf create mode 100644 puppet/modules/site_apache/manifests/common/autorestart.pp delete mode 100644 puppet/modules/site_apache/manifests/common/extensions.pp create mode 100644 puppet/modules/site_apache/spec/classes/autorestart.rb delete mode 100644 puppet/modules/site_apache/spec/classes/extensions.rb diff --git a/puppet/modules/site_apache/files/auto_restart.conf b/puppet/modules/site_apache/files/auto_restart.conf deleted file mode 100644 index 8a764e34..00000000 --- a/puppet/modules/site_apache/files/auto_restart.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Restart=always diff --git a/puppet/modules/site_apache/files/autorestart.conf b/puppet/modules/site_apache/files/autorestart.conf new file mode 100644 index 00000000..8a764e34 --- /dev/null +++ b/puppet/modules/site_apache/files/autorestart.conf @@ -0,0 +1,2 @@ +[Service] +Restart=always diff --git a/puppet/modules/site_apache/manifests/common.pp b/puppet/modules/site_apache/manifests/common.pp index c96932dd..4847cbe3 100644 --- a/puppet/modules/site_apache/manifests/common.pp +++ b/puppet/modules/site_apache/manifests/common.pp @@ -28,6 +28,6 @@ class site_apache::common { include site_apache::common::tls include site_apache::common::acme - include site_apache::common::extensions + include site_apache::common::autorestart } diff --git a/puppet/modules/site_apache/manifests/common/autorestart.pp b/puppet/modules/site_apache/manifests/common/autorestart.pp new file mode 100644 index 00000000..aa13d4ef --- /dev/null +++ b/puppet/modules/site_apache/manifests/common/autorestart.pp @@ -0,0 +1,15 @@ +# +# Adds autorestart extension to apache on crash +# +class site_apache::common::autorestart { + + include ::systemd + file { '/etc/systemd/system/apache2.service.d/autorestart.conf': + source => 'puppet:///modules/site_apache/autorestart.conf', + owner => 'root', + group => 'root', + mode => '0644', + require => Service['apache'], + notify => Exec['systemctl-daemon-reload'] + } +} diff --git a/puppet/modules/site_apache/manifests/common/extensions.pp b/puppet/modules/site_apache/manifests/common/extensions.pp deleted file mode 100644 index 6e489ce8..00000000 --- a/puppet/modules/site_apache/manifests/common/extensions.pp +++ /dev/null @@ -1,12 +0,0 @@ -class site_apache::common::extensions { - - include ::systemd - file { '/etc/systemd/system/apache2.service.d/auto_restart.conf': - source => 'puppet:///modules/site_apache/auto_restart.conf', - owner => 'root', - group => 'root', - mode => '0644', - require => Service['apache'], - notify => Exec['systemctl-daemon-reload'] - } -} diff --git a/puppet/modules/site_apache/spec/classes/autorestart.rb b/puppet/modules/site_apache/spec/classes/autorestart.rb new file mode 100644 index 00000000..afa02ec9 --- /dev/null +++ b/puppet/modules/site_apache/spec/classes/autorestart.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe 'site_apache::common::autorestart' do + it "should include apache autorestart" do + should contain_file('/etc/systemd/system/apache2.service.d/autorestart.conf').with_source('puppet:///modules/site_apache/autorestart.conf') + end +end diff --git a/puppet/modules/site_apache/spec/classes/extensions.rb b/puppet/modules/site_apache/spec/classes/extensions.rb deleted file mode 100644 index 632b2d72..00000000 --- a/puppet/modules/site_apache/spec/classes/extensions.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'spec_helper' - -describe 'site_apache::common::extensions' do - it "should include apache autostart" do - should contain_file('/etc/systemd/system/apache2.service.d/auto_restart.conf').with_source('puppet:///modules/site_apache/apache_auto_restart.conf') - end -end -- cgit v1.2.3