Skip to content

Commit

Permalink
src/molecule_plugins/vagrant/modules/vagrant.py: Add safe filter for …
Browse files Browse the repository at this point in the history
…raw args

Since molecule ansible/molecule#3887, the
jinja is now autoescaping, which leads to things like:

virtualbox.customize [&ansible-community#39;modifyvm&ansible-community#39;, :id, &ansible-community#39;--natdnshostresolver1&ansible-community#39;, &ansible-community#39;on&ansible-community#39;]

in the Vagrantfile.

Add some "safe" filters to solve this.

Signed-off-by: Arnaud Patard <[email protected]>
  • Loading branch information
apatard committed Apr 27, 2023
1 parent 7498e81 commit 7c57d79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/molecule_plugins/vagrant/modules/vagrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
# instance_raw_config_args
##
{% if instance.instance_raw_config_args is not none %}{% for arg in instance.instance_raw_config_args -%}
c.{{ arg }}
c.{{ arg | safe }}
{% endfor %}{% endif %}
##
Expand All @@ -273,13 +273,13 @@
{% if instance.provider_raw_config_args is not none %}
{% for arg in instance.provider_raw_config_args %}
{{ instance.provider | lower }}.{{ arg }}
{{ instance.provider | lower }}.{{ arg | safe }}
{% endfor %}
{% endif %}
{% if instance.provider_override_args is not none %}
{% for arg in instance.provider_override_args -%}
override.{{ arg }}
override.{{ arg | safe }}
{% endfor %}
{% endif %}
Expand Down

0 comments on commit 7c57d79

Please sign in to comment.