X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fssl%2Fmanifests%2Finit.pp;h=2d4a140cfc004a1387057629f64951b4be5ab019;hb=c5af1344dc7bdb0050b613962ed465001ae2b2a8;hp=c9fbbf3613cfa4f3d114a7403572c50608380566;hpb=c725fa2e2967a0df0dbb6c9299c44a9448a5a9ba;p=mirror%2Fdsa-puppet.git diff --git a/modules/ssl/manifests/init.pp b/modules/ssl/manifests/init.pp index c9fbbf361..2d4a140cf 100644 --- a/modules/ssl/manifests/init.pp +++ b/modules/ssl/manifests/init.pp @@ -1,6 +1,4 @@ class ssl { - - $cacert = 'mozilla/UTN_USERFirst_Hardware_Root_CA.crt' $caconf = '/etc/ca-certificates.conf' package { 'openssl': @@ -14,18 +12,26 @@ 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'], + } + + file { '/usr/local/share/ca-certificates/debian.org': ensure => directory, source => 'puppet:///modules/ssl/servicecerts/', - mode => '0644', + mode => '0644', # this works; otherwise all files are +x purge => true, recurse => true, force => true, - notify => Exec['refresh_debian_links'], + notify => Exec['refresh_normal_hashes'], } file { '/etc/ssl/debian': ensure => directory, source => 'puppet:///files/empty/', - mode => '0644', + mode => '0644', # this works; otherwise all files are +x purge => true, recurse => true, force => true, @@ -72,29 +78,16 @@ class ssl { require => Package['ssl-cert'], } - exec { 'refresh_debian_links': - command => 'cp -f -s ../servicecerts/* .', + exec { 'retire_debian_links': + command => 'find -lname "../servicecerts/*" -exec rm {} +', cwd => '/etc/ssl/certs', refreshonly => true, - notify => Exec['delete_unused_links'], - } - exec { 'delete_unused_links': - command => 'find -L . -mindepth 1 -maxdepth 1 -type l -delete', - cwd => '/etc/ssl/certs', - refreshonly => true, - notify => Exec['refresh_normal_hashes'], # see NOTE 1 - } - exec { 'modify_configuration': - command => "sed -i -e 's#!${cacert}#${cacert}' ${caconf}", - onlyif => "grep -Fqx '!${cacert}' ${caconf}", notify => Exec['refresh_normal_hashes'], - require => Package['ca-certificates'], } exec { 'refresh_debian_hashes': - command => '/usr/bin/c_rehash .', - cwd => '/etc/ssl/debian/certs', + command => 'c_rehash /etc/ssl/debian/certs', refreshonly => true, - require => Package['openssl'] + require => Package['openssl'], } exec { 'refresh_normal_hashes': # NOTE 1: always use update-ca-certificates to manage hashes in