-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fact 'rhsm_repos' shouldn't depend on a web API call #18
Comments
Hi @tux-o-matic, thanks for reporting this. Are you able to provide a patch? |
@bastelfreak how would you suggest to cache the result of a command called by Facter? |
I thought of a cronjob which calls the api from time to time, the fact than just parses the cronjob output. Or: The cron writes the result into /etc/facter/facts.d/ @bbriggs Can we have your opinion here as well? |
I can get the same output as the current Fact based on subscription-manager but 10 second fast with yum repolist | grep "Red Hat" | cut -d " " -f 1 |
Sounds way easer than deploying a cronjob/systemd timer. Can we do something with one pipe? yum repolist | awk '/Red Hat/ {print $1}' Can you provide a PR with a fix? |
@bastelfreak I have one ready, can submit PR once #17 is merged. |
Today the only Fact shipped in this module, 'rhsm_repos', calls a sub command of subscription-manager which can take quite a while to return as it depends on API calls to Red Hat's subscription servers.
It could be more efficient to base the Fact on 'yum repolist'.
Adding 10 sec to each run on all Red Hat nodes is no good, the bright side is that the Fact wasn't committed to a valid path. Since it's not in lib/facter/, it doesn't get executed by the agent. Of course that is an issue by itself.
The text was updated successfully, but these errors were encountered: