X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=b9087cfb7abae68714edd30ab66c2c28df5216d5;hb=9f43b2db2655e216035c129b1031b225c83a6030;hp=ded13f2fc46b3bf04f72b422d3338e9bdf357cf8;hpb=f1fe05ec2b73ba5dd8466f85fa40e61a29586f8c;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/init.pp b/manifests/init.pp index ded13f2..b9087cf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -26,7 +26,7 @@ class apt( } $_update = merge($::apt::update_defaults, $update) - include apt::update + include ::apt::update validate_hash($purge) if $purge['sources.list'] { @@ -45,6 +45,9 @@ class apt( $_purge = merge($::apt::purge_defaults, $purge) validate_hash($proxy) + if $proxy['ensure'] { + validate_re($proxy['ensure'], ['file', 'present', 'absent']) + } if $proxy['host'] { validate_string($proxy['host']) } @@ -64,10 +67,11 @@ class apt( validate_hash($settings) validate_hash($ppas) - if $proxy['host'] { + if $_proxy['ensure'] == 'absent' or $_proxy['host'] { apt::setting { 'conf-proxy': + ensure => $_proxy['ensure'], priority => '01', - content => template('apt/_header.erb', 'apt/proxy.erb'), + content => template('apt/_conf_header.erb', 'apt/proxy.erb'), } } @@ -89,7 +93,7 @@ class apt( apt::setting { 'conf-update-stamp': priority => 15, - content => template('apt/_header.erb', 'apt/15update-stamp.erb'), + content => template('apt/_conf_header.erb', 'apt/15update-stamp.erb'), } file { 'sources.list': @@ -99,7 +103,7 @@ class apt( group => root, mode => '0644', content => $sources_list_content, - notify => Exec['apt_update'], + notify => Class['apt::update'], } file { 'sources.list.d': @@ -110,7 +114,7 @@ class apt( mode => '0644', purge => $_purge['sources.list.d'], recurse => $_purge['sources.list.d'], - notify => Exec['apt_update'], + notify => Class['apt::update'], } file { 'preferences': @@ -119,7 +123,7 @@ class apt( owner => root, group => root, mode => '0644', - notify => Exec['apt_update'], + notify => Class['apt::update'], } file { 'preferences.d': @@ -130,11 +134,9 @@ class apt( mode => '0644', purge => $_purge['preferences.d'], recurse => $_purge['preferences.d'], - notify => Exec['apt_update'], + notify => Class['apt::update'], } - anchor { 'apt_first': } -> Class['apt::update'] -> anchor { 'apt_last': } - # manage sources if present if $sources { create_resources('apt::source', $sources)