Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redhat provider is not removing lines from files that are not resource properties #138

Open
lukebigum opened this issue Feb 2, 2016 · 1 comment

Comments

@lukebigum
Copy link
Contributor

The Red Hat provider is not "purging" lines from a network_config file on disk that are not properties of the resource, or even if the property is explicitly set to undef.

The following manifest test1.pp applied first:

network_config { 'eth99':
  ensure      => present,
  onboot      => 'yes',
  ipaddress   => '192.168.0.1',
  netmask     => '255.255.255.0',
  method      => 'none',
  reconfigure => false,
  options     => {
    type   => 'Ethernet',
  }
}

Will create /etc/sysconfig/network-scripts/ifcfg-eth99 as expected (ignore MTU=absent, the bug will be fixed with #137):

IPADDR=192.168.0.1
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
DEVICE=eth99
HOTPLUG=yes
MTU=absent
type=Ethernet

However the manifest test2.pp applied immediately after will not, Puppet thinks there are no changes to apply:

network_config { 'eth99':
  ensure      => present,
  onboot      => 'yes',
  method      => 'none',
  reconfigure => false,
  options     => {
    type      => 'Ethernet',
  }
}

The result is the IPADDR and NETMASK lines will be left in the interface config file after test2.pp is applied, despite the fact that the resource possesses no corresponding parameters.

The result I expect would be to "purge" unnecessary lines from every interface config file. If you don't do this, it would be impossible to convert an interface from having an IP address to not having an IP address, for example, plus many other cases.

If you are able to run Beaker / Vagrant acceptance tests, I've added two tests to https://github.com/lukebigum/puppet-network/tree/redhat_provider_debugging that demonstrate the problem. I've also been able to reproduce this on voxpupuli/puppet-network Master on my local Fedora 23 machine as well, just using "puppet apply" with the above.

I'm not sure if this is a property of the redhat provider or if it's something to do with filemapper.

@jyaworski
Copy link
Member

Does this work in the git version of filemapper from voxpupuli?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants