Closed itsgudenuf closed 3 years ago
@bwlinux wow thank you so much! im def going to dig into this later today. To make a pull request first fork the repo and make your changes then navigate here and submit your request. https://github.com/pry0cc/axiom/pulls. If yoy dont get around to making the request nw. i'll take care of it hopefully later today. :) Cheers!
@0xtavian please check the pull request #286. I think I managed to do it.
I've got a few more coming...
merged! Thanks again. Im adding the cleanup to the ssh config to the other provides are well. Going to close this issue but feel free to open a new one or reopen this one if u run into issues
pull request #286 broke the opposite case - sort of - where there are other non-axiom droplets "without" floating IP. The generated sshconfig has no IP added to the HostName part for non-axiom droplets
That's really strange @KrE80r . I thought I tested for that.
Are you saying it looks something like this??
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
ServerAliveInterval 60
Host Test01
HostName
User op
Port 2266
Host Test02
HostName
User op
Port 2266
@KrE80r i dont think that is the case. If you are having trouble with DO its most likely because of https://github.com/pry0cc/axiom/issues/272#issuecomment-821017660
That's really strange @KrE80r . I thought I tested for that.
Are you saying it looks something like this??
Host * ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 600 ServerAliveInterval 60 Host Test01 HostName User op Port 2266 Host Test02 HostName User op Port 2266 ``
Indeed but only the non-axiom droplet is missing the IP.
@KrE80r i dont think that is the case. If you are having trouble with DO its most likely because of #272 (comment)
issue #272 pops-up later. Here are more details
running axiom-playbook I get errors like
/root/.axiom/tmp/dnsx+1618570803/sshconfig line 8: Missing argument
Line 8 contains
Host box.example.com
HostName
Where "box.example.com" is a non-axiom droplet I have with no floating IP, and it uses a FQDN.
Other axiom droplets do have ips added to them as expected in sshconfig.
Reverting the below line did get the IP added to sshconfig as expected
ip=$(echo "$droplets" | jq -r ".[] | select(.name==\"$name\") | .networks.v4[] | select(.type==\"public\") | .ip_address")
@KrE80r could you trying something to make sure it works for both of us.
Change that line to the following:
ip=$(echo "$droplets" | jq -r ".[] | select(.name==\"$name\") | .networks.v4[] | select(.type==\"public\") | .ip_address " | head -1)
I think the problem is related to jq using a 0 or 1 based array index. The 'head -1' should insure we just take the first line returned regardless.
Could you also run the following:
$ doctl version
doctl version 1.45.0-release
Git commit hash: 5fc8b1a
release 1.59.0 is available, check it out!
$ jq -V 2 ⨯
jq-1.6
Just started with Axiom today after watching the NahamCon video this morning. So everything is fresh....
I already had servers running at Digital Ocean, and both have Floating IPs. This causes the following error... /home/kali/.axiom/.sshconfig: line 9: Bad configuration option: XXX.XXX.XXX.XXX /home/kali/.axiom/.sshconfig: line 15: Bad configuration option: XXX.XXX.XXX.XXX /home/kali/.axiom/.sshconfig: terminating, 2 bad configuration options
Looking into the functions.sh generate_sshconfig() I found the problem...
Specifically it's the following line:
When I look at the output of jq prior to the .ipaddress selector I see the following on droplets with a Floating IP
changing the network selector from:
to
appears to correct the problem.
To make the code block cleaner I also moved the "Host *" information out of the for loop.
Here's the working function looks like now...
I'm sorry I don't know how to make PRs and submit the change. I will learn though... This is a great framework!