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

"msg": "proxmoxer required for this module"} #2

Closed
Reznorzo opened this issue Apr 21, 2019 · 7 comments
Closed

"msg": "proxmoxer required for this module"} #2

Reznorzo opened this issue Apr 21, 2019 · 7 comments

Comments

@Reznorzo
Copy link

Hi,
Firstly, thanks for the cool role. This is exactly what I've been looking for.
I have ansible setup and running in the virtualenv, imported your role via galaxy, and defined by variables as such:

`# proxmox.yml

  • hosts: proxmox_containers
    connection: local
    user: root
    vars:
    pve_node: pve
    pve_apiuser: root@pam
    pve_apipass: password
    pve_api_host: pve.domain.com
    pve_hostname: "test"
    pve_template: local:vztmpl/ubuntu-16.04-standard_16.04.5-1_amd64.tar.gz
    roles:
    • engonzal.proxmox`

However on running via - ansible-playbook -i hosts -l test_server proxmox.yml

I get the following:

TASK [engonzal.proxmox : Provision container] ****************************************************************************************************************************
fatal: [test_server]: FAILED! => {"ansible_job_id": "2201899011.5401", "changed": false, "finished": 1, "msg": "proxmoxer required for this module"}

I have confirmed proxmoxer is installed via pip in the virtual environment.

Any help would be appreciated.

@Reznorzo
Copy link
Author

Appears this was an issue with either a non-latest version of pip or proxmoxer
I've closed the issue

@engonzal
Copy link
Owner

Thanks! As an FYI I've also had to explicitly set Ansible to use python from my virtualenv:

---
- hosts: all
  vars:
    ansible_python_interpreter: "/path/to/virtualenv/python"

@Reznorzo
Copy link
Author

Thanks!
How are you starting containers before installing packages ?

@engonzal
Copy link
Owner

Nothing fancy, just added a post_tasks section to the play with a pause task. There's an example here.

I don't have the plays handy now, but pretty sure I may have added a second play that used the Ansible "raw" module to install some more python packages as a first step (cant remember which distro needed that).

@Reznorzo
Copy link
Author

Thanks. Yes, I caught that, but there's no call to notify the start container handler, at the end of the provision.yml. So I've added one to my config.

I've got this play to run before provisioning any containers:

`# pip_install.yml

  • name: 'prep proxmox hosts for automation'
    hosts: 'proxmox'
    gather_facts: false
    vars:
    packages:
    - 'python-pip'
    - 'python-dev'
    - 'build-essential'

    tasks:

    • name: 'install python-apt so native apt plugins work'
      package:
      name: 'python-apt'
      state: 'present'
    • name: 'switch to community repos'
      apt_repository:
      repo: 'deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise'
      state: 'absent'
      apt_repository:
      repo: 'deb http://download.proxmox.com/debian/pve stretch pve-no-subscription'
      state: 'present'
    • name: 'Update all packages to the latest version'
      apt:
      upgrade: 'dist'
    • name: 'Install pip packages'
      apt:
      name: "{{ packages }}"
    • name: 'pip update pip'
      pip:
      name: 'pip'
      state: 'latest'
    • name: 'Install dependencies'
      pip:
      name: 'virtualenv'
      state: 'latest'
      pip:
      name: 'proxmoxer'
      state: 'latest'
      pip:
      name: 'requests'
      state: 'latest'
      pip:
      name: 'jmespath'
      state: 'latest'`

@engonzal
Copy link
Owner

Ah I think I see what you mean, you should be able to set 'pve_state: started' it defaults to present instead I believe.

@Reznorzo
Copy link
Author

Thanks again. I'm going to raise a new issue on role_package which I'm hoping you can talk me through

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