-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fixes #8952: Add generic methods using new package promises #427
Fixes #8952: Add generic methods using new package promises #427
Conversation
WIP |
# ``` | ||
# methods: | ||
# "any" usebundle => package_present("postgresql", "9.1", "x86_64", "enforce"); | ||
# "any" usebundle => package_present("postgresql", "lastest", "default", "enforce"); |
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.
s/lastest/latest/
Commit modified |
e9b37ca
to
3689453
Compare
Commit modified |
3689453
to
512289a
Compare
|
||
debian.architecure_specified.version_specified:: | ||
"${name}" | ||
policy => "present", |
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.
could you align the => , please ?
Thank you !
Commit modified |
512289a
to
0005020
Compare
|
||
} | ||
|
||
body package_module apt_get |
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.
shouldn't this body be in the ncf_lib?
Plus it seem it doesn't do anything on redhat like system (nor suse)
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.
It is still a WIP, I will add Red Hat support after. The body is there for convenience, it will be moved in a "3.7 ncf_lib" after.
Commit modified |
0005020
to
125acc6
Compare
Commit modified |
125acc6
to
78c0504
Compare
Commit modified |
78c0504
to
68d6d68
Compare
|
||
vars: | ||
"canonified_name" string => canonify("${name}"); | ||
"old_class_prefix" string => "package_present_${canonified_name}"; |
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.
shouldn't it be package_absent ?
Commit modified |
68d6d68
to
4d74f0d
Compare
Commit modified |
4d74f0d
to
d6dc5a2
Compare
body package_module yum | ||
{ | ||
# Query package updates only every 24 hours. | ||
query_updates_ifelapsed => "1440"; |
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.
@ncharles How do do you think we should make this configurable?
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.
i can make a dumb answer: add parameters in the body
a more clever answer would be to have logical default, and be able to define them globally (it doesn't make sense to have different values for different package on a given node). So it may be a generic method "configure package update frequency" that would define it through a bundle common something.
What do you think of it ?
Commit modified |
d6dc5a2
to
fb9f99b
Compare
Commit modified |
fb9f99b
to
855e3dd
Compare
Commit modified |
855e3dd
to
738ec96
Compare
It's time to implement drop-down / multiple selection lists in ncf builder :) cc @VinceMacBuche @RaphaelGauthier |
OK, thanks, Alexis. I'll ask @aanriot to test then. |
Commit modified |
baf570f
to
c0a0305
Compare
|
We still have two open questions: Distributing the modulesNormation/rudder-techniques#1029. Configuring the modulesEach module needs a body like:
We should probably have default values and can make them overridable:
I think I prefer the second, as it is really a global configuration parameter and not a part of any policy (like execution frequency for example). |
c0a0305
to
9092690
Compare
|
9092690
to
e16124d
Compare
Added a zypper module based on the yum module. Commands and options are adapted, but the logic from parsing zypper output is not there yet. |
e16124d
to
b345837
Compare
Added parsing for the list of available updates. We still need:
|
Commit modified |
b345837
to
fb551ca
Compare
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.
This is one impressive piece of work - i do have some questions (as comments in the PR)
@@ -0,0 +1,57 @@ | |||
bundle common acc_path |
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.
You are missing the header of the file
@@ -0,0 +1,361 @@ | |||
#!/usr/bin/python |
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.
shouldn't we mention somewhere that it comes from the CFEngine repository ?
@@ -0,0 +1,408 @@ | |||
#!/usr/bin/python |
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.
same here
@@ -0,0 +1,394 @@ | |||
#!/usr/bin/python |
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.
shouldn't we add our header ?
"architecture_specified" not => strcmp("default", "${architecture}"); | ||
|
||
# Select the right package manager | ||
# Always use the specified one, and select a default based on the OS |
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.
i don't understand how the default one would be selected
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.
because of the "provider" string => "${package_module_knowledge.platform_default}", if_match_regex => "default";
above.
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.
But this comment should be moved.
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.
thanks
Commit modified |
fb551ca
to
dab2c0a
Compare
"architecture" string => "default", if_match_regex => ""; | ||
"provider" string => "default", if_match_regex => ""; | ||
# Select the default packager for this platform if "default" | ||
"provider" string => "${package_module_knowledge.platform_default}", if_match_regex => "default"; |
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.
can you chain the default (does it work as expected ?)
Commit modified |
dab2c0a
to
1a04fab
Compare
Commit modified |
1a04fab
to
7fb553c
Compare
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.
This is great !
This PR is not mergeable to upper versions. |
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/8952