Skip to content

Instantly share code, notes, and snippets.

@agomerz
Last active December 2, 2016 17:07
Show Gist options
  • Save agomerz/ed9e28b3665e176480b9e39d63abd862 to your computer and use it in GitHub Desktop.
Save agomerz/ed9e28b3665e176480b9e39d63abd862 to your computer and use it in GitHub Desktop.
Determine Puppet knowledge

#Question 1:

Correct the dependency cycle in the below apache class.

class apache {

  package {'apache2':
    ensure  => installed,
    require => Service['apache2'],
  }

  service {'apache2':
    ensure    => running,
    subscribe => File['/etc/apache2/apache2.conf'],
  }

  file {'/etc/apache2/apache2.conf':
    ensure  => present,
    require => Package['apache2']
  }

}

#Question 2:

Which of these classes will fail to compile?

class foofile {
  file {'/etc/foo/file':
    ensure => file,
  }
}

class ssh::service {
  service{'ssh':
    ensure => running,
  }
}

class ntp {
  package {'ntp':
    ensure => installed,
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment