ansible-nomad icon indicating copy to clipboard operation
ansible-nomad copied to clipboard

Correctly handle list items under nomad_plugins, fixes #127

Open bradleydwyer opened this issue 3 years ago • 4 comments

bradleydwyer avatar May 18 '21 05:05 bradleydwyer

This fix is at a wrong place.

The following block creates the config for allow_caps

plugin "{{ key }}" {
{{ plugin_config(value) }}
}

My quick and dirty fix: {{ plugin_config(value) | replace('\'', '\"') }}

The major problem is, that jinja2 cannot create HCL at this point.

Rendanic avatar Jul 31 '21 07:07 Rendanic

@Rendanic The primary issue that I was trying to fix was the casing rather than quoting. It was this casing issue that led me to put the change where I did, as that is where the lowercase operation takes place.

I'm not overly familiar with this project and I don't really mind where any potential fix is placed, just wanted to mention there is the second casing issue in addition to the quoting issue (as I mostly lent on using the example to describe the problem, rather than explaining the two different issues explicitly so it would have been easy to miss).

That said, I haven't actually tried your fix yet and it could be that it does avoid the lowercase operation. If so just ignore this comment.

bradleydwyer avatar Aug 01 '21 21:08 bradleydwyer

would like some final vetting from someone if possible

lanefu avatar Dec 27 '21 05:12 lanefu

I created a PR (#152) with my fix.

Rendanic avatar Jan 30 '22 11:01 Rendanic