diff --git a/install_modules.sh b/install_modules.sh index e29a1cde62..f7aba1e0ba 100644 --- a/install_modules.sh +++ b/install_modules.sh @@ -4,7 +4,7 @@ if ! puppet help module >/dev/null 2>&1 ; then apt-get install -y -o Dpkg::Options::="--force-confold" puppet facter fi -MODULES="puppetlabs-mysql puppetlabs-dashboard puppetlabs-vcsrepo" +MODULES="puppetlabs-apt puppetlabs-mysql puppetlabs-dashboard puppetlabs-vcsrepo" MODULE_LIST=`puppet module list` for MOD in $MODULES ; do diff --git a/modules/apt/manifests/builddep.pp b/modules/apt/manifests/builddep.pp deleted file mode 100644 index 2c6e19ebe6..0000000000 --- a/modules/apt/manifests/builddep.pp +++ /dev/null @@ -1,17 +0,0 @@ -define apt::builddep($ensure = present) { - case $ensure { - present: { - exec { "Install build-deps for $name": - path => "/usr/sbin:/usr/bin:/sbin:/bin", - environment => "HOME=/root", - command => "apt-get -y --force-yes build-dep $name", - user => "root", - group => "root", - logoutput => on_failure, - } - } - default: { - fail "Invalid 'ensure' value '$ensure' for apt::builddep" - } - } -} diff --git a/modules/apt/manifests/key.pp b/modules/apt/manifests/key.pp deleted file mode 100644 index 7b76834287..0000000000 --- a/modules/apt/manifests/key.pp +++ /dev/null @@ -1,28 +0,0 @@ -define apt::key($keyid, $ensure, $keyserver = "keyserver.ubuntu.com") { - case $ensure { - present: { - exec { "Import $keyid to apt keystore": - path => "/bin:/usr/bin", - environment => "HOME=/root", - command => "gpg --keyserver $keyserver --recv-keys $keyid && gpg --export --armor $keyid | apt-key add -", - user => "root", - group => "root", - unless => "apt-key list | grep $keyid", - logoutput => on_failure, - } - } - absent: { - exec { "Remove $keyid from apt keystore": - path => "/bin:/usr/bin", - environment => "HOME=/root", - command => "apt-key del $keyid", - user => "root", - group => "root", - onlyif => "apt-key list | grep $keyid", - } - } - default: { - fail "Invalid 'ensure' value '$ensure' for apt::key" - } - } -} diff --git a/modules/apt/manifests/ppa.pp b/modules/apt/manifests/ppa.pp deleted file mode 100644 index f8e276bc7a..0000000000 --- a/modules/apt/manifests/ppa.pp +++ /dev/null @@ -1,30 +0,0 @@ -define apt::ppa($ensure = present) { - $has_ppa = "/usr/bin/test -f /etc/apt/sources.list.d/`echo $name | cut -f2 -d: | tr / -`*list" - case $ensure { - present: { - exec { "Add $name PPA": - path => "/usr/sbin:/usr/bin:/sbin:/bin", - environment => "HOME=/root", - command => "add-apt-repository $name ; apt-get update", - user => "root", - group => "root", - logoutput => on_failure, - unless => "$has_ppa", - } - } - absent: { - exec { "Add $name PPA": - path => "/usr/sbin:/usr/bin:/sbin:/bin", - environment => "HOME=/root", - command => "add-apt-repository --remove $name ; apt-get update", - user => "root", - group => "root", - logoutput => on_failure, - unless => "$has_ppa", - } - } - default: { - fail "Invalid 'ensure' value '$ensure' for ppa" - } - } -} diff --git a/modules/jenkins_master/manifests/init.pp b/modules/jenkins_master/manifests/init.pp index 0da211e8dd..9a7f1b41b1 100644 --- a/modules/jenkins_master/manifests/init.pp +++ b/modules/jenkins_master/manifests/init.pp @@ -5,21 +5,21 @@ class jenkins_master($site, $serveradmin, $logo, ) { include pip + include apt #This key is at http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key - apt::key { "D50582E6": - keyid => "D50582E6", - ensure => present, + apt::key { "jenkins": + key => "D50582E6", + key_source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key", + require => Package["wget"] } - file { '/etc/apt/sources.list.d/jenkins.list': - owner => 'root', - group => 'root', - mode => 444, - ensure => 'present', - content => "deb http://pkg.jenkins-ci.org/debian binary/", - replace => 'true', - require => Apt::Key['D50582E6'], + apt::source { 'jenkins': + location => "http://pkg.jenkins-ci.org/debian", + release => "binary/", + repos => "", + require => Apt::Key['jenkins'], + notify => Class['Apt::Update'] } file { '/etc/apache2/sites-available/jenkins': @@ -88,14 +88,18 @@ class jenkins_master($site, $serveradmin, $logo, } $packages = [ - "jenkins", "python-babel", - "apache2" + "apache2", + "wget", ] package { $packages: ensure => "present", - require => [File['/etc/apt/sources.list.d/jenkins.list'], Exec["update apt cache"]], + } + + package { "jenkins": + ensure => "present", + require => Apt::Source['jenkins'], } service { "versions": diff --git a/modules/openstack_project/manifests/pypi.pp b/modules/openstack_project/manifests/pypi.pp index 9a7f9a2a53..f4ee6b49e1 100644 --- a/modules/openstack_project/manifests/pypi.pp +++ b/modules/openstack_project/manifests/pypi.pp @@ -1,6 +1,6 @@ class openstack_project::pypi { include tmpreaper - include apt::unattended-upgrades + include unattended_upgrades include openstack_project # include jenkins slave so that build deps are there for the pip download diff --git a/modules/openstack_project/manifests/slave.pp b/modules/openstack_project/manifests/slave.pp index 620587c77b..8191625bb1 100644 --- a/modules/openstack_project/manifests/slave.pp +++ b/modules/openstack_project/manifests/slave.pp @@ -1,7 +1,7 @@ class openstack_project::slave { include openstack_project include tmpreaper - include apt::unattended-upgrades + include unattended_upgrades class { 'openstack_project::server': iptables_public_tcp_ports => [] } diff --git a/modules/openstack_project/manifests/template.pp b/modules/openstack_project/manifests/template.pp index 6daaa0e3b4..c79280eb0e 100644 --- a/modules/openstack_project/manifests/template.pp +++ b/modules/openstack_project/manifests/template.pp @@ -4,7 +4,7 @@ class openstack_project::template ($iptables_public_tcp_ports) { include ntp include ssh include snmpd - include apt::unattended-upgrades + include unattended_upgrades class { 'iptables': public_tcp_ports => $iptables_public_tcp_ports, diff --git a/modules/apt/files/10periodic b/modules/unattended_upgrades/files/10periodic similarity index 100% rename from modules/apt/files/10periodic rename to modules/unattended_upgrades/files/10periodic diff --git a/modules/apt/files/50unattended-upgrades b/modules/unattended_upgrades/files/50unattended-upgrades similarity index 100% rename from modules/apt/files/50unattended-upgrades rename to modules/unattended_upgrades/files/50unattended-upgrades diff --git a/modules/apt/manifests/unattended-upgrades.pp b/modules/unattended_upgrades/manifests/init.pp similarity index 55% rename from modules/apt/manifests/unattended-upgrades.pp rename to modules/unattended_upgrades/manifests/init.pp index dc101e3b15..74b6e95121 100644 --- a/modules/apt/manifests/unattended-upgrades.pp +++ b/modules/unattended_upgrades/manifests/init.pp @@ -1,18 +1,18 @@ -class apt::unattended-upgrades($email='') { +class unattended_upgrades($ensure = present) { package { 'unattended-upgrades': - ensure => present; + ensure => $ensure; } package { 'mailutils': - ensure => present; + ensure => $ensure; } file { '/etc/apt/apt.conf.d/10periodic': owner => 'root', group => 'root', mode => 444, - ensure => 'present', - source => "puppet:///modules/apt/10periodic", + ensure => $ensure, + source => "puppet:///modules/unattended_upgrades/10periodic", replace => 'true', } @@ -20,8 +20,8 @@ class apt::unattended-upgrades($email='') { owner => 'root', group => 'root', mode => 444, - ensure => 'present', - source => "puppet:///modules/apt/50unattended-upgrades", + ensure => $ensure, + source => "puppet:///modules/unattended_upgrades/50unattended-upgrades", replace => 'true', }