summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2020-11-09 12:53:11 -0800
committerMatt Clay <matt@mystile.com>2020-11-09 15:30:23 -0800
commit0ea82ba7113b2541d1838ff1cd17cb9786794682 (patch)
tree29f900d86bd8425cce9d6b3d10c4cb41293522dc
parent2529281ed82765045296016d7c50b55721818a28 (diff)
downloadansible-0ea82ba7113b2541d1838ff1cd17cb9786794682.tar.gz
[stable-2.8] Fix container discovery for the acme test plugin.
(cherry picked from commit f022dedd0a37ffa5fbe39b6e9e8aac52d799ca7b) Co-authored-by: Matt Clay <matt@mystile.com>
-rw-r--r--changelogs/fragments/ansible-test-acme-test-plugin.yml2
-rw-r--r--test/runner/lib/cloud/acme.py10
2 files changed, 8 insertions, 4 deletions
diff --git a/changelogs/fragments/ansible-test-acme-test-plugin.yml b/changelogs/fragments/ansible-test-acme-test-plugin.yml
new file mode 100644
index 0000000000..7df85120ea
--- /dev/null
+++ b/changelogs/fragments/ansible-test-acme-test-plugin.yml
@@ -0,0 +1,2 @@
+minor_changes:
+ - ansible-test - Fix container hostname/IP discovery for the ``acme`` test plugin.
diff --git a/test/runner/lib/cloud/acme.py b/test/runner/lib/cloud/acme.py
index 233ad80178..27f8cb3a23 100644
--- a/test/runner/lib/cloud/acme.py
+++ b/test/runner/lib/cloud/acme.py
@@ -134,7 +134,7 @@ class ACMEProvider(CloudProvider):
else:
display.info('Starting a new ACME docker test container.', verbosity=1)
- if not self.args.docker and not container_id:
+ if not container_id:
# publish the simulator ports when not running inside docker
publish_ports = [
'-p', '5000:5000', # control port for flask app in container
@@ -154,14 +154,16 @@ class ACMEProvider(CloudProvider):
if self.args.docker:
acme_host = self.DOCKER_SIMULATOR_NAME
- acme_host_ip = self._get_simulator_address()
elif container_id:
acme_host = self._get_simulator_address()
- acme_host_ip = acme_host
display.info('Found ACME test container address: %s' % acme_host, verbosity=1)
else:
acme_host = get_docker_hostname()
- acme_host_ip = acme_host
+
+ if container_id:
+ acme_host_ip = self._get_simulator_address()
+ else:
+ acme_host_ip = get_docker_hostname()
self._set_cloud_config('acme_host', acme_host)