-
Notifications
You must be signed in to change notification settings - Fork 63
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
allow fetching REX keys from the API #282
Conversation
Not tested either, but that's the right way to do it. LGTM! |
2693368
to
492f5cf
Compare
if options.remote_exec_proxies: | ||
listproxies = options.remote_exec_proxies.split(",") | ||
for proxy_fqdn in listproxies: | ||
remote_exec_url = "https://" + str(proxy_fqdn) + ":9090/ssh/pubkey" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not great if we ever move around the smart proxy port or someone configures it differently. Fine to keep, worth noting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, will add to the longish "refactor&improve" list :)
""" | ||
Download and install all Foreman's SSH public keys. | ||
""" | ||
url = "https://" + options.foreman_fqdn + ":" + str(API_PORT) + "/api/v2/smart_proxies/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use some apypie love (if it wasn't designed as a stand-alone script to install).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bootstrap.py has to run on python with only stdlib available :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions:
- if this requires a specific version of REX, is there any way to check for that version and fail gracefully if not?
- Doesn't the API require auth for most things? so wouldn't you have to ensure that the user has authenticated when using this capability?
I can look into this. But the code will fail gracefully anyways, as in older versions there would be just no key listed, and then we don't add it. But we also don't tell the user that we didn't.
Correct, this only works if you pass user/password. Want me to add a check for that? |
Needs an ole rebase! |
rebased |
this requires REX 1.6.7 or newer to be installed
* Bugfix for REX authorized_keys permission handling (Katello#298) * Improve error message and allow non-existing files for --rex-authpath (Katello#299) * Improve --rex-urlkeyfile help text (Katello#293) * Default bootstrap.py to install katello-host-tools and omit the katello-agent package (Katello#258) * Improve output when using the rex options (Katello#291) * Don't fail if yum clean fails (Katello#289) * Don't use json.loads to generate dicts (Katello#288) * Bugfix: don't build a newly created host (Katello#287) * Call rhn-migrate-classic-to-rhsm with --remove-rhn-packages (Katello#137) * Allow fetching REX keys from the API (Katello#282)
* Bugfix for REX authorized_keys permission handling (#298) * Improve error message and allow non-existing files for --rex-authpath (#299) * Improve --rex-urlkeyfile help text (#293) * Default bootstrap.py to install katello-host-tools and omit the katello-agent package (#258) * Improve output when using the rex options (#291) * Don't fail if yum clean fails (#289) * Don't use json.loads to generate dicts (#288) * Bugfix: don't build a newly created host (#287) * Call rhn-migrate-classic-to-rhsm with --remove-rhn-packages (#137) * Allow fetching REX keys from the API (#282)
this requires REX 1.6.7 or newer to be installed
includes #281
so far untested :)