-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Change gateway settings not working #1375
Comments
Does it fix your problem if you 'invert' your settings? def fulldeploy():
with settings(gateway='root@l-bastion'):
execute(copy_live)
with settings(gateway='root@q-bastion'):
execute(restore) |
@kaaveland No, it isn't fix. Only connect on first gateway and don't disconnect for this if you want connect to other one on same execution. Fabric ignore this. It's very frustrating because many devops works with bastion models. |
Yeah, we have the same model at work, but I've been able to do this in the past. If I recall correctly, I used some workaround (which is why I tried suggesting the above) and had it work fine, I'll take a look later (hopefully tonight) and see if I can find out how we actually dealt with this. |
Nice @kaaveland, many thx! Now, i've fix it with execute 2 commands, but i want to be able on only one. it's a poor patch, but i've hope that your search to be successfully 💃 |
I was unable to find anything in our scripts for this, I had remembered a different gateway-related problem. I'm not longer sure I understand what you mean. I have have the following servers: app-server-1, which is only reachable through bastion-1. And app-server-2, which is only reachable through bastion-2. app-server-1 can't reach app-server-2 and bastion-1 can't reach bastion-2. Is that correct? I had assumed that you wanted to do something like move data from app-server-1 to app-server-2. So I made the following minimal fab-file: from fabric.api import env, run, task, settings, execute, hosts
@hosts(['app-server-1'])
def get_info_1():
with settings(gateway='bastion-1'):
run("hostname")
@hosts(['app-server-2'])
def get_info_2():
with settings(gateway='bastion-2'):
run("hostname")
def full():
execute(get_info_1)
execute(get_info_2) And that seems to work fine for me. I can execute this both as Have I misunderstood what your problem is? What do you want your program to look like? |
I've found my mistake. I'm always using by default on my all fabric scripts this option env.use_ssh_config = True I've seen that if it's true, script access to .ssh/config for see if it have this login into file. And only connect to first site, and abort login on second one. @kaaveland many thx for your support 👍 |
Cool, happy to see you solved your problem :-) |
Explain my problem.
I need to enter on two bastion server for supply a few script. And i use settings for add information to gateway variable for change address to the bastions servers.
if i make this:
the variable for gateway don't modify the attribute for second setting and reconnect to live env and make all script exec on live again. But if only execute one def, works perfect.
I don't know if a bug or i have made a programming mistake.
The text was updated successfully, but these errors were encountered: