Ok,
I found the problem.
On the line with:
$addr = $net$ip
Should look like this:
$addr = "$net$ip"
Plus a quick "thank you" to Peter Bukowinski for the correction, I have
clean running test code.
--
James
On Thursday, December 11, 2014 11:23:51 AM UTC-8, James Taylor wrote:
>
> Hello all,
>
> I am working with an issue that has me tied up in knots. I have a group of
> machines that will have structured names (i.e. prj-sfo-ibm-102.foo.com).
> I want to use the host name to assign IP addresses to the machine, since
> each host name has a locator (sfo), vendor (ibm), and node number ("1"
> signifies a virtual machine and the "02" is the node number). Here is what
> I have come up with:
>
> __________________________
>
> node
> /^prj-(sfo|nyc)-(ibm|apple|maxtor|quantum|intel)-1(0|1)(0|1|2|3|4|5|6|7|8|9)\.foo\.com$/
>
> {
>
> $h = split($hostname,"-")
>
> $site = $h[1]
>
> $vendor = $h[2]
>
> case $vendor {
>
>
> ibm : {
>
> $net = "10.227.140."
> $mask = "255.255.255.248"
> $ip = "171"
> $addr = $net$ip
>
> }
>
> default: {
>
> notice { "Vendor item in hostname is out of scope."},
> err { "Vendor item in hostname is out of scope."},
>
> }
>
> }
>
>
> file {"/root/temp.txt":
>
> content => "
> $hostname $site $vendor $net $mask $ip $addr
> ",
>
> owner => root,
> group => group,
>
>
> }
>
> }
>
> __________________________
>
> I am using the hostname prj-sfo-ibm-102.foo.com but the structure keeps
> breaking with a "Syntax error at '}'; expected '}' at
> /etc/puppet/manifests/nodes.pp:19 on node prj-sfo-ibm-102.foo.com"
>
> I have looked in a couple of books and a number of websites, the structure
> looks correct... A little help?
>
>
> --
> James
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/add966ad-7bbc-4267-9a99-31deb5269a38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.