stackhpc / ansible-role-libvirt-host

This role configures a host as a Libvirt/KVM hypervisor. It can also configure storage pools and networks on the host.
36 stars 32 forks source link

permission on dir pool creation #37

Open gthieleb opened 4 years ago

gthieleb commented 4 years ago

It seems that the permissions for pools of type dir are not correct applied.

Steps to produce

host vars:

libvirt_host_pools:
 - name: isos
    type: dir
    path: /data/isos
    owner: "root"
    group: "kvm"
    mode: "2775"

Current behavior

When running this role are the applied permissions are:

dr-x-wx-wt  4 root kvm  4096 Jul  1 08:58 isos

Wanted behavior

drwxrwsr-x  4 root kvm  4096 Jul  1 08:58 isos

When Iook in the tasks (pools.yml) I see that you try to apply the mode using this setting:

    mode: "{{ item.mode|int(base=8) }}"

Correct would be to cast to string:

    mode: "{{ item.mode|string }}"
markgoddard commented 4 years ago

What if you remove the quotes?

mode: 02775