Last active
December 26, 2015 18:39
-
-
Save OleMchls/7195553 to your computer and use it in GitHub Desktop.
delme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node web-1 { | |
$role = 'web-app-a' | |
$has_apache = true; | |
include php5 | |
} | |
node web-2 { | |
$role = 'web-app-b' | |
$has_fcgi=true | |
include php5 | |
} | |
# has both enabled, but needs a special config | |
node web-3 { | |
$role = 'web-app-c' | |
$has_fcgi=true | |
$has_apache=true | |
include php5 | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class php5 { | |
if ($::has_fcgi) | |
package { 'php5-cli' : ensure => installed } | |
} | |
if ($::has_apache) { | |
package { 'php5-apache' : ensure => installed } | |
} | |
if ($::role == 'web-app-c') | |
package { 'php5-web-app-c-special-module' } | |
file { '/etc/php5/php.ini' : | |
source => 'puppet:///modules/php5/php.ini-web-app-c' | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class php5( | |
$has_fcgi = false, | |
$has_apache = false, | |
$role = undef | |
) { | |
if ($has_fcgi) | |
package { 'php5-cli' : ensure => installed } | |
} | |
if ($has_apache) { | |
package { 'php5-apache' : ensure => installed } | |
} | |
if ($role == 'web-app-c') { | |
package { 'php5-web-app-c-special-module' } | |
file { '/etc/php5/php.ini' : | |
source => 'puppet:///modules/php5/php.ini-web-app-c' | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node 'web-1' { | |
$role = 'web-app-a' | |
$has_apache = true | |
class { 'php5' : | |
has_apache => true, | |
role => $role | |
} | |
} | |
node 'web-2' { | |
$role = 'web-app-b' | |
$has_fcgi = true | |
class { 'php5' : | |
has_fcgi => true, | |
role => $role | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node 'web-1' { | |
$role = 'web-app-a' | |
$has_apache = true | |
class { 'php5' : | |
has_apache => true, | |
role => $role | |
} | |
} | |
node 'web-2' { | |
$role = 'web-app-b' | |
$has_fcgi = true | |
class { 'php5' : | |
has_fcgi => true, | |
role => $role | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($role == 'web-app-c') { | |
package { 'php5-web-app-c-special-module' } | |
file { '/etc/php5/php.ini' : | |
source => 'puppet:///modules/php5/php.ini-web-app-c' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment