Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class adAuth {
    file {
        "/root/cacert.pem":
            owner   => root,
            group   => root,
            mode    => 600,
            source  => "puppet:///adAuth/cacert.pem";
    }

    exec { "install-certificate":
        cwd     => "/root/",
        user    => "root",
        group   => "root",
        require => File["/root/cacert.pem"],
        command => "/usr/bin/openssl x509 -in /root/cacert.pem -text -out /root/test.crt",
        command => "rm -f /root/cacert.pem",
        unless  => "cat /root/test.crt |grep Louis",
    }
}

info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
notice: //Node[s2023]/adauth/File[/root/cacert.pem]/ensure: created
notice: //Node[s2023]/adauth/Exec[install-certificate]/returns: executed successfully
notice: Finished catalog run in 4.80 seconds