Hi Trey,

On 23/06/12 23:37, treydock wrote:
> I'm attempting to manage my network interfaces through a homebrew module
> that takes input from hiera, and then uses augeas to define each ifcfg-*.
> 
> Example:
...
>       "set BONDING_OPTS '\"mode=${mode} miimon=${miimon}\"'",

This looks good to me.  The nested quotes in the middle are important,
as they're inside included in the value.

> When I try and set something like BONDING_OPTS="mode=0 miimon=100" I get
> the following in Puppet
> 
...
> debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set'
> with params
> ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/BONDING_OPTS",
> "mode=0 miimon=100"]

The issue looks to be here, as it's missing the second set of quotes.
Are you sure the log output corresponds to the manifest?  The manifest
looks correct, while the log output looks broken.

Running your manifest myself in 2.7.x, I see:

debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set'
with params
["/files/etc/sysconfig/network-scripts/ifcfg-bond0/BONDING_OPTS",
"\"mode=1 miimon=100\""]

Note the extra quotes.

> I also can't seem to get that value saved using augtool either, here's
> what I get
...
> augtool> set
> /files/etc/sysconfig/network-scripts/ifcfg-bond0/BONDING_OPTS '\"mode=0
> miimon=100\"'
> augtool> save
> error: Failed to execute command
> error: saving failed (run 'print /augeas//error' for details)

The issue here is a little different, remove the \ before ".  The reason
you need this in Puppet is because you're quoting the entire string in
the Puppet DSL, so need to escape the inner quotes.

augtool> set
/files/etc/sysconfig/network-scripts/ifcfg-bond0/BONDING_OPTS '"mode=0
miimon=100"'
augtool> save
Saved 1 file(s)

Cheers,

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to