X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fssl%2Fmanifests%2Finit.pp;h=ee8306772cd8ec40a930637017bb28dacaeaaa40;hb=90ed72586f37f196710c93390d6a6caac0033223;hp=9d9581b2b60e37ec6209d93d5533ca5d4c0268c3;hpb=32af51c0ce0cccd69e4194ca25d17cb562640f55;p=mirror%2Fdsa-puppet.git diff --git a/modules/ssl/manifests/init.pp b/modules/ssl/manifests/init.pp index 9d9581b2b..ee8306772 100644 --- a/modules/ssl/manifests/init.pp +++ b/modules/ssl/manifests/init.pp @@ -1,6 +1,4 @@ class ssl { - $caconf = '/etc/ca-certificates.conf' - package { 'openssl': ensure => installed, } @@ -29,7 +27,7 @@ class ssl { } file { '/etc/ca-certificates-debian.conf': mode => '0444', - source => 'puppet:///modules/ssl/ca-certificates-debian.conf', + source => 'puppet:///modules/ssl/ca-certificates.conf', notify => Exec['refresh_ca_debian_hashes'], } file { '/etc/ca-certificates-global.conf': @@ -37,11 +35,6 @@ class ssl { notify => Exec['refresh_ca_global_hashes'], } - file { '/etc/apt/apt.conf.d/local-ssl-ca-global': - mode => '0444', - source => 'puppet:///modules/ssl/local-ssl-ca-global', - } - file { '/etc/ssl/certs/ssl-cert-snakeoil.pem': ensure => absent, notify => Exec['refresh_normal_hashes'], @@ -51,17 +44,11 @@ class ssl { } file { '/etc/ssl/servicecerts': - ensure => link, - purge => true, - force => true, - target => '/usr/local/share/ca-certificates/debian.org', - notify => Exec['retire_debian_links'], + ensure => absent, } file { '/usr/local/share/ca-certificates/debian.org': - ensure => directory, - source => 'puppet:///modules/ssl/servicecerts/', - mode => '0644', # this works; otherwise all files are +x + ensure => absent, purge => true, recurse => true, force => true, @@ -101,18 +88,18 @@ class ssl { mode => '0755', } file { '/etc/ssl/debian/certs/thishost.crt': - source => "puppet:///modules/ssl/auto-clientcerts/${::fqdn}.client.crt", + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/" + @fqdn + ".client.crt") %>'), notify => Exec['refresh_debian_hashes'], } file { '/etc/ssl/debian/certs/ca.crt': - source => 'puppet:///modules/ssl/auto-clientcerts/ca.crt', + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/ca.crt") %>'), notify => Exec['refresh_debian_hashes'], } file { '/etc/ssl/debian/crls/ca.crl': - source => 'puppet:///modules/ssl/auto-clientcerts/ca.crl', + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/ca.crl") %>'), } file { '/etc/ssl/debian/certs/thishost-server.crt': - source => "puppet:///modules/ssl/auto-certs/${::fqdn}.crt", + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".crt") %>'), notify => Exec['refresh_debian_hashes'], } @@ -127,13 +114,13 @@ class ssl { force => true, } file { '/etc/ssl/private/thishost.key': - source => "puppet:///modules/ssl/auto-clientcerts/${::fqdn}.key", + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/" + @fqdn + ".key") %>'), mode => '0440', group => ssl-cert, require => Package['ssl-cert'], } file { '/etc/ssl/private/thishost-server.key': - source => "puppet:///modules/ssl/auto-certs/${::fqdn}.key", + content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".key") %>'), mode => '0440', group => ssl-cert, require => Package['ssl-cert'], @@ -153,12 +140,12 @@ class ssl { $updatecacerts = $updatecacertsdsa } - exec { 'retire_debian_links': - command => 'find -lname "../servicecerts/*" -exec rm {} +', - cwd => '/etc/ssl/certs', - refreshonly => true, - notify => Exec['refresh_normal_hashes'], + file { '/etc/apt/apt.conf.d/local-ssl-ca-global': + mode => '0444', + content => template('ssl/local-ssl-ca-global.erb'), } + + exec { 'refresh_debian_hashes': command => 'c_rehash /etc/ssl/debian/certs', refreshonly => true,