Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure creating storage pool on ubuntu 19.10 #24

Open
velis74 opened this issue Jan 29, 2020 · 4 comments
Open

Failure creating storage pool on ubuntu 19.10 #24

velis74 opened this issue Jan 29, 2020 · 4 comments

Comments

@velis74
Copy link

velis74 commented Jan 29, 2020

Trying to get this role working, but got stuck with:

TASK [stackhpc.libvirt-host : Ensure libvirt storage pools are defined] ********************************************************************
failed: [ansible-host] (item={'name': 'default', 'type': 'dir', 'path': '/var/lib/libvirt/images', 'mode': 755, 'owner': 'libvirt-qemu', 'group': 'kvm'}) => {"ansible_loop_var": "item", "changed": false, "item": {"group": "kvm", "mode": 755, "name": "default", "owner": "libvirt-qemu", "path": "/var/lib/libvirt/images", "type": "dir"}, "msg": "The `libvirt` module is not importable. Check the requirements."}

Playbook:

- name: Basic provisioning of VM hosts
  hosts: vm_hosts
  roles:
    - role: stackhpc.libvirt-host
      libvirt_host_pools:
        - name: default
          type: dir
          path: /var/lib/libvirt/images
          mode: 755
          owner: libvirt-qemu
          group: kvm
      libvirt_host_networks:
        - name: default
          mode: nat
          bridge: virbr0
          domain: qemu.local
          ip: 192.168.123.254
          netmask: 255.255.255.0
          dhcp_start: 192.168.123.100
          dhcp_end: 192.168.123.250

A quick internet search shows that mostly this is a result of package dependency misconfiguration in role, but TBH I have no idea how to tackle this.

Will dig some more, but help would also be appreciated.

@velis74
Copy link
Author

velis74 commented Jan 29, 2020

Eh, stupid me: adding become: yes immediately fixed the issue. I suggest adding it to documentation / example playbook.
I'd do a PR, but have no idea why it's not included already?

@markgoddard
Copy link
Member

Hi. Almost all of the tasks have become: true. Which task is missing it?

In your first error, it says The libvirt module is not importable. Check the requirements.

We install either python3-libvirt or python-libvirt, depending on whether libvirt_host_python3 is true. Perhaps it is a py2/3 issue?

@markgoddard
Copy link
Member

We might be able to improve our py2/3 detection. Currently we assume py2 if ansible_python_interpreter is not set. I think that ansible_python is a more reliable source of this information though.

markgoddard added a commit that referenced this issue Jan 29, 2020
The CentOS 8 / ansible_python_interpreter method is not reliable on
Debian when ansible_python_interpreter is not set.

Related: #24
@velis74
Copy link
Author

velis74 commented Jan 29, 2020

I must admit I don't know about this py2/3 stuff: this was a direct ubuntu 19.10 install from mini.iso (network install) with nothing but sshd selected in tasksel.
I always use python3, but I have no idea what ansible does on a host.
The machine where I run ansible is also an ubuntu 19.10. It DOES have python2, but ansible is installed in a virtualenv derived from python 3.7.3.

The task that fails should be visible from the error message. It has become: true already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants