Created
November 12, 2012 23:18
-
-
Save big-samantha/4062735 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
##../modules/haproxy/init.pp | |
class haproxy { | |
include | |
'::haproxy::install', | |
'::haproxy::config', | |
'::haproxy::service' | |
Class['::haproxy::install'] -> Class['::haproxy::config'] | |
Class['::haproxy::config'] ~> Class['::haproxy::service'] | |
} | |
##../modules/haproxy/config.pp | |
class haproxy::config ( $haproxycfg ) { | |
file { 'haproxy.cfg': | |
ensure => present, | |
content => $haproxycfg, | |
path => '/etc/haproxy/haproxy.cfg', | |
owner => root, | |
} | |
} | |
##now I wan't to declare or include ::haproxy somewhere, and set the $haproxycfg variable from haproxy::config | |
##Can I do this? | |
class {'haproxy': | |
haproxycfg => 'template('cluster/haproxy.cfg.erb')', | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue that I'm not clear on is that $haproxycfg is part of the haproxy::config class so I'm not sure how to set it when I declare ::haproxy as a resource somewhere.