-
Notifications
You must be signed in to change notification settings - Fork 55
Network type and provider #47
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
base: master
Are you sure you want to change the base?
Conversation
i think i'd leave the defined type in for now, and replace its guts with a call to the type. |
I think keeping the defined type will only increase the complexity with the added layers. The current tests in spec/defines/network_spec.rb are checking that defining a resource produses an exec resource with the correct command, so they couldn't be used as is. |
I think the curent state should sufice to show the design for the provider. Although this will only update the stored config so the network would need to restarted to affect the running config. |
@jaggededgedjustice i haven't had any time :(mostly due to my involvement in @puppet-community): |
This is great! It looks like the same code could be used to manage non-libvirt interfaces too, like https://github.com/raphink/puppet-netcf |
@beddari most likely, since libvirt makes use of netcf internally. |
end | ||
|
||
def create | ||
# @property_hash = @resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why this code is commented out?
can we do better here? Or should we just remove #create
altogether, seeing as this is done in #flush
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented out line is leftover from some experimentation, I'll remove it. The create
function must exist, even if it's empty, otherwise puppet will throw an error.
@jaggededgedjustice do you have any opinions on @beddari's and @raphink's comments? |
@beddari, It might be possible, I've never encountered netcf before. Although the config schema for netcf and libvirt looks much the same there are some differences, such as the open vswitch ports that libvirt has which netcf does not. It may be possible to share the code for parsing the current state of a resource between this project and pupet-netcf. But maybe not, libvirt has its own config parser/generator which is used internally, so although the two schemas look the same they might be different enough that sharing code is pointless. Though it would be worth looking into in the future. |
@jaggededgedjustice do you wanna pick this up again and rebase it? |
I'm hoping to be able to get the rebase done this weekend, RL has been conspiring against me recently. |
use property_hash for all values in template
3cdcb11
to
108b2a1
Compare
k, rebase done |
superb. I'll try rewrite the unit tests next week. |
@thias ping / merge :D |
This is an alternative to #25 using the libvirt api instead of shelling out to virsh, and maintains the current resource definition interface.
This only a demonstartion at this point, to be useable it would require converting the settings to properties. It also lacks working tests.