Closed remkolodder closed 6 years ago
Thanks for the note. If you take that manifest by itself, copy it to a host that you want to apply that to, and run puppet apply -v --debug gre2.pp
, that should give enough detail about what is being called for us to dig.
Hi,
Thanks.. and being new to this... how does that work?
I took the bsd::interfaces:gre { ... } part and it complaints on the machine that it cannot find that. So I included 'include bsd' in the mini-manifest, but that doesn't work either. also not on the puppet-master where the stuff should be known. Obviously I am not entirely sure that I am doing the right thing.. so if you have some additional pointers.. please :)
Oh right I needed a modulepath:
Debug: Creating default schedules Debug: Loaded state in 0.12 seconds Debug: Loaded state in 0.15 seconds Debug: Loaded transaction store file in 0.06 seconds Info: Applying configuration version '1518077097' Debug: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd::Network::Interface::Cloned[gre2]/Shellvar[cloned_interfaces_gre2]/notify: subscribes to Bsd_interface[gre2] Notice: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd::Network::Interface::Cloned[gre2]/Shellvar[cloned_interfaces_gre2]/value: value changed ['lo1 gre0 gre1'] to 'gre2' Info: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd::Network::Interface::Cloned[gre2]/Shellvar[cloned_interfaces_gre2]: Scheduling refresh of Bsd_interface[gre2] Debug: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd::Network::Interface::Cloned[gre2]/Shellvar[cloned_interfaces_gre2]: The container Bsd::Network::Interface::Cloned[gre2] will propagate my refresh event Debug: Prefetching freebsd resources for bsd_interface Debug: Executing: '/sbin/ifconfig -C' Debug: Executing: '/sbin/ifconfig' Debug: Executing: '/usr/sbin/service netif restart gre2' Notice: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd_interface[gre2]: Triggered 'refresh' from 1 events Debug: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd_interface[gre2]: The container Bsd::Network::Interface[gre2] will propagate my refresh event Debug: Bsd::Network::Interface::Cloned[gre2]: The container Bsd::Network::Interface[gre2] will propagate my refresh event Debug: Bsd::Network::Interface[gre2]: The container Class[Main] will propagate my refresh event Debug: Class[Main]: The container Stage[main] will propagate my refresh event Debug: Finishing transaction 17249234480 Debug: Storing state Debug: Stored state in 0.14 seconds Notice: Applied catalog in 1.43 seconds Debug: Applying settings catalog for sections reporting, metrics Debug: Finishing transaction 17255420860
That is the output of the debug command for the gre interface. It does a cloned gre2 interface, but it doesn't seem to call anything for writing the config to /etc/rc.conf for gre2 (before the netif restart gre2 part).
What does the fact cloned_interfaces
contain on your system?
Just to confirm also, are you running the latest tag of this repo?
yes. I manually adopted the latest version for cloned_interfaces.rb to include the confine part.
is this what you are looking for?
["bridge", "vmnet", "tap", "pflog", "gre", "ipsec", "gif", "tun", "lo", "vlan", "usbus", "wlan"]
I'm not able to reproduce this issue. I'm running 5.3.3 on 11.1-RELEASE-p4, and with the original manifest that you provided, I get a gre2 interface with my existing cloned_interfaces= appended to include the gre2 interface. Do you have other interfaces that are being cloned? Have you met the dependencies in the metadata.json? I'm wondering if there might be a missing augeas provider in your environment.
Looking at this issue though, I do notice that puppet complains about a dependency that is not actually required, so I'll update the metadata for that.
Hi,
I have other interfaces being cloned, gre1, which is not in puppet (yet). What I said, it adds gre2 to the cloned_interfaces line, which is fine. But for some reason it does not add an ifconfig_gre2="" line with the proper configuration. What module is required for that ifconfig line part? I can ofcourse check to see whether I have that or not, but I Do not recall seeing that it is missing ;-)
Cheers, Remko
Oh, you're right. I misread. I'll run a test again and check the right thing this time. :)
no problemo ofcourse :-) I am already happy that you want to share your time by looking into it!
This is totally a bug in the rc_conf processing not handling the raw_configs and we've not been testing for this. I only ever used the raw_values on OpenBSD, so I've added a test for FreeBSD that points out my errors. I'll come back.
raw_values
, the get joined with a space. I'm not sure what to do with the description.If you are in a position to test that code, I'd appreciate it. It worked for me here, but I'm not actually constructing the tunnel with another box, so you tell me if the config ends up correct.
Hi,
I will add it to my configuration and test it :)
I'll get back asap!
That did not solve it.. I removed all gre configurations from the host, without removing gre0 (which is an interface that actively use to get the configuration on the machine ;-)). I renamed gre2 to gre1 so that it gets next to gre0.
Notice: /Stage[main]/Main/Node[mx2.jr-hosting.org]/Bsd::Network::Interface[gre1]/Bsd::Network::Interface::Cloned[gre1]/Shellvar[cloned_interfaces_gre1]/value: value changed ['lo1 gre0'] to 'gre1' Info: /Stage[main]/Main/Node[mx2.jr-hosting.org]/Bsd::Network::Interface[gre1]/Bsd::Network::Interface::Cloned[gre1]/Shellvar[cloned_interfaces_gre1]: Scheduling refresh of Bsd_interface[gre1] Notice: /Stage[main]/Main/Node[mx2.jr-hosting.org]/Bsd::Network::Interface[gre1]/Bsd_interface[gre1]: Triggered 'refresh' from 1 events
cloned_interfaces="lo1 gre0 gre1"
but no ifconfig_gre1.. :)
May I see the debug output for the latest code version please? There is a debug line I'm curious about in the new code.
could it be that my shell_config module interferes with the shell_config/shell_var?
for the record that is: csail-shell_config
Maybe, but I'd have to look under the hood to know why. I switched to the augeas providers a few years ago and haven't looked back, as they've been quite stable. If you wouldn't mind testing with the dependencies listed in the metadata that would at least rule it out.
OK, let me see what I can do tonight. I See that the augeasproviders_shellvar might replace the shell_config part. Will be experimenting with it since I only use it to toggle /etc/rc.conf values at the moment.
So I removed shell_Config and replaced it with shellvar. I managed to get it 1:1. Does not matter for the gre interface though.
Is #112 actually doing writing the rc.conf data ? or is it just modelling it? (I do not understand enough of it to know for sure) :)
In #112 the to_create_resources
method is being extended to include the raw_values
data. This data structure matches what is required by the create_resources
function. You can see the call here:
https://github.com/xaque208/puppet-bsd/blob/master/manifests/network/interface.pp#L109
The debug output should have the data structure printing out so we know what at least is going on in that function.
OK, I will produce the debug output, because it doesn't print anything int he config. The same goes for gif, which I just tested as well :-)
Also one minor nit for the documentation, there is a parents => 'interface', mentioned but it should be parents => [ 'interface' ], instead, it expects either an undef or Array instead of a string (as reported by puppet to me moments ago ;)).
OK from the puppetmaster it does something now;
(Which I didn't expect given that the configuration is not send to the host itself. Could that mean that there are missing dependencies or something? I cannot run it from the host itself because I need to point to the modulespath and if I point it to /var/puppet/lib it doesn't contain the bsd module.
Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::bsd for host at /usr/home/remko/gre2.pp:1:2 on node host
Debug: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Bsd::Network::Interface::Cloned[gre2]/Shellvar[cloned_interfaces_gre2]/notify: subscribes to Bsd_interface[gre2] Notice: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Shellvar[ifconfig_gre2]/value: value changed ['A.A.A.A B.B.B.A netmask 255.255.255.252 tunnel HOST_A HOST_B up'] to '3.3.3.2 3.3.3.1 netmask 255.255.255.252 tunnel 2.2.2.2 1.1.1.1 up' Info: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Shellvar[ifconfig_gre2]: Scheduling refresh of Bsd_interface[gre2] Debug: /Stage[main]/Main/Bsd::Network::Interface[gre2]/Shellvar[ifconfig_gre2]: The container Bsd::Network::Interface[gre2] will propagate my refresh event
restarting puppetserver seems to have assisted with this so that it does something now ...
Oh good, that looks like progress. For my testing, I rsynced my production/
code deploy to the host and copied in the file I changed to verify with puppet apply
and some --environmentdir
or some thing sprinkled in. I can get specifics when I'm back on my other machine. In any case, that looks right. Is this resolved with the merge of #112 then? If so I'll get that merged now. As mentioned, I'm not sure what to do with the description, as in where in rc.conf to put it, but I think we can solve that after merge.
Hi,
Yes it seems to work now, please merge it. I copied your versions verbatim so they are the same and it gets applied now.. (it didn't even on the master before your changes).
We can add that to the interface as well:
gif0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1280 description: test interface to
scratch that, it isn't so simple to add it as 'description "description test"', to the raw_values array.
Thanks for the testing and reporting the issue. #112 has been merged.
Hi,
Using puppet4 it does not seem to work when using gre interfaces;
For example I have this code in my node manifest :
bsd::network::interface { 'gre2': ensure => 'up', description => "Tunnel interface ${hostname} to XXX", parents => [ 'vtnet0' ], raw_values => [ "${tunneladdress_gre2} netmask 255.255.255.252 tunnel ${ipaddresses_v4} ${tunnel_destination_gre2} up" ], }
If the cloned_interfaces= already exists in rc.conf it doesn't do anything. If the gre2 interface is not available there yet, it will get added. The code also creates gre2, but there is no rc.conf information for it, so the interface remains empty..
How can I investigate what is going on and see what I am doing wrong? :-)
Thanks for all your hard work though, I do really appreciate it and I am leveraging it more and more!