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

Vagrant template generating incorrect Vagrantfile due to autoescape #158

Closed
samiam opened this issue May 22, 2023 · 9 comments
Closed

Vagrant template generating incorrect Vagrantfile due to autoescape #158

samiam opened this issue May 22, 2023 · 9 comments

Comments

@samiam
Copy link
Contributor

samiam commented May 22, 2023

The Vagrantfile template isn't using the safe filter in all the locations needed.
This results in a invalid Vagrantfile being generated.

This bug was introduced in molecule v5.0.1 due to the use of autoescape when calling Jinja2.
Details of this problem can be found here:
ansible/molecule#3912

The request in that issue was to create a bug report in molecule-plugins with a test.

So, the PR here has both a fix and a test included.
#153

Unfortunately I couldn't get the Vagrant tests to work, and looking through the issues log, this appears to be a known issue.
But the tests, when run manually, work ok.

The only other change in that PR was to change the Vagrantbox from jessie64 to stretch64.
This is due to jessie being archived.
The repo.conf could be updated, or jessie box rebuilt, etc. but I went the easy route.
Here's the jessie64 errors for posterity.

W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/source/Sources  404  Not Found [IP: 151.101.194.132 80]
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/main/source/Sources  404  Not Found [IP: 199.232.30.132 80]
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.194.132 80]
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/main/binary-amd64/Packages  404  Not Found [IP: 199.232.30.132 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
E: There are problems and -y was used without --force-yes
@sulaweyo
Copy link

Guess i run into the same issue with box_url and box_version having encoded characters which make the Vagrantfile invalid
c.vm.box_version = &#34;<version>&#34; c.vm.box_url = &#34;<url>&#34;

@apatard
Copy link
Member

apatard commented May 31, 2023

I've just merge PR #153. Should we close this bug ?

@samiam
Copy link
Contributor Author

samiam commented Jun 3, 2023

Sure.

In hindsight, debian/buster64 is a little more recent box, but it's ok.

When will a new molecule-plugin version be cut?

Thank again.

@apatard
Copy link
Member

apatard commented Jun 6, 2023

Sure.

In hindsight, debian/buster64 is a little more recent box, but it's ok.

I guess that anyway I'll sooner or later make a PR to update test boxes to newer ones like bullseye or even bookworn. Same for alpine ones. That's why I didn't annoy you with that.

When will a new molecule-plugin version be cut?

I don't know. I hope soon but it would be nice to get some more PR merged before releasing.

@samiam
Copy link
Contributor Author

samiam commented Jun 8, 2023

I don't know. I hope soon but it would be nice to get some more PR merged before releasing.

"Release early, release often" 😄

A new ansible creator-ee was just released. As more people pick up 5.0.1, more will encounter this bug.
I feel like getting ahead of this bug vs getting more PRs merged is the prudent thing. 🤷

@hluaces
Copy link

hluaces commented Jul 5, 2023

This has been ongoing for a while now. Any reason as to not ship the fix on a new version?

@duckinator
Copy link

Just encountered this as well.

@hal58th
Copy link

hal58th commented Aug 2, 2023

Please release this!

@samiam
Copy link
Contributor Author

samiam commented Aug 14, 2023

This can be closed as it was fixed in #153 and released is 23.5.0.
https://github.com/ansible-community/molecule-plugins/releases/tag/v23.5.0

@zhan9san zhan9san closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants