summaryrefslogtreecommitdiff
path: root/subplot/subplot.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-10-07 07:23:42 +0300
committerLars Wirzenius <liw@liw.fi>2020-10-07 07:23:42 +0300
commitc1de4c4760367361c96081d96ae03293bc49bb18 (patch)
tree6d8615c175427e426aea8b279d00d0c891d6c87c /subplot/subplot.py
parent746ddbc6e17d9ab8238cc4a8e3a348ccb44878b5 (diff)
downloaddebian-ansible-c1de4c4760367361c96081d96ae03293bc49bb18.tar.gz
fix: use a random port for Qemu client
Diffstat (limited to 'subplot/subplot.py')
-rw-r--r--subplot/subplot.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/subplot/subplot.py b/subplot/subplot.py
index 4434f24..c9c3cdc 100644
--- a/subplot/subplot.py
+++ b/subplot/subplot.py
@@ -81,6 +81,8 @@ def run_playbook(ctx):
assert_ne = globals()["assert_ne"]
srcdir = globals()["srcdir"]
+ qemu = ctx["qemu"]
+
with open("hosts", "w") as f:
f.write("test-host\n")
@@ -98,7 +100,7 @@ def run_playbook(ctx):
"-ostricthostkeychecking=accept-new",
"-i",
os.path.join(srcdir, "ssh", "id"),
- "-p2222",
+ f"-p{qemu.get_port()}",
]
env = dict(os.environ)
@@ -112,7 +114,7 @@ def run_playbook(ctx):
"hosts",
f"-e@vars.yml",
"-eansible_ssh_host=localhost",
- "-eansible_ssh_port=2222",
+ f"-eansible_ssh_port={qemu.get_port()}",
"playbook.yml",
]