Puppet: Nullmailer module

create module structure
mkdir -p /etc/puppet/modules/nullmailer/manifests
mkdir -p /etc/puppet/modules/nullmailer/files

download module definiction
wget -q https://raw.githubusercontent.com/panticz/puppet/master/modules/nullmailer/init.pp -O /etc/puppet/modules/nullmailer/manifests/init.pp

class nullmailer {
    package { "nullmailer":
        ensure => installed,
    }

    service { 'nullmailer':
        ensure => running,
        enable => true,
        require => Package['nullmailer']
    }

    file { "/etc/mailname":
        mode => 644,
        owner => root,
        group => root,
        source => "puppet:///modules/nullmailer/mailname",
        require => Package["nullmailer"],
    }

    file { "/etc/nullmailer/remotes":
        mode => 600,
        owner => mail,
        group => mail,
        source => "puppet:///modules/nullmailer/remotes",
        require => Package["nullmailer"],
    }
}

add include to your client in /etc/puppet/manifests/site.pp
node "client1.local" inherits default {
...
include nullmailer
...
}

Example: /etc/mailname
example.com

Example: /etc/nullmailer/remotes
smtp.example.com smtp --auth-login --user=YOUR_SMTP_ID --pass=YOUR_SMTP_PASS

Links
http://www.panticz.de/install-nullmailer