appsembler / sultan

An Open edX Remote Devstack Toolkit
GNU Affero General Public License v3.0
7 stars 4 forks source link

does not work with non-RSA ssh keys #18

Closed thraxil closed 4 years ago

thraxil commented 4 years ago

On my workstation, I use ed25519 SSH keys. Something in make instance.setup is ignoring the SSH_KEY set in .configs.anders (or as a variable in the shell) and defaulting to $HOME/.ssh/id_rsa, which in my case doesn't exist.

eg,

grep SSH_KEY .configs.anders                                                                             
SSH_KEY="$(HOME)/.ssh/id_ed25519"
$ make instance.setup                                                      
Flush pip packages...
make[1]: Entering directory '/home/anders/work/sultan'
Installing project requirements...
make[2]: Entering directory '/home/anders/work/sultan'
Updating your inventory credentials...    (dynamic-inventory/gce.ini)
/home/anders/.ssh/id_rsa: No such file or directory
make[2]: *** [targets/local.mk:47: local.inventory.config] Error 1
make[2]: Leaving directory '/home/anders/work/sultan'
make[1]: *** [Makefile:38: ve/bin/ansible-playbook] Error 2
make[1]: Leaving directory '/home/anders/work/sultan'
make: *** [Makefile:68: clean] Error 2

Same error even if I do SSH_KEY=/home/anders/id_ed25519 make instance.setup

iamjazzar commented 4 years ago

Thanks for reporting @thraxil. Can you check if #19 solves the issue on your end?

thraxil commented 4 years ago

@ahmedaljazzar I did some more digging and figured out that it wasn't reading my .configs.anders and everything was staying with the defaults defined in .configs.

Experimenting with that, what I learned was that the include configs* that is the first line of the Makefile wasn't including files in sorted order. So it includes .configs.anders, then .configs and the latter overrides everything, setting it all back to the defaults.

This turns out to be because GNU Make 3.82 stopped sorting wildcards:

WARNING: Backward-incompatibility! Wildcards were not documented as returning sorted values, but the results have been sorted up until this release.. If your makefiles require sorted results from wildcard expansions, use the $(sort ...) function to request it explicitly.

It's been re-added in Make 4.3, but I've got 4.2.1 (and that's default on Ubuntu 20.04). Fix is to explicitly sort the includes. PR incoming for that.