Flaxplax

Personal documentation

Code

Example code for puppet.pp files

File path to code

  /etc/puppetlabs/code/environments/production/manifest

example code

# Defenition of a class
class ntpdemo {

# Installing NTP Package
  package { "ntp":
    ensure => "present",
  }

# Configuring NTP configuration file
  file { "/etc/ntp.conf":
    ensure  => "present",
    content => "server 0.centos.pool.ntp.org iburst\n",
  }

# Starting NTP services
  service { "ntpd":
    ensure => "running",
  }

}

class userdemo { 
#  Creates a new user
  user { "newuser":
    ensure => "present",
  }
}
Last updated on 14 Feb 2021
Published on 14 Feb 2021