Skip to content

Unable to apply allow_caps to Docker config under nomad_plugins #127

Open
@bradleydwyer

Description

@bradleydwyer

Was just trying to add the a capability to the Docker plugin (in my case, NET_ADMIN) and noticed that the generated client.hcl isn't accepted by Nomad on startup.

Given the Ansible YAML config of:

nomad_plugins:
  docker:
    config:
      allow_caps: ["NET_ADMIN"]

The generated HCL is (that Nomad rejects):

plugin "docker" {
    config {
        allow_caps = ['net_admin']
    }
}

Where I would have expected (and Nomad happily starts with):

plugin "docker" {
    config {
        allow_caps = ["NET_ADMIN"]
    }
}

I also tried a list format for the YAML

nomad_plugins:
  docker:
    config:
      allow_caps:
      - "NET_ADMIN"

But it had the same output.

I presume the lowercase originates from

{{ key | indent(count*width, first=True) }} = {% if value is string %}"{{ value }}"{% else %}{{ value | string | lower }}{% endif %}
and I'm happy to change it, but I'm not sure why it's there in the first place, so I'm a little hesitant to just go changing it to solve my specific problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions