Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/molecule_plugins/vagrant/modules/vagrant.py: Get rid of molecule dependency #142

Merged
merged 1 commit into from
May 31, 2023

Conversation

apatard
Copy link
Member

@apatard apatard commented Apr 27, 2023

To avoid changes in molecule.util breaking the vagrant module, let's get rid of the dependency by:

  • embedded the recursive dict merge function
  • replace template handling by our own code. (and keep the autoescaping enabled)

Moreover, it will make it easier to use community.vagrant since molecule is not needed anymore.

hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 4, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 4, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
@dvzrv
Copy link

dvzrv commented May 10, 2023

@apatard this looks good and fixes issues we are seeing on Arch Linux currently. Thanks!
I hope someone reviews/merges this soon.

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request May 10, 2023
… plugin.

Apply an upstream (not merged) fix to make the vagrant plugin work again:
ansible-community/molecule-plugins#142
https://bugs.archlinux.org/task/78447

git-svn-id: file:///srv/repos/svn-community/svn@1459743 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request May 10, 2023
… plugin.

Apply an upstream (not merged) fix to make the vagrant plugin work again:
ansible-community/molecule-plugins#142
https://bugs.archlinux.org/task/78447

git-svn-id: file:///srv/repos/svn-community/svn@1459743 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@apatard
Copy link
Member Author

apatard commented May 10, 2023

@dvzrv I'm surprised it's fixing an issue. I didn't notice there was a change on either molecule or ansible side that could lead to the issue you're having on Arch. Could this PR "hide" an other issue ?
Anyway, if this "cleanup" PR ends up being needed by users, I'll mark it as ready soon.
@StarlessNights the warning is "misleading". Fixed by ansible/molecule@400a3b7

@apatard apatard force-pushed the vagrant-py-molecule-removal branch from 6ee55c7 to 3505916 Compare May 10, 2023 14:26
@apatard apatard force-pushed the vagrant-py-molecule-removal branch from 3505916 to 3d5b76a Compare May 11, 2023 13:53
@apatard apatard added bug Something isn't working enhancement New feature or request vagrant labels May 11, 2023
@apatard apatard marked this pull request as ready for review May 11, 2023 13:55
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142
See ansible-community#155

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142
See ansible-community#155

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.0-1.spec
    mv ../python*-molecule-plugins*23.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.0
    rm -rf ../python*-molecule-plugins*23.4.0*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
hswong3i added a commit to alvistack/ansible-community-molecule-plugins that referenced this pull request May 18, 2023
    git clean -xdf
    tar zcvf ../python-molecule-plugins_23.4.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule-plugins.spec ../python-molecule-plugins_23.4.1-1.spec
    mv ../python*-molecule-plugins*23.4.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-plugins-23.4.1
    rm -rf ../python*-molecule-plugins*23.4.1*.*

See ansible-community#142
See ansible-community#155
See ansible-community#156

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
@apatard apatard force-pushed the vagrant-py-molecule-removal branch from 3d5b76a to 1bffdd8 Compare May 31, 2023 07:55
…dependency

To avoid changes in molecule.util breaking the vagrant module, let's
get rid of the dependency by:
- embedded the recursive dict merge function
- replace template handling by our own code.
  (and keep the autoescaping enabled)

Moreover, it will make it easier to use community.vagrant since molecule
is not needed anymore.

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@apatard apatard force-pushed the vagrant-py-molecule-removal branch from 1bffdd8 to 634a595 Compare May 31, 2023 09:15
@apatard apatard merged commit 6e06d65 into ansible-community:main May 31, 2023
SeanMooney added a commit to SeanMooney/edpm-ansible that referenced this pull request Dec 21, 2023
The libvirt and nova roles currently uses the delegated driver
which runs molecule agaisnt localhost. This is requried for
ci as the podman driver cannot be used with this role however
it also means you must use a seperate development vm.

This change readds supprot for using the molecule vagrant plugin
for this role and configures the vagrant senario to use the
prepare, converge and verify playbooks from the default delegated
senario.

Addtionally this change updates yamllint and ansible-lint to not
scan files in a venv i.e. .venv in the root of the edpm-ansible
repo. .venv is already ignored by .gitignore so this also only
affect local development.

the molecule-plugins min version is raised to 23.5.0 to include
ansible-community/molecule-plugins#142
SeanMooney added a commit to SeanMooney/edpm-ansible that referenced this pull request Dec 21, 2023
The libvirt and nova roles currently uses the delegated driver
which runs molecule agaisnt localhost. This is requried for
ci as the podman driver cannot be used with this role however
it also means you must use a seperate development vm.

This change readds supprot for using the molecule vagrant plugin
for this role and configures the vagrant senario to use the
prepare, converge and verify playbooks from the default delegated
senario.

Addtionally this change updates yamllint and ansible-lint to not
scan files in a venv i.e. .venv in the root of the edpm-ansible
repo. .venv is already ignored by .gitignore so this also only
affect local development.

the molecule-plugins min version is raised to 23.5.0 to include
ansible-community/molecule-plugins#142
SeanMooney added a commit to SeanMooney/edpm-ansible that referenced this pull request Dec 22, 2023
The libvirt and nova roles currently uses the delegated driver
which runs molecule agaisnt localhost. This is requried for
ci as the podman driver cannot be used with this role however
it also means you must use a seperate development vm.

This change readds supprot for using the molecule vagrant plugin
for this role and configures the vagrant senario to use the
prepare, converge and verify playbooks from the default delegated
senario.

Addtionally this change updates yamllint and ansible-lint to not
scan files in a venv i.e. .venv in the root of the edpm-ansible
repo. .venv is already ignored by .gitignore so this also only
affect local development.

the molecule-plugins min version is raised to 23.5.0 to include
ansible-community/molecule-plugins#142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request vagrant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants