Skip to content

Commit

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

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

virtualbox.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']

in the Vagrantfile.

Add some "safe" filters to solve this.

Signed-off-by: Arnaud Patard <[email protected]>
  • Loading branch information
apatard authored Apr 27, 2023
1 parent 7498e81 commit 7eab71d
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 7eab71d

Please sign in to comment.