Can some one point out to me what I am missing? I suspect I have
messed up the if/else some how. I am getting a ''
Syntax error at ''{''; expected ''}'' at
/srv/puppet/production/manifests/modules/apache/init.pp: 19''.
According to the Language tutorial this should be correct. I am
testing for an existence of a variable. If it exists chagne the config
files to use it, if not set it to the apache default.
My init.pp:
class apache{
if $docroot{
# Set Document Root to the new directory.
line{"$docroot":
file => "/etc/http/conf/httpd.conf",
line => ''DocumentRoot
"/var/www/html"'',
ensure => comment,
}
file{"$docroot.conf":
path =>
"/etc/http/conf.d/DocumentRoot.conf",
content =>''# This file sets the webserver
Document Root
# dir for Apache.
DocumentRoot "$docroot"'',
require => Line["$docroot"],
}
}
else {
$docroot = "/var/www/html"
} #<<< This Line
19.
$packages =
{"httpd","mod_ssl","webalizer"}
package{$packages:
ensure => present,
}
file{$docroot:
ensure => directory,
mode => 755,
}
}
Evan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
On Apr 24, 2008, at 4:40 PM, Evan Hisey wrote:> file{"$docroot.conf": > path => "/etc/http/conf.d/DocumentRoot.conf", > content =>''# This file sets the webserver > Document Root > # dir for Apache. > DocumentRoot "$docroot"'',There''s currently a filed bug about carriage returns in strings not counting against the line count. This string is messing up your line count.> > require => Line["$docroot"], > } > } > else { > $docroot = "/var/www/html" > } #<<< This > Line 19. > > $packages = {"httpd","mod_ssl","webalizer"}This is not how you specify an array; use []. -- Work is not always required. There is such a thing as sacred idleness. -- George MacDonald --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Apr 24, 2008 at 5:56 PM, Luke Kanies <luke@madstop.com> wrote:> > On Apr 24, 2008, at 4:40 PM, Evan Hisey wrote: > > > file{"$docroot.conf": > > path => "/etc/http/conf.d/DocumentRoot.conf", > > content =>''# This file sets the webserver > > Document Root > > # dir for Apache. > > DocumentRoot "$docroot"'', > > There''s currently a filed bug about carriage returns in strings not > counting against the line count. This string is messing up your line > count. > > > > > > require => Line["$docroot"], > > } > > } > > else { > > $docroot = "/var/www/html" > > } #<<< This > > Line 19. > > > > $packages = {"httpd","mod_ssl","webalizer"} > > > This is not how you specify an array; use []. > > --Yup, Missed that one, I was trying to busy trying to figure out the other issue. Evan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Where''s this line type coming from that looks so useful :) ? Derek On Apr 25, 1:56 am, "Evan Hisey" <ehi...@gmail.com> wrote:> On Thu, Apr 24, 2008 at 5:56 PM, Luke Kanies <l...@madstop.com> wrote: > > > On Apr 24, 2008, at 4:40 PM, Evan Hisey wrote: > > > > file{"$docroot.conf": > > > path => "/etc/http/conf.d/DocumentRoot.conf", > > > content =>''# This file sets the webserver > > > Document Root > > > # dir for Apache. > > > DocumentRoot "$docroot"'', > > > There''s currently a filed bug about carriage returns in strings not > > counting against the line count. This string is messing up your line > > count. > > > > require => Line["$docroot"], > > > } > > > } > > > else { > > > $docroot = "/var/www/html" > > > } #<<< This > > > Line 19. > > > > $packages = {"httpd","mod_ssl","webalizer"} > > > This is not how you specify an array; use []. > > > -- > > Yup, Missed that one, I was trying to busy trying to figure out the other issue. > > Evan--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
DerekW schrieb:> Where''s this line type coming from that looks so useful :) ?http://reductivelabs.com/trac/puppet/wiki/CompleteConfiguration -> common -> http://git.black.co.at/?p=module-common;a=blob;f=manifests/defines/line.pp Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---