ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
297 stars 165 forks source link

Permit to a volume to be created as a file and not only a directory #183

Closed deepbluemussel closed 9 months ago

deepbluemussel commented 10 months ago

In some cases, you may need to mount a file volume (for example, if you want to mount a docker socket). With this PR, all you need to do is enter the state in the list of volumes in the nomad_host_volumesvariable. The default value is directory.

Example:

nomad_host_volumes:
  - name: docker-sock-ro
    path: /run/docker.sock
    state: file
    read_only: true
  - name: postgres-myapp
    path: /volumes/nomad/postgres/myapp
    owner: nobody
    group: nogroup
    mode: "0755"
    read_only: false
rndmh3ro commented 10 months ago

LGTM.

Can you expand the example in the readme with the state?

deepbluemussel commented 10 months ago

@rndmh3ro You're right. It's done ✅