Skip to content

Commit

Permalink
alvistack/v23.6.0
Browse files Browse the repository at this point in the history
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.6.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.6.0-1.spec
    cp ../python*-molecule-plugins*23.6.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.6.0
    rm -rf ../python*-molecule-plugins*23.6.0*.*

See ansible-community#155
See ansible-community#237
See ansible-community#294

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Jan 22, 2025
1 parent 11fb13f commit f9a7a85
Show file tree
Hide file tree
Showing 29 changed files with 339 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -127,7 +126,6 @@ dmypy.json

# Pyre type checker
.pyre/
src/molecule_plugins/_version.py

# Ignore generated files
test/roles
Expand All @@ -138,3 +136,5 @@ patches
*.patch
*.orig
*.rej

.pybuild/
3 changes: 2 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from molecule import config, logger, util
from molecule.scenario import ephemeral_directory
from molecule.app import App

LOG = logger.get_logger(__name__)

Expand All @@ -18,7 +19,7 @@ def run_command(cmd, env=os.environ, log=True):
if log:
cmd = _rebake_command(cmd, env)
cmd = cmd.bake(_truncate_exc=False)
return util.run_command(cmd, env=env)
return app.run_command(cmd, env=env)


def _rebake_command(cmd, env, out=LOG.info, err=LOG.error):
Expand Down
6 changes: 6 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.substvars
*debhelper*
.debhelper
files
python3-molecule-plugins
tmp
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python-molecule-plugins (100:23.6.0-1) UNRELEASED; urgency=medium

* https://github.com/ansible-community/molecule-plugins/releases/tag/v23.6.0

-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Fri, 20 Dec 2024 12:45:26 +0800
41 changes: 41 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Source: python-molecule-plugins
Section: python
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Homepage: https://github.com/ansible-community/molecule-plugins/tags
Vcs-Browser: https://github.com/alvistack/ansible-community-molecule-plugins
Vcs-Git: https://github.com/alvistack/ansible-community-molecule-plugins.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
dh-python,
fdupes,
python3-dev,
python3-setuptools,

Package: python3-molecule-plugins
Architecture: all
Description: Molecule Plugins
Molecule Plugins.
Depends:
${misc:Depends},
${shlibs:Depends},
${python3:Depends},
python3,
python3-docker (>= 4.3.1),
python3-jinja2 (>= 2.11.3),
python3-molecule (>= 6.0.0~alpha1),
python3-openstacksdk (>= 1.1.0),
python3-requests,
python3-selinux,
python3-vagrant (>= 1.0.0),
python3-yaml (>= 5.1),
Conflicts:
python3-molecule-docker,
python3-molecule-podman,
python3-molecule-vagrant,
Replaces:
python3-molecule-docker,
python3-molecule-podman,
python3-molecule-vagrant,
21 changes: 21 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Files: debian/*
Copyright: 2025 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
License: Apache-2.0

License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
The complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
1 change: 1 addition & 0 deletions debian/python3-molecule-plugins.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python*/*-packages/*
4 changes: 4 additions & 0 deletions debian/python3-molecule-plugins.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python3-molecule-plugins: copyright-without-copyright-notice
python3-molecule-plugins: initial-upload-closes-no-bugs
python3-molecule-plugins: no-manual-page
python3-molecule-plugins: zero-byte-file-in-doc-directory
15 changes: 15 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/make -f

SHELL := /bin/bash

override_dh_auto_install:
dh_auto_install --destdir=debian/tmp
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -qnrps debian/tmp/usr/lib/python*/*-packages

override_dh_auto_test:

override_dh_auto_clean:

%:
dh $@ --buildsystem=pybuild --with python3
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
5 changes: 5 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python-molecule-plugins source: file-without-copyright-information
python-molecule-plugins source: no-debian-changes
python-molecule-plugins source: source-contains-prebuilt-windows-binary
python-molecule-plugins source: source-is-missing
python-molecule-plugins source: source-package-encodes-python-version
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[build-system]
requires = [
"setuptools >= 64.0.0", # required by pyproject+setuptools_scm integration
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme

]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.9"
dynamic = ["version"]
version = "23.6.0"
name = "molecule-plugins"
description = "Molecule Plugins"
readme = "README.md"
Expand Down Expand Up @@ -139,7 +138,3 @@ gce = "molecule_plugins.gce.driver:GCE"
podman = "molecule_plugins.podman.driver:Podman"
vagrant = "molecule_plugins.vagrant.driver:Vagrant"
openstack = "molecule_plugins.openstack.driver:Openstack"

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/molecule_plugins/_version.py"
141 changes: 141 additions & 0 deletions python-molecule-plugins.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Copyright 2025 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

%global debug_package %{nil}

%global source_date_epoch_from_changelog 0

Name: python-molecule-plugins
Epoch: 100
Version: 23.6.0
Release: 1%{?dist}
BuildArch: noarch
Summary: Molecule Plugins
License: BSD-3-Clause
URL: https://github.com/ansible-community/molecule-plugins/tags
Source0: %{name}_%{version}.orig.tar.gz
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
BuildRequires: python3-setuptools

%description
Molecule Plugins.

%prep
%autosetup -T -c -n %{name}_%{version}-%{release}
tar -zx -f %{S:0} --strip-components=1 -C .

%build
%py3_build

%install
%py3_install
find %{buildroot}%{python3_sitelib} -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -qnrps %{buildroot}%{python3_sitelib}

%check

%if 0%{?suse_version} > 1500
%package -n python%{python3_version_nodots}-molecule-plugins
Summary: Molecule Plugins
Requires: python3
Requires: python3-docker >= 4.3.1
Requires: python3-Jinja2 >= 2.11.3
Requires: python3-molecule >= 6.0.0-alpha1
Requires: python3-openstacksdk >= 1.1.0
Requires: python3-PyYAML >= 5.1
Requires: python3-requests
Requires: python3-selinux
Requires: python3-vagrant >= 1.0.0
Provides: python3-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python3dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Conflicts: python3-molecule-docker
Conflicts: python3-molecule-podman
Conflicts: python3-molecule-vagrant

%description -n python%{python3_version_nodots}-molecule-plugins
Molecule Plugins.

%files -n python%{python3_version_nodots}-molecule-plugins
%license LICENSE
%{python3_sitelib}/*
%endif

%if 0%{?sle_version} > 150000
%package -n python3-molecule-plugins
Summary: Molecule Plugins
Requires: python3
Requires: python3-docker >= 4.3.1
Requires: python3-Jinja2 >= 2.11.3
Requires: python3-molecule >= 6.0.0-alpha1
Requires: python3-openstacksdk >= 1.1.0
Requires: python3-PyYAML >= 5.1
Requires: python3-requests
Requires: python3-selinux
Requires: python3-vagrant >= 1.0.0
Provides: python3-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python3dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Conflicts: python3-molecule-docker
Conflicts: python3-molecule-podman
Conflicts: python3-molecule-vagrant

%description -n python3-molecule-plugins
Molecule Plugins.

%files -n python3-molecule-plugins
%license LICENSE
%{python3_sitelib}/*
%endif

%if !(0%{?suse_version} > 1500) && !(0%{?sle_version} > 150000)
%package -n python3-molecule-plugins
Summary: Molecule Plugins
Requires: python3
Requires: python3-docker >= 4.3.1
Requires: python3-jinja2 >= 2.11.3
Requires: python3-libselinux
Requires: python3-molecule >= 6.0.0-alpha1
Requires: python3-openstacksdk >= 1.1.0
Requires: python3-pyyaml >= 5.1
Requires: python3-requests
Requires: python3-selinux
Requires: python3-vagrant >= 1.0.0
Provides: python3-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python3dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}-molecule-plugins = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}dist(molecule-plugins) = %{epoch}:%{version}-%{release}
Conflicts: python3-molecule-docker
Conflicts: python3-molecule-podman
Conflicts: python3-molecule-vagrant

%description -n python3-molecule-plugins
Molecule Plugins.

%files -n python3-molecule-plugins
%license LICENSE
%{python3_sitelib}/*
%endif

%changelog
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[egg_info]
tag_build =
tag_date = 0

2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from setuptools import setup
setup()
4 changes: 4 additions & 0 deletions src/molecule_plugins/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '23.6.0'
__version_tuple__ = version_tuple = (23, 6, 0)
5 changes: 3 additions & 2 deletions src/molecule_plugins/podman/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
from molecule import logger, util
from molecule.api import Driver, MoleculeRuntimeWarning
from molecule.constants import RC_SETUP_ERROR
from molecule.util import run_command, sysexit_with_message
from molecule.util import sysexit_with_message
from molecule.app import App

log = logger.get_logger(__name__)

Expand Down Expand Up @@ -246,4 +247,4 @@ def required_collections(self) -> dict[str, str]:

def reset(self):
# keep `--filter` in sync with playbooks/create.yml
run_command(["podman", "rm", "--force", "--filter=label=owner=molecule"])
app.run_command(["podman", "rm", "--force", "--filter=label=owner=molecule"])
18 changes: 18 additions & 0 deletions src/molecule_plugins/podman/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
vars:
podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}"
tasks:
- name: Get passwd entries for USER env
ansible.builtin.getent:
database: passwd
key: "{{ lookup('env', 'USER') }}"

- name: Get shell async_dir
ansible.builtin.set_fact:
_shell_async_dir: >-
{{ lookup('ansible.builtin.config', 'async_dir', plugin_type='shell', plugin_name='sh')
| regex_replace('^~', ansible_facts.getent_passwd[lookup('env', 'USER')][4]) }}
- name: Set async_dir for HOME env
ansible.builtin.set_fact:
ansible_async_dir: >-
{{ _shell_async_dir
| regex_replace('^' + ansible_facts.getent_passwd[lookup('env', 'USER')][4], lookup('env', 'HOME')) }}
when: lookup('env', 'HOME') != ansible_facts.getent_passwd[lookup('env', 'USER')][4]

- name: Log into a container registry
containers.podman.podman_login:
certdir: >-
Expand Down
18 changes: 18 additions & 0 deletions src/molecule_plugins/podman/playbooks/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
vars:
podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}"
tasks:
- name: Get passwd entries for USER env
ansible.builtin.getent:
database: passwd
key: "{{ lookup('env', 'USER') }}"

- name: Get shell async_dir
ansible.builtin.set_fact:
_shell_async_dir: >-
{{ lookup('ansible.builtin.config', 'async_dir', plugin_type='shell', plugin_name='sh')
| regex_replace('^~', ansible_facts.getent_passwd[lookup('env', 'USER')][4]) }}
- name: Set async_dir for HOME env
ansible.builtin.set_fact:
ansible_async_dir: >-
{{ _shell_async_dir
| regex_replace('^' + ansible_facts.getent_passwd[lookup('env', 'USER')][4], lookup('env', 'HOME')) }}
when: lookup('env', 'HOME') != ansible_facts.getent_passwd[lookup('env', 'USER')][4]

- name: Destroy molecule instance(s)
ansible.builtin.shell: "{{ podman_exec }} container exists {{ item.name }} && {{ podman_exec }} rm -f {{ item.name }} || true"
register: server
Expand Down
Loading

0 comments on commit f9a7a85

Please sign in to comment.