-
Notifications
You must be signed in to change notification settings - Fork 447
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
Policy does not trigger automatic software install if host was removed from software scope then re-added (using labels) #25071
Comments
Note:
When you do those steps, the software won't be reinstalled. I think this may be similar because the policy runs once and fails, identifies the software is not installed, and issues the install command. Because we cancel that command as soon as we change the scope, when the policy fails again, it doesn't re-issue the install command. I see in our doc Automatic software install in fleet it says: |
So, single-attempt installs were what was originally spec'd, and I don't think we want to change that behavior. However as future work (out of scope for this ticket) we could (likely should) provide enough information to orbit to indicate which policy an install was for, so orbit can rerun that policy's query and report back the result after a successful install (we can't just use the install success as a proxy for policy pass because the query may be looking for multiple things). Probably same with policy-initiated script runs, though that can be separate work, likely at lower priority. Idea being that we can remove the one-hour window where someone could uninstall successfully-installed policy-initiated software and then never get an install attempt until the installer or policy was modified. With that out of the way, the current issue is that bringing hosts into scope via labels for an automation doesn't reset the policy status for those hosts, and it should, since "we brought the host in scope for a policy-automated install by changing labels for the installer" is comparable to "we brought the host in scope for a policy-automated install by adding an install automation to the policy", just for hosts in that team in (or outside) that label, rather than for hosts merely in that team. We don't need to clear stats when a host goes out of scope via labels, as no action is required there. We do when the host comes back in scope.
|
Per discussions earlier, what we need to do here is, on installer label scope changes:
The stats/aggregations cron will repopulate policy stats, and host policy check-ins will repopulate status information, with the opportunity for hosts to go from blank to failed, triggering the automation again, solving this bug. |
Fleet version: v4.62.0
Web browser and operating system: Chrome 131.0.6778.205 on macOS
💥 Actual behavior
Policy runs and fails but software install is not triggered - there is no pending install for the software title queued in the Upcoming activity
🧑💻 Steps to reproduce
Testing scope
)🕯️ Expected results
Now that the host is back within the scope of the software target via label, the failed policy should trigger a software install on the host.
The text was updated successfully, but these errors were encountered: