Created
April 6, 2020 15:31
-
-
Save jfrantz1-r7/5dd8d5ec37228036049a6709935b9272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class sethostname { | |
file { "/etc/hostname": | |
ensure => present, | |
owner => root, | |
group => root, | |
mode => '0644', | |
content => "$::fqdn\n", | |
notify => Exec["set-hostname"], | |
} | |
exec { "set-hostname": | |
command => '/bin/hostname -F /etc/hostname', | |
unless => "/usr/bin/test `hostname` = `/bin/cat /etc/hostname`", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment