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 manditory parameters */
  augeas { "eth_bond_${name}" :
    context => "/files/etc/sysconfig/network-scripts/ifcfg-${name}",
    changes => [
      "set DEVICE ${name}",
      "set BONDING_OPTS '\"mode=${mode} miimon=${miimon}\"'",
      "set BOOTPROTO none",
      "set USERCTL no",
      "set ONBOOT yes",
      "set MTU ${mtu}",
      "set IPADDR ${ip}",
      "set NETMARK ${netmask}",
    ],  
    notify  => Exec["if-refresh-${name}"],
  }


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): Opening augeas with root /, 
lens path , flags 0
debug: Augeas[eth_bond_bond0](provider=augeas): Augeas version 0.9.0 is 
installed
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/DEVICE", "bond0"]
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"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/BOOTPROTO", 
"none"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/USERCTL", "no"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/ONBOOT", "yes"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/MTU", "9344"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/IPADDR", 
"192.168.1.100"]
debug: Augeas[eth_bond_bond0](provider=augeas): sending command 'set' with 
params ["/files/etc/sysconfig/network-scripts/ifcfg-bond0/NETMARK", 
"255.0.0.0"]
debug: Augeas[eth_bond_bond0](provider=augeas): Closed the augeas connection
err: 
/Stage[main]/Networking/Networking::Bond[bond0]/Augeas[eth_bond_bond0]/returns: 
change from need_to_run to 0 failed: Save failed with return code false
notice: 
/Stage[main]/Networking/Networking::Bond[bond0]/Exec[if-refresh-bond0]: 
Dependency Augeas[eth_bond_bond0] has failures: true
warning: 
/Stage[main]/Networking/Networking::Bond[bond0]/Exec[if-refresh-bond0]: 
Skipping because of failed dependencies


I also can't seem to get that value saved using augtool either, here's what 
I get

# cat ifcfg-bond0 
BOOTPROTO=none
ONBOOT=yes
MTU=4000
IPADDR=192.168.1.100
NETMARK=255.0.0.0
DEVICE=bond0

# augtool 
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)
augtool> print /augeas//error
/augeas/files/etc/sysconfig/network-scripts/ifcfg-bond0/error = "put_failed"
/augeas/files/etc/sysconfig/network-scripts/ifcfg-bond0/error/path = 
"/files/etc/sysconfig/network-scripts/ifcfg-bond0"
/augeas/files/etc/sysconfig/network-scripts/ifcfg-bond0/error/lens = 
"/usr/share/augeas/lenses/dist/shellvars.aug:61.12-.77:"
/augeas/files/etc/sysconfig/network-scripts/ifcfg-bond0/error/message = 
"Malformed child node 'BONDING_OPTS'"

Any ideas?  The documentation on Puppet Augeas (
http://projects.puppetlabs.com/projects/1/wiki/Puppet_Augeas#ifcfg+BONDING_OPTS)
 
has this exact example, so I figured there's something very obvious I'm 
overlooking that's keeping this from working.

Currently affected host and Puppet master are 2.6.16, CentOS 6.2, 
augeas-0.9.0.

Thanks
- Trey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/uI3T5XevDgsJ.
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