Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Execution of iptables_installed capabiltiy fails on Photon guest #263

Open
ghost opened this issue Sep 22, 2016 · 3 comments
Open

Execution of iptables_installed capabiltiy fails on Photon guest #263

ghost opened this issue Sep 22, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 22, 2016

I am using landrush to provision a project which consists of 3 machines. However, I encountered the following error message through vagrant up --provider=vmware_fusion. The box I used is from vmware/photon. I also test precise64-vmware box and it works fine. I wonder how to enable iptables_installed capability inside the vmware/photon box.

==> host-02.shawnho.taiwan: Machine booted and ready!
Vagrant attempted to execute the capability 'iptables_installed'
on the detect guest OS 'photon', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
@hferentschik
Copy link
Contributor

Landrush uses iptables inside of the guest to re-configure its DNS to reach out to the Landrush DNS server running on the host. To do so, Landrush needs to call two guest capabilities - iptables_installed and iptables_install. See also https://github.com/vagrant-landrush/landrush/tree/master/lib/landrush/cap/guest/debian as an example for Debian. There is no implementation for these capabilities for photon. How do you check on Photon whether a package is installed and how do you install it, if it is not available? A quick look seems to suggest that Photon is using its own package manager (tdnf), so one would indeed have to write some new guest capabilities (opposed to re-using existing ones).

Is this something you would be interested in contributing. The implementation should not be too hard.

@ghost
Copy link
Author

ghost commented Sep 28, 2016

Certainly. I checked photon actually has iptables v.1.6.0 installed as well as dnsmasq. I guess I need to implement couple check functions to validate these tests.
Is there any implementation guide I could check?

@hferentschik
Copy link
Contributor

I guess I need to implement couple check functions to validate these tests.
Is there any implementation guide I could check?

Not quite sure what you are asking. If you are asking for examples on how to write guest capabilities, have a look at the existing ones - see https://github.com/vagrant-landrush/landrush/tree/master/lib/landrush/cap/guest

Note, that guest can inherit of each other, for example debian inherits from linux, so linux capabilities are available for a debian guest as well. See also the relevant Vagrant documentation - https://www.vagrantup.com/docs/plugins/guest-capabilities.html.

In case you are asking about testing frameworks, you have two choices. Minispec is used for unit tests. You find some unit tests around capabilities here - https://github.com/vagrant-landrush/landrush/tree/master/test/landrush/cap/guest.

It might be simpler though to test end to end via the Cucumber integration tests - https://github.com/vagrant-landrush/landrush/tree/master/features. There you could configure a Vagrant setup using photon, booting it and then verify that all DNS works. In fact, if one where to add photon as example to this test - https://github.com/vagrant-landrush/landrush/blob/master/features/dns_resolution.feature#L34 and everything works, one is pretty much good to go.

Not sure whether this answers your question. Have a look at the README. It should tell you how to setup your environment and how to run the various tests.

If you like, give it a go and you can always ask questions when you get stuck. I am happy to help. Also check out the CONTRIBUTING page. It explains how we usually integrate changes into the code base (aka pull requests).

@hferentschik hferentschik changed the title iptables_installed fails at landrush 1.1.2 Execution of iptables_installed capabiltiy fails on Photon guest Oct 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant