Skip to content

Instantly share code, notes, and snippets.

@pdxmph
Created May 24, 2013 17:41
Show Gist options
  • Select an option

  • Save pdxmph/5645200 to your computer and use it in GitHub Desktop.

Select an option

Save pdxmph/5645200 to your computer and use it in GitHub Desktop.
A simple Puppet manifest you can use to manage sshd configuration. The "file" stanza controls the owner, group, permissions and content of the sshd file. Note how line 13 (`source`) uses the `operatingsystem` fact to name the file to provide to the agent. The "service" stanza ensures that sshd is running on the agent system, so you'll always be …
# === Authors
# Author Name <[email protected]>
#
# === Copyright
# Copyright 2013 Puppet Labs
#
class ssh {
file { '/etc/ssh/sshd_config':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/ssh/sshd_config.${operatingsystem}",
notify => Service['ssh']
}
service { 'ssh':
ensure => 'running',
enable => 'true',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment