All types using static default values for parameters should use the new way of defining them #251

Closed
opened 2021-11-20 15:22:32 +00:00 by ungleich-gitea · 8 comments

Created by: asteven

Otherwise we will have more errors similar to #228.

*Created by: asteven* Otherwise we will have more errors similar to #228.
ungleich-gitea added this to the future milestone 2021-11-20 15:22:32 +00:00
ungleich-gitea added the
Stale
label 2021-11-20 15:22:32 +00:00
Author
Owner

closed

closed
Author
Owner

Created by: telmich

Hey Jake,

Jake Guffey [Tue, Jan 21, 2014 at 01:31:00PM -0800]:

@telmich @dheule
Yes, this is a bug. I'm not sure how that one slipped through. Thanks for pointing it out!

dheule has very good eyes!

Regarding support for jails in FreeBSD 9/10, I suggest the following:

- if the jail is still the same (logically) in 10:
    - Create 2 new types: 
        - __freebsd_jail_10
        - __freebsd_jail_9
    (or similar names, __jail_freebsd10 is probably even better)
    - Make __jail select the right type depending on OS / os version
        - very similar to package
- if it is a different beast
    - create a new type with different functionality

HTH,

Nico

p.s.: I wrote the text above before finishing your mail, but your last
chapter is mostly what I agree with. Maybe it is not even
necessary to have a lot of code duplication, if the both work
totally different?

Since FreeBSD 10.0 has been released this week (and that means a bunch of changes to jail infrastructure), I'll be introducing a major revision to the code sometime in the next few weeks to a month to handle things the new way. If this bug hasn't been patched by that time, I'll include a fix.

Also, I'd like your opinions on the changes I'm going to make. FreeBSD 9 and below handled jail configuration as this type is designed. 10, on the other hand, has moved almost everything out of rc.conf into other configuration files. This is the primary change that I need to write into the type. I could make the type only work on 10, I could make it handle 9 and 10 side by side, or I could create a new type that only works on 10, leaving the current __jail type intact. Handling both configuration types would make the code in the cdist type significantly larger, but would provide compatibility with just about everything. Creating a new type would wind up with a lot of redundant code, which doesn't strike me as optimal, either (in addition to needing a new way of handling type naming, i.e. __jail just figures out which OS is in use and then requires __jail_freebsd9 or __jail_freebsd10 or something).

What is your preference moving forward?


Reply to this email directly or view it on GitHub:
https://github.com/telmich/cdist/issues/229#issuecomment-32965769

PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0

*Created by: telmich* Hey Jake, Jake Guffey [Tue, Jan 21, 2014 at 01:31:00PM -0800]: > @telmich @dheule > Yes, this is a bug. I'm not sure how that one slipped through. Thanks for pointing it out! dheule has very good eyes! Regarding support for jails in FreeBSD 9/10, I suggest the following: ``` - if the jail is still the same (logically) in 10: - Create 2 new types: - __freebsd_jail_10 - __freebsd_jail_9 (or similar names, __jail_freebsd10 is probably even better) - Make __jail select the right type depending on OS / os version - very similar to package - if it is a different beast - create a new type with different functionality ``` HTH, Nico p.s.: I wrote the text above before finishing your mail, but your last chapter is mostly what I agree with. Maybe it is not even necessary to have a lot of code duplication, if the both work totally different? > Since FreeBSD 10.0 has been released this week (and that means a bunch of changes to jail infrastructure), I'll be introducing a major revision to the code sometime in the next few weeks to a month to handle things the new way. If this bug hasn't been patched by that time, I'll include a fix. > > Also, I'd like your opinions on the changes I'm going to make. FreeBSD 9 and below handled jail configuration as this type is designed. 10, on the other hand, has moved almost everything out of rc.conf into other configuration files. This is the primary change that I need to write into the type. I could make the type only work on 10, I could make it handle 9 and 10 side by side, or I could create a new type that only works on 10, leaving the current __jail type intact. Handling both configuration types would make the code in the cdist type significantly larger, but would provide compatibility with just about everything. Creating a new type would wind up with a lot of redundant code, which doesn't strike me as optimal, either (in addition to needing a new way of handling type naming, i.e. __jail just figures out which OS is in use and then requires __jail_freebsd9 or __jail_freebsd10 or something). > > What is your preference moving forward? > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/telmich/cdist/issues/229#issuecomment-32965769 ## PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
Author
Owner

Created by: asteven

Jake Guffey wrote on 01/21/2014 10:31 PM:

__jail just figures out which OS

+1

*Created by: asteven* Jake Guffey wrote on 01/21/2014 10:31 PM: > __jail just figures out which OS +1
Author
Owner

Created by: jdguffey

@telmich @dheule
Yes, this is a bug. I'm not sure how that one slipped through. Thanks for pointing it out!

Since FreeBSD 10.0 has been released this week (and that means a bunch of changes to jail infrastructure), I'll be introducing a major revision to the code sometime in the next few weeks to a month to handle things the new way. If this bug hasn't been patched by that time, I'll include a fix.

Also, I'd like your opinions on the changes I'm going to make. FreeBSD 9 and below handled jail configuration as this type is designed. 10, on the other hand, has moved almost everything out of rc.conf into other configuration files. This is the primary change that I need to write into the type. I could make the type only work on 10, I could make it handle 9 and 10 side by side, or I could create a new type that only works on 10, leaving the current __jail type intact. Handling both configuration types would make the code in the cdist type significantly larger, but would provide compatibility with just about everything. Creating a new type would wind up with a lot of redundant code, which doesn't strike me as optimal, either (in addition to needing a new way of handling type naming, i.e. __jail just figures out which OS is in use and then requires __jail_freebsd9 or __jail_freebsd10 or something).

What is your preference moving forward?

*Created by: jdguffey* @telmich @dheule Yes, this is a bug. I'm not sure how that one slipped through. Thanks for pointing it out! Since FreeBSD 10.0 has been released this week (and that means a bunch of changes to jail infrastructure), I'll be introducing a major revision to the code sometime in the next few weeks to a month to handle things the new way. If this bug hasn't been patched by that time, I'll include a fix. Also, I'd like your opinions on the changes I'm going to make. FreeBSD 9 and below handled jail configuration as this type is designed. 10, on the other hand, has moved almost everything out of rc.conf into other configuration files. This is the primary change that I need to write into the type. I could make the type only work on 10, I could make it handle 9 and 10 side by side, or I could create a new type that only works on 10, leaving the current __jail type intact. Handling both configuration types would make the code in the cdist type significantly larger, but would provide compatibility with just about everything. Creating a new type would wind up with a lot of redundant code, which doesn't strike me as optimal, either (in addition to needing a new way of handling type naming, i.e. __jail just figures out which OS is in use and then requires __jail_freebsd9 or __jail_freebsd10 or something). What is your preference moving forward?
Author
Owner

Created by: telmich

Yes, I think this is a bug.

Jake, what do you say? It should be

jaildir="$(cat "$__object/parameter/jaildir")"

shouldn't it?

dheule [Tue, Jan 21, 2014 at 01:12:44PM -0800]:

Hello Nico,

im on the way to fix this bug,
but on __jail i have found a statement
which i don't understand:

if [ -f "$__object/parameter/jaildir" ]; then
jaildir="$(cat "$__object/parameter/name")"
else
jaildir="/usr/jail"
fi

--> if the parameter jaildir exist, load value of name ???
is this correct ? I think not ...


Reply to this email directly or view it on GitHub:
https://github.com/telmich/cdist/issues/229#issuecomment-32964012

PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0

*Created by: telmich* Yes, I think this is a bug. Jake, what do you say? It should be ``` jaildir="$(cat "$__object/parameter/jaildir")" ``` shouldn't it? dheule [Tue, Jan 21, 2014 at 01:12:44PM -0800]: > Hello Nico, > > im on the way to fix this bug, > but on __jail i have found a statement > which i don't understand: > > if [ -f "$__object/parameter/jaildir" ]; then > jaildir="$(cat "$__object/parameter/name")" > else > jaildir="/usr/jail" > fi > > --> if the parameter jaildir exist, load value of name ??? > is this correct ? I think not ... > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/telmich/cdist/issues/229#issuecomment-32964012 ## PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
Author
Owner

Created by: dheule

Hello Nico,

im on the way to fix this bug,
but on __jail i have found a statement
which i don't understand:

if [ -f "$__object/parameter/jaildir" ]; then
jaildir="$(cat "$__object/parameter/name")"
else
jaildir="/usr/jail"
fi

--> if the parameter jaildir exist, load value of name ???
is this correct ? I think not ...

*Created by: dheule* Hello Nico, im on the way to fix this bug, but on __jail i have found a statement which i don't understand: if [ -f "$__object/parameter/jaildir" ]; then jaildir="$(cat "$__object/parameter/name")" else jaildir="/usr/jail" fi --> if the parameter jaildir exist, load value of name ??? is this correct ? I think not ...
Author
Owner

Created by: asteven

Nico Schottelius wrote on 12/18/2013 05:22 PM:

Just for those like me who forget what new is: use state and pass state on to other used types

nope, what I meant was:

mkdir parameter/default
echo present > parameter/default/state
echo root > parameter/default/owner

By doing this, the defaults end up in $__object/parameter/state resp.
$__object/parameter/owner

*Created by: asteven* Nico Schottelius wrote on 12/18/2013 05:22 PM: > Just for those like me who forget what new is: use state and pass state on to other used types nope, what I meant was: ``` mkdir parameter/default echo present > parameter/default/state echo root > parameter/default/owner ``` By doing this, the defaults end up in $__object/parameter/state resp. $__object/parameter/owner
Author
Owner

Created by: telmich

Just for those like me who forget what new is: use state and pass state on to other used types

*Created by: telmich* Just for those like me who forget what new is: use state and pass state on to other used types
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#251
No description provided.