Skip to content

Instantly share code, notes, and snippets.

@rgorsuch
Created January 5, 2016 22:11
Show Gist options
  • Save rgorsuch/1144b077f5f68e508463 to your computer and use it in GitHub Desktop.
Save rgorsuch/1144b077f5f68e508463 to your computer and use it in GitHub Desktop.
# PUPPET CONFIG MANIFEST FOR IRF (Installs LAMP stack, tomcat8 and memcached)
# If you are running this locally on an agent, place this file in /etc/puppet/manifests and run puppet appy irf.pp --test
# execute 'apt-get update'
exec { 'apt-update': # exec resource named 'apt-update'
command => '/usr/bin/apt-get update' # command this resource will run
}
# install apache2 package
package { 'apache2':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure apache2 service is running
service { 'apache2':
ensure => running,
require => Package['apache2']
}
# install mysql-server package
package { 'mysql-server':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure mysql service is running
service { 'mysql':
ensure => running,
require => Package['mysql-server']
}
# install php5 package
package { 'php5':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure info.php file exists
file { '/var/www/html/info.php':
ensure => file,
content => '<?php phpinfo(); ?>', # phpinfo code
require => Package['apache2'], # require 'apache2' package before creating
}
# install tomcat8 package
package { 'tomcat8':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure tomcat8 is running
service { 'tomcat8':
ensure => running,
require => Package['tomcat8']
}
# install memcached package
package { 'memcached':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure memcached is running
service { 'memcached':
ensure => running,
require => Package['memcached']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment