From 95b3ad536c3d74d38e108aed2d855798306c0f39 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 11:52:29 +0200 Subject: [PATCH 01/21] Update driver.py Add possibility of setting podman executable through environment variable --- src/molecule_podman/driver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index b1e3b85..d54deb7 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -29,6 +29,7 @@ from molecule.util import lru_cache log = logger.get_logger(__name__) +podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") class Podman(Driver): @@ -164,7 +165,7 @@ def name(self, value): @property def login_cmd_template(self): return ( - "podman exec " + f"{podman_exec} exec " "-e COLUMNS={columns} " "-e LINES={lines} " "-e TERM=bash " @@ -184,7 +185,7 @@ def login_options(self, instance_name): return {"instance": instance_name} def ansible_connection_options(self, instance_name): - return {"ansible_connection": "podman"} + return {"ansible_connection": "podman", "ansible_podman_executable": f"{podman_exec}"} @lru_cache() def sanity_checks(self): From fd55f1cee299da872166405742d406ffb9fb068a Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 11:58:50 +0200 Subject: [PATCH 02/21] Update create.yml Add podman_exec variable to enable using other podman executables, by setting environment variable MOLECULE_PODMAN_EXECUTABLE --- src/molecule_podman/playbooks/create.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/molecule_podman/playbooks/create.yml b/src/molecule_podman/playbooks/create.yml index 7f29b63..7a46a26 100644 --- a/src/molecule_podman/playbooks/create.yml +++ b/src/molecule_podman/playbooks/create.yml @@ -5,10 +5,12 @@ gather_facts: false no_log: "{{ molecule_no_log }}" become: "{{ not (item.rootless|default(true)) }}" + vars: + podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}" tasks: - name: Log into a container registry command: > - podman login + {{ podman_exec }} login --username {{ item.registry.credentials.username }} --password {{ item.registry.credentials.password }} --tls-verify={{ item.tls_verify | default(lookup('env', 'DOCKER_TLS_VERIFY')) or false }} @@ -54,6 +56,7 @@ - name: Discover local Podman images containers.podman.podman_image_info: name: "molecule_local/{{ item.item.name }}" + executable: "{{ podman_exec }}" with_items: "{{ platforms.results }}" loop_control: label: "{{ item.item.name | default('None specified') }}" @@ -63,7 +66,7 @@ - name: Build an Ansible compatible image # noqa: no-handler command: > - podman build + {{ podman_exec }} build -f {{ item.dest }} -t molecule_local/{{ item.item.image }} {% if item.item.buildargs is defined %}{% for i,k in item.item.buildargs.items() %}--build-arg={{ i }}={{ k }} {% endfor %}{% endif %} @@ -96,7 +99,7 @@ # https://github.com/ansible-community/molecule-podman/issues/22 - name: Remove possible pre-existing containers command: > - podman rm -f -i -v {% for key in molecule_yml.platforms %}{{ key.name }} {% endfor %} + {{ podman_exec }} rm -f -i -v {% for key in molecule_yml.platforms %}{{ key.name }} {% endfor %} register: result changed_when: true failed_when: false @@ -104,6 +107,7 @@ - name: Discover local podman networks containers.podman.podman_network_info: name: "{{ item.network }}" + executable: "{{ podman_exec }}" loop: "{{ molecule_yml.platforms | flatten(levels=1) }}" loop_control: extended: true @@ -117,6 +121,7 @@ - name: Create podman network dedicated to this scenario containers.podman.podman_network: name: "{{ podman_network.results[0].ansible_loop.allitems[0].network }}" + executable: "{{ podman_exec }}" subnet: "{{ podman_network.results[0].ansible_loop.allitems[0].subnet }}" when: @@ -126,7 +131,7 @@ - name: Create molecule instance(s) command: > - podman + {{ podman_exec }} {% if item.cgroup_manager is defined %}--cgroup-manager={{ item.cgroup_manager }}{% endif %} {% if item.storage_opt is defined %}--storage-opt={{ item.storage_opt }}{% endif %} {% if item.storage_driver is defined %}--storage-driver={{ item.storage_driver }}{% endif %} From 7cf1f9cb857eab37d71e0594f14c645ad3a242ad Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 12:00:27 +0200 Subject: [PATCH 03/21] Update destroy.yml Add podman_exec variable to enable using other podman executables, by setting environment variable MOLECULE_PODMAN_EXECUTABLE --- src/molecule_podman/playbooks/destroy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/molecule_podman/playbooks/destroy.yml b/src/molecule_podman/playbooks/destroy.yml index 71389dd..1f3e1b7 100644 --- a/src/molecule_podman/playbooks/destroy.yml +++ b/src/molecule_podman/playbooks/destroy.yml @@ -5,9 +5,11 @@ gather_facts: false no_log: "{{ molecule_no_log }}" become: "{{ not (item.rootless|default(true)) }}" + vars: + podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}" tasks: - name: Destroy molecule instance(s) - shell: podman container exists {{ item.name }} && podman rm -f {{ item.name }} || true + shell: "{{ podman_exec }} container exists {{ item.name }} && {{ podman_exec }} rm -f {{ item.name }} || true" register: server with_items: "{{ molecule_yml.platforms }}" async: 7200 From 4ee84b2f008c5bf58cf50d507586cba754421cf2 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:07:50 +0200 Subject: [PATCH 04/21] Update README.rst Update with short explanation on how to change podman executable --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index c15e6a7..2a84d59 100644 --- a/README.rst +++ b/README.rst @@ -26,6 +26,13 @@ This plugin requires `containers.podman` collection to be present: Please note that this driver is currently in its early stage of development. +Change podman executable +------------------------ + +To change the podman executable from the standard podman, export environment variable MOLECULE_PODMAN_EXECUTABLE. For instance if you wish to run molecule with podman-remote instead of ordinary podman, the variable can be exportet as: + +export MOLECULE_PODMAN_EXECUTABLE=podman-remote + .. _get-involved: Get Involved From 29163e8136950ddf9a7f71319cbb12c657a34e55 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:12:36 +0200 Subject: [PATCH 05/21] Update README.rst Make bold instead of subtitle --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2a84d59..d6a795f 100644 --- a/README.rst +++ b/README.rst @@ -26,8 +26,7 @@ This plugin requires `containers.podman` collection to be present: Please note that this driver is currently in its early stage of development. -Change podman executable ------------------------- +**Change podman executable** To change the podman executable from the standard podman, export environment variable MOLECULE_PODMAN_EXECUTABLE. For instance if you wish to run molecule with podman-remote instead of ordinary podman, the variable can be exportet as: From 59e5894000996cd15edfb7f3c83e094ee4884e7d Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:14:42 +0200 Subject: [PATCH 06/21] Update driver.py Add comment to explain how to change podman executable --- src/molecule_podman/driver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index d54deb7..0d9fb0c 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -29,6 +29,7 @@ from molecule.util import lru_cache log = logger.get_logger(__name__) +# To change the podman executable, set environment variable MOLECULE_PODMAN_EXECUTABLE. An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") From 8865a451d1f36509b6690ba8e471afa8b6c241d4 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:36:39 +0200 Subject: [PATCH 07/21] Update driver.py Divide comment into two lines --- src/molecule_podman/driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 0d9fb0c..fa4c649 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -29,7 +29,8 @@ from molecule.util import lru_cache log = logger.get_logger(__name__) -# To change the podman executable, set environment variable MOLECULE_PODMAN_EXECUTABLE. An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote +# To change the podman executable, set environment variable MOLECULE_PODMAN_EXECUTABLE +# An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") From 9c9f52dbb1f4c2927a30f644b01c62ac8939eb40 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:38:53 +0200 Subject: [PATCH 08/21] Update driver.py Divide comment into three lines --- src/molecule_podman/driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index fa4c649..63e5650 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -29,7 +29,8 @@ from molecule.util import lru_cache log = logger.get_logger(__name__) -# To change the podman executable, set environment variable MOLECULE_PODMAN_EXECUTABLE +# To change the podman executable, set environment variable +# MOLECULE_PODMAN_EXECUTABLE # An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") From 4b55cfe8ba72d573719e0fadd7e111b6b142e2ba Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:29:04 +0200 Subject: [PATCH 09/21] Update driver.py Change formatting of ansible_connection_options --- src/molecule_podman/driver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 63e5650..c2cdcbb 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -188,7 +188,10 @@ def login_options(self, instance_name): return {"instance": instance_name} def ansible_connection_options(self, instance_name): - return {"ansible_connection": "podman", "ansible_podman_executable": f"{podman_exec}"} + return { + "ansible_connection": "podman", + "ansible_podman_executable": f"{podman_exec}" + } @lru_cache() def sanity_checks(self): From 807e4b4828194e2260561ae985eeb79debcd830e Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Tue, 10 Aug 2021 16:23:18 +0200 Subject: [PATCH 10/21] Update driver.py add comma in ansible_connection_options --- src/molecule_podman/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index c2cdcbb..7b1c47e 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -190,7 +190,7 @@ def login_options(self, instance_name): def ansible_connection_options(self, instance_name): return { "ansible_connection": "podman", - "ansible_podman_executable": f"{podman_exec}" + "ansible_podman_executable": f"{podman_exec}", } @lru_cache() From 6af84372a6e793e82d228ba9decb6fa100118053 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 08:49:28 +0200 Subject: [PATCH 11/21] Update README.rst Change from bold to title Co-authored-by: Sviatoslav Sydorenko --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d6a795f..0077fb2 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,8 @@ This plugin requires `containers.podman` collection to be present: Please note that this driver is currently in its early stage of development. -**Change podman executable** +Change podman executable +======================== To change the podman executable from the standard podman, export environment variable MOLECULE_PODMAN_EXECUTABLE. For instance if you wish to run molecule with podman-remote instead of ordinary podman, the variable can be exportet as: From 58b850734af5ee9cc2719065a75751242a60ed22 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 08:49:49 +0200 Subject: [PATCH 12/21] Update README.rst Co-authored-by: Sviatoslav Sydorenko --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0077fb2..336faca 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,10 @@ Please note that this driver is currently in its early stage of development. Change podman executable ======================== -To change the podman executable from the standard podman, export environment variable MOLECULE_PODMAN_EXECUTABLE. For instance if you wish to run molecule with podman-remote instead of ordinary podman, the variable can be exportet as: +To change the podman executable from the standard podman, export environment +variable ``MOLECULE_PODMAN_EXECUTABLE``. For instance, if you wish to run +molecule with ``podman-remote`` instead of ordinary ``podman``, the variable +can be exported as: export MOLECULE_PODMAN_EXECUTABLE=podman-remote From 8030ee7aa5aa03d2420d55076bb33cb8b80856ab Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 08:50:02 +0200 Subject: [PATCH 13/21] Update README.rst Co-authored-by: Sviatoslav Sydorenko --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 336faca..eb797d4 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,9 @@ variable ``MOLECULE_PODMAN_EXECUTABLE``. For instance, if you wish to run molecule with ``podman-remote`` instead of ordinary ``podman``, the variable can be exported as: -export MOLECULE_PODMAN_EXECUTABLE=podman-remote +.. code-block:: console + + $ export MOLECULE_PODMAN_EXECUTABLE=podman-remote .. _get-involved: From 4a0ff0b3b7bcdfe71f4ced1b6fa8eeee25d0f585 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 10:08:06 +0200 Subject: [PATCH 14/21] Update driver.py Move definition of podman_exec out of the module-level + add step to find full path for podman_exec and give error, if it can't be found --- src/molecule_podman/driver.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 7b1c47e..ed87c1b 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -29,11 +29,6 @@ from molecule.util import lru_cache log = logger.get_logger(__name__) -# To change the podman executable, set environment variable -# MOLECULE_PODMAN_EXECUTABLE -# An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote -podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") - class Podman(Driver): """ @@ -155,7 +150,16 @@ class Podman(Driver): def __init__(self, config=None): """Construct Podman.""" super(Podman, self).__init__(config) - self._name = "podman" + self._name = "podman" + # To change the podman executable, set environment variable + # MOLECULE_PODMAN_EXECUTABLE + # An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote + self.podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman") + self.podman_cmd = distutils.spawn.find_executable(self.podman_exec) + if not self.podman_cmd: + msg = f"command not found in PATH {self.podman_exec}" + util.sysexit_with_message(msg) + @property def name(self): @@ -168,7 +172,7 @@ def name(self, value): @property def login_cmd_template(self): return ( - f"{podman_exec} exec " + f"{self.podman_cmd} exec " "-e COLUMNS={columns} " "-e LINES={lines} " "-e TERM=bash " @@ -190,7 +194,7 @@ def login_options(self, instance_name): def ansible_connection_options(self, instance_name): return { "ansible_connection": "podman", - "ansible_podman_executable": f"{podman_exec}", + "ansible_podman_executable": f"{self.podman_exec}", } @lru_cache() From 2a981734925bd3686e641be813c22b3c3428da8e Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 10:48:16 +0200 Subject: [PATCH 15/21] Update create.yml Add task to determine path to podman executable + use path to poodman executable in podman login and build commands --- src/molecule_podman/playbooks/create.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/molecule_podman/playbooks/create.yml b/src/molecule_podman/playbooks/create.yml index 7a46a26..dc3fab4 100644 --- a/src/molecule_podman/playbooks/create.yml +++ b/src/molecule_podman/playbooks/create.yml @@ -8,9 +8,15 @@ vars: podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}" tasks: + - name: get podman executable path + command: which {{ podman_exec }} + register: podman_cmd + environment: + PATH: "{{ ansible_env.PATH}}:/sbin:/usr/sbin" + - name: Log into a container registry command: > - {{ podman_exec }} login + {{ podman_cmd }} login --username {{ item.registry.credentials.username }} --password {{ item.registry.credentials.password }} --tls-verify={{ item.tls_verify | default(lookup('env', 'DOCKER_TLS_VERIFY')) or false }} @@ -66,7 +72,7 @@ - name: Build an Ansible compatible image # noqa: no-handler command: > - {{ podman_exec }} build + {{ podman_cmd }} build -f {{ item.dest }} -t molecule_local/{{ item.item.image }} {% if item.item.buildargs is defined %}{% for i,k in item.item.buildargs.items() %}--build-arg={{ i }}={{ k }} {% endfor %}{% endif %} @@ -99,7 +105,7 @@ # https://github.com/ansible-community/molecule-podman/issues/22 - name: Remove possible pre-existing containers command: > - {{ podman_exec }} rm -f -i -v {% for key in molecule_yml.platforms %}{{ key.name }} {% endfor %} + {{ podman_cmd }} rm -f -i -v {% for key in molecule_yml.platforms %}{{ key.name }} {% endfor %} register: result changed_when: true failed_when: false From 410c9819650482eb15edbe13bfc852a1e444ef4a Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:56:32 +0200 Subject: [PATCH 16/21] Update create.yml Also use path to executable in Create molecule instance + correct way path was stored as variable --- src/molecule_podman/playbooks/create.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/molecule_podman/playbooks/create.yml b/src/molecule_podman/playbooks/create.yml index dc3fab4..aa452ad 100644 --- a/src/molecule_podman/playbooks/create.yml +++ b/src/molecule_podman/playbooks/create.yml @@ -10,9 +10,12 @@ tasks: - name: get podman executable path command: which {{ podman_exec }} - register: podman_cmd + register: podman_path environment: - PATH: "{{ ansible_env.PATH}}:/sbin:/usr/sbin" + PATH: "{{ ansible_env.PATH}}:/sbin:/usr/sbin" + - name: save path to executable as fact + set_fact: + podman_cmd: "{{ podman_path.stdout }}" - name: Log into a container registry command: > @@ -137,7 +140,7 @@ - name: Create molecule instance(s) command: > - {{ podman_exec }} + {{ podman_cmd }} {% if item.cgroup_manager is defined %}--cgroup-manager={{ item.cgroup_manager }}{% endif %} {% if item.storage_opt is defined %}--storage-opt={{ item.storage_opt }}{% endif %} {% if item.storage_driver is defined %}--storage-driver={{ item.storage_driver }}{% endif %} From 717653621b225ad7d883dd824f2d4bc7c2a96003 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:12:10 +0200 Subject: [PATCH 17/21] Update driver.py Add importstatements --- src/molecule_podman/driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index ed87c1b..3ee85fb 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -22,6 +22,8 @@ from __future__ import absolute_import import os +from molecule import util +import distutils.spawn from typing import Dict from molecule import logger From 6fb9d569886abf090338d17a96f3ef444a465f66 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 20 Aug 2021 09:01:55 +0200 Subject: [PATCH 18/21] Update create.yml Fix linting errors --- src/molecule_podman/playbooks/create.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/molecule_podman/playbooks/create.yml b/src/molecule_podman/playbooks/create.yml index aa452ad..22a2f55 100644 --- a/src/molecule_podman/playbooks/create.yml +++ b/src/molecule_podman/playbooks/create.yml @@ -12,7 +12,8 @@ command: which {{ podman_exec }} register: podman_path environment: - PATH: "{{ ansible_env.PATH}}:/sbin:/usr/sbin" + PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" + changed_when: false - name: save path to executable as fact set_fact: podman_cmd: "{{ podman_path.stdout }}" From f312aea34d76a8a1ada2e8c3f39bd6fc8bde5e29 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 20 Aug 2021 09:09:33 +0200 Subject: [PATCH 19/21] Update create.yml Remove trailing whitespaces --- src/molecule_podman/playbooks/create.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/molecule_podman/playbooks/create.yml b/src/molecule_podman/playbooks/create.yml index 22a2f55..cbaeab5 100644 --- a/src/molecule_podman/playbooks/create.yml +++ b/src/molecule_podman/playbooks/create.yml @@ -12,8 +12,8 @@ command: which {{ podman_exec }} register: podman_path environment: - PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" - changed_when: false + PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" + changed_when: false - name: save path to executable as fact set_fact: podman_cmd: "{{ podman_path.stdout }}" From 5667bfe3caca17f9423bf9a15dbe6dc94f776f88 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 20 Aug 2021 10:08:49 +0200 Subject: [PATCH 20/21] Update driver.py fix linting issues --- src/molecule_podman/driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 3ee85fb..50f62f0 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -21,17 +21,17 @@ from __future__ import absolute_import -import os -from molecule import util import distutils.spawn +import os from typing import Dict -from molecule import logger +from molecule import logger, util from molecule.api import Driver from molecule.util import lru_cache log = logger.get_logger(__name__) + class Podman(Driver): """ The class responsible for managing `Podman`_ containers. From 039308e1f0d1a70c0245a265f32c7e1ea6b4a7b2 Mon Sep 17 00:00:00 2001 From: NikolineLykPedersen <88713323+NikolineLykPedersen@users.noreply.github.com> Date: Fri, 20 Aug 2021 10:23:11 +0200 Subject: [PATCH 21/21] Update driver.py Fix more linting issues --- src/molecule_podman/driver.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 50f62f0..a7ab208 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -152,7 +152,7 @@ class Podman(Driver): def __init__(self, config=None): """Construct Podman.""" super(Podman, self).__init__(config) - self._name = "podman" + self._name = "podman" # To change the podman executable, set environment variable # MOLECULE_PODMAN_EXECUTABLE # An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote @@ -162,7 +162,6 @@ def __init__(self, config=None): msg = f"command not found in PATH {self.podman_exec}" util.sysexit_with_message(msg) - @property def name(self): return self._name