Skip to content
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

ENT-9402: Added policy to facilitate migration of ignore_interfaces.rx from inputdir to workdir (3.21.x) #2767

Closed
wants to merge 1 commit into from

Conversation

larsewi
Copy link
Contributor

@larsewi larsewi commented Nov 16, 2023

No description provided.

…utdir to workdir

This change aims to increase awareness of the change in behavior for the
location of the ignore_interfaces.rx file. It emits reports about the presence
and status of the file.

In order to further facilitate the migration, this policy will copy the file
from inputdir to workdir if the class
default:mpf_auto_migrate_ignore_interfaces_rx_to_workdir is defined and the
file is present.

Ticket: ENT-9402
Changelog: Title
(cherry picked from commit 249f380)
Signed-off-by: Lars Erik Wik <[email protected]>

Prior to `3.23.0` this file was expected to be found in
`$(sys.inputdir)/ignore_interfaces.rx`. Beginning with `3.23.0` preference is
given to `$(sys.workdir)/ignore_interfaces.rx` if it is found and `WARNING` is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
given to `$(sys.workdir)/ignore_interfaces.rx` if it is found and `WARNING` is
given to `$(sys.workdir)/ignore_interfaces.rx`. A `WARNING` is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, seeing the policy below I see that it is both a WARNING and a report. Maybe mention the report here as well?

given to `$(sys.workdir)/ignore_interfaces.rx` if it is found and `WARNING` is
emitted by cfengine if the file is found only in `$(sys.inputdir)`.

When the class `default:mpf_auto_migrate_ignore_interfaces_rx_to_workdir` is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the default to NOT auto migrate? Might be good to mention that as well here.

{
"classes": {
"default:mpf_auto_migrate_ignore_interfaces_rx_to_workdir": {
"class_expressions": "cfengine_3_23|cfengine_3_24",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would seem most useful to define a class_expression that specified 3.23.0 and later releases right? Hmm.

MPF.md Show resolved Hide resolved
# The preferred location for ignore_interfaces.rx changed from
# $(sys.inputdir)/ignore_interfaces.rx to $(sys.workdir)/ignore_interfaces.rx in
# 3.23.0, versions lower than 3.23.0 only look for the file in inputdir and
# messages relating to the preferred location change are irrelevant.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this "and messages relating..." sentence is talking about? If the messages are irrelevant why are we keeping them? Are we keeping them?

# inputdir and emits messages about its presence. Additionally, the file is
# automatically copied if the file is present in inputdir and the class
# default:mpf_auto_migrate_ignore_interfaces_rx_to_workdir is defined (not
# defined by default).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there we go, it is not defined by default, which is what I assumed but I think you should explicitly state that in the md file above.

# defined by default).
{
meta:
"tags" slist => { "cfengine_recommends" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what impact does this have? Do we use this somewhere or have used it previously? Interesting, just in this file I guess. @nickanderson was there a plan to leverage this tag somehow? More curious than anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing last night I found that it wasn't working, it was searching for the wrong tag. So, it should have been used but was not.

" policy input directory so that it's easier to",
" ignore different interfaces on different hosts.");

default:cfengine_3::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cfengine_3 here? Is ignore_interfaces.rx only in version >=3? Not that we do much with version <3.

@nickanderson
Copy link
Member

@larsewi I have a pr doing a little refactor here to prep for backport.
#2766

@nickanderson
Copy link
Member

Superseded by #2768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants