diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml index 5880addd..19944ed6 100644 --- a/.github/workflows/ack.yml +++ b/.github/workflows/ack.yml @@ -1,9 +1,15 @@ -# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml +--- +# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/ack.yml name: ack + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + on: pull_request_target: types: [opened, labeled, unlabeled, synchronize] jobs: ack: - uses: ansible-community/devtools/.github/workflows/ack.yml@main + uses: ansible/team-devtools/.github/workflows/ack.yml@main diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ceef4e3c..029b3a8c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,4 +1,5 @@ -# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/push.yml +--- +# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/push.yml name: push on: push: @@ -9,4 +10,4 @@ on: jobs: ack: - uses: ansible-community/devtools/.github/workflows/push.yml@main + uses: ansible/team-devtools/.github/workflows/push.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ece598da..2fafccce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +--- name: release on: diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 6a7e686e..0763b07b 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -1,3 +1,4 @@ +--- name: tox # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency @@ -40,7 +41,8 @@ jobs: matrix: ${{ fromJson(needs.pre.outputs.matrix) }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 0 # needed by setuptools-scm diff --git a/README.md b/README.md index 90ab2e3e..49ffb581 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ This repository contains the following molecule plugins: - podman - vagrant - Installing `molecule-plugins` does not install dependencies specific to each, plugin. To install these you need to install the extras for each plugin, like `pip3 install 'molecule-plugins[azure]'`. diff --git a/src/molecule_plugins/podman/driver.py b/src/molecule_plugins/podman/driver.py index 99c39090..5f7621c6 100644 --- a/src/molecule_plugins/podman/driver.py +++ b/src/molecule_plugins/podman/driver.py @@ -30,7 +30,7 @@ from molecule import logger, util from molecule.api import Driver, MoleculeRuntimeWarning from molecule.constants import RC_SETUP_ERROR -from molecule.util import sysexit_with_message +from molecule.util import run_command, sysexit_with_message log = logger.get_logger(__name__) @@ -243,3 +243,7 @@ def sanity_checks(self): def required_collections(self) -> dict[str, str]: """Return collections dict containing names and versions required.""" return {"containers.podman": "1.7.0", "ansible.posix": "1.3.0"} + + def reset(self): + # keep `--filter` in sync with playbooks/create.yml + run_command(["podman", "rm", "--force", "--filter=label=owner=molecule"]) diff --git a/src/molecule_plugins/podman/playbooks/create.yml b/src/molecule_plugins/podman/playbooks/create.yml index 5bc92cd9..57eab266 100644 --- a/src/molecule_plugins/podman/playbooks/create.yml +++ b/src/molecule_plugins/podman/playbooks/create.yml @@ -149,6 +149,8 @@ hostname: "{{ item.hostname | default(omit) }}" image: "{{ item.pre_build_image | default(false) | ternary('', 'molecule_local/') }}{{ item.image }}" ip: "{{ item.ip | default(omit) }}" + label: + owner: "molecule" # keep in sync with ../driver.py:Podman.reset() network: "{{ item.network | default(omit) }}" pid: "{{ item.pid_mode | default(omit) }}" privileged: "{{ item.privileged | default(omit) }}" diff --git a/test/gce/scenarios/linux/INSTALL.md b/test/gce/scenarios/linux/INSTALL.md index 39c952e0..86c4ad56 100644 --- a/test/gce/scenarios/linux/INSTALL.md +++ b/test/gce/scenarios/linux/INSTALL.md @@ -2,7 +2,7 @@ ## Requirements -- A GCE credentials rc file +- A GCE credentials rc file ## Install @@ -11,9 +11,9 @@ installation best practices. If not using a virtual environment, please consider passing the widely recommended ['--user' flag][] when invoking `pip`. -``` bash +```bash $ pip install 'molecule_gce' ``` - [Virtual environment]: https://virtualenv.pypa.io/en/latest/ - ['--user' flag]: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site +[Virtual environment]: https://virtualenv.pypa.io/en/latest/ +['--user' flag]: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site diff --git a/test/gce/scenarios/windows/INSTALL.md b/test/gce/scenarios/windows/INSTALL.md index 39c952e0..86c4ad56 100644 --- a/test/gce/scenarios/windows/INSTALL.md +++ b/test/gce/scenarios/windows/INSTALL.md @@ -2,7 +2,7 @@ ## Requirements -- A GCE credentials rc file +- A GCE credentials rc file ## Install @@ -11,9 +11,9 @@ installation best practices. If not using a virtual environment, please consider passing the widely recommended ['--user' flag][] when invoking `pip`. -``` bash +```bash $ pip install 'molecule_gce' ``` - [Virtual environment]: https://virtualenv.pypa.io/en/latest/ - ['--user' flag]: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site +[Virtual environment]: https://virtualenv.pypa.io/en/latest/ +['--user' flag]: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site