User story #10326
closed2 non-contradictory rules cause rule display to spin
Description
I set up 2 MOTD directives, one that puts text at the beginning of the file, and one that puts text at the end.
The first one is attached to the global rule, and second on a group ("All CentOS nodes"). The intent here is that the standard motd would be shown upon login for all servers, but those about to undergo maintenance will show the additional message at the bottom.
When the directive indicating that text should be added to the bottom is created, the system appears to save it, but the rule display just shows the spinning circle graphic constantly and the rule is never applied (screenshots attached).
Files
Updated by Vincent MEMBRÉ over 7 years ago
- Target version changed from 4.1.0~rc1 to 4.1.0
Updated by François ARMAND over 7 years ago
- Assignee set to Nicolas CHARLES
- Target version deleted (
4.1.0)
Hello,
For the spinning wheel, what is the version you are using? We corrected something related since 4.1-beta3, so perhaps you hitted the bug.
For your use case... It feels perfectly valide. Unfortunatly, it won't be possible to do like that with the provided Motd technique. That technique is "unique", like for example "time setting", meaning that only one directive derived from it can be applied at the same time on a node. You can see that trait in the technical details, but given you feedback, we need to make it much more apparent and clear.
When several directive derived from a unique technique are configured on one node, the most propritary is chosen (and if priorities are equals, the first by name).
Now that you are talking about it, I don't know why Motd is unique. For "time setting", it is clear: you need to apply only one ntp config, having several has little meaning. But for Motd, I don't know. Perhaps Nicolas would have an insight?
Updated by Hamlyn Mootoo over 7 years ago
I am using a new installation 4.1-beta3. I don't know why the server relay package is also installed. I assume it does that by default?
[root@rserver ~]# yum list rudder-server*
Loaded plugins: product-id, rhui-lb, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
rudder-server-relay.x86_64 1398866025:4.1.0.beta3-1.EL.6 @Rudder_4.1
rudder-server-root.noarch 1398866025:4.1.0.beta3-1.EL.6 @Rudder_4.1
Available Packages
rudder-server-relay.i686 1398866025:4.1.0.beta3-1.EL.6 Rudder_4.1
Updated by Nicolas CHARLES over 7 years ago
Hello Hamlyn,
As François mentionned, MOTD is a "unique" Technique, meaning you can have only one at a time on a given node; historically, it managed the motd file as a whole, so didn't leave room for partial editing; plus in earlier version of Rudder, changes were not easy to see.
And we kept the "unique" flag over the time.
That being said, you applied directives based on a unique technique on two different rules - so there's been erasure of one of them at policy generation time. That why you get a spinning wheel on the second Rule: no directives are effectively applied to this rules, so there is no compliance, so spinning wheel.
Erasure is made based on Directive priority, and for equal priority based on the Directive name - so a Directive with highest priority will win over a Directive with lower priority.
For your maintenance case, the correct solution would be to have the Directive that sets the MOTD message for maintenance with priority "0", so that this one will be taken into account for node in maintenance mode; and leave the standard one with priority 5 (and make it manage the whole file, so that when a node is not in maintenance mode anymore, it will remove the maintenance message)
And in case you missed the Priority field, it is in the Directive form, between the Description and Policy Mode
Does it make sense ?
Updated by Hamlyn Mootoo over 7 years ago
Yes thank you, this worked very well. Have you ever considered adding a button at the bottom or top of each directive labeled something like "Tips" or "Tips for this Directive" which would include mini use cases or the explanation you gave? Alternatively (or in addition to), a section in the documentation for "Directive Tips" would be great. I know there is a use-case section, but that seems to be more for the overall product than directive-specific.
Updated by Benoît PECCATTE almost 7 years ago
- Target version set to Ideas (not version specific)
Updated by Nicolas CHARLES over 6 years ago
- Related to User story #7616: Overriden directives are not listed in reports information added
Updated by Nicolas CHARLES over 6 years ago
- Status changed from New to Rejected
Hi Hamlyn
Thank you for this suggestion - this has been implemented in https://www.rudder-project.org/redmine/issues/7616
I'm closing this ticket has it has been fixed in another issue