mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow the user to declare an env var to set the vcsim container image
This commit is contained in:
parent
21cdddce74
commit
e5eedfe4b8
1 changed files with 7 additions and 2 deletions
|
@ -40,7 +40,10 @@ class VcenterProvider(CloudProvider):
|
|||
super(VcenterProvider, self).__init__(args, config_extension='.ini')
|
||||
|
||||
# The simulator must be pinned to a specific version to guarantee CI passes with the version used.
|
||||
self.image = 'ansible/ansible:vcenter-simulator@sha256:1a92e84f477ae4c45f9070a5419a0fc2b46abaecdb5bc396826741bca65ce028'
|
||||
if os.environ.get('ANSIBLE_VCSIM_CONTAINER'):
|
||||
self.image = os.environ.get('ANSIBLE_VCSIM_CONTAINER')
|
||||
else:
|
||||
self.image = 'ansible/ansible:vcenter-simulator@sha256:1a92e84f477ae4c45f9070a5419a0fc2b46abaecdb5bc396826741bca65ce028'
|
||||
self.container_name = ''
|
||||
|
||||
def filter(self, targets, exclude):
|
||||
|
@ -118,7 +121,9 @@ class VcenterProvider(CloudProvider):
|
|||
else:
|
||||
publish_ports = []
|
||||
|
||||
docker_pull(self.args, self.image)
|
||||
if not os.environ.get('ANSIBLE_VCSIM_CONTAINER'):
|
||||
docker_pull(self.args, self.image)
|
||||
|
||||
docker_run(
|
||||
self.args,
|
||||
self.image,
|
||||
|
|
Loading…
Reference in a new issue