-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlamp_rh.pp
51 lines (41 loc) · 1.12 KB
/
lamp_rh.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# execute 'apt-get update'
exec { 'update': # exec resource named 'apt-update'
command => '/usr/bin/yum update -y' # command this resource will run
}
# install apache2 package
package { 'nginx':
require => Exec['update'], # require 'apt-update' before installing
ensure => installed,
provider => 'amazon-linux-extras'
}
# ensure apache2 service is running
service { 'nginx':
ensure => running,
}
# install mysql-server package
#package { 'mariadb-server':
# require => Exec['update'], # require 'apt-update' before installing
# ensure => installed,
#}
# ensure mysql service is running
#service { 'mariadb':
# ensure => running,
# ensure => installed,
#}
# ensure info.php file exists
file { '/var/www/html/info.php':
ensure => file,
content => '<?php phpinfo(); ?>', # phpinfo code
# require => Package['httpd'], # require 'apache2' package before creating
}
file { '/tmp/helloworld':
ensure => present,
content => "Hello, world!\n 123\n",
mode => '0644',
owner => 'ec2-user',
group => 'ec2-user'
}
#file { '/bin/chmod':
# ensure => present,
# mode => '771',
#}