Resource declaration for installing LAMP Stack using Puppet

0 votes
I'm trying to install LAMP Stack using Puppet. Can you tell how do I declare my resources? Thank you
Mar 11 in DevOps & Agile by Vinay
40 views

1 answer to this question.

0 votes

First create manifest, like this:

sudo vi /etc/puppet/manifests/lamp.pp

Add the following lines to declare resources:

# 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,
}

# 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,
}

# 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
} 
answered Mar 11 by Bob

Related Questions In DevOps & Agile

+2 votes
2 answers

how to set different provisioning profiles for different targets using Xcode Build

For multiple targets, each task has to ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by ajs3033
• 7,280 points

edited Oct 16, 2018 by Kalgi 628 views
0 votes
1 answer

How to restart docker for windows using Powershell?

Try this: $processes = Get-Process "*docker for windows*" if ...READ MORE

answered Oct 23, 2018 in DevOps & Agile by Tyrion anex
• 8,270 points
217 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

WordPress write-access when using Docker for Windows

Try these steps: Start the container as administrator ...READ MORE

answered Dec 3, 2018 in DevOps & Agile by Tyrion anex
• 8,270 points
48 views