borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
229 stars 100 forks source link

Auto-create of BorgBase repo not working because of missing borgbase_api_client #83

Open Joniator opened 3 years ago

Joniator commented 3 years ago

The role cant create a borgbase repo, because it can't find the borgbase_api_client.

FAILED! => {"msg": "Could not find imported module support code for ansible.modules.borgbase. Looked for (['ansible.module_utils.borgbase_api_client.client.GraphQLClient', 'ansible.module_utils.borgbase_api_client.client'])"}

If I follow the README in module_utils, and pit the borgbase_api_client from the repo (not the repo itself), after which it works. (Edited because it did not work at first, because I did not properly set my API-Token

I would expect that the dependencies get installed automatically, or are at least documented how to get them up and running.

Am I missing something? Help would be apprecieated, thanks

My requirements.yml:

- src: m3nu.ansible_role_borgbackup

And I run the role like this:

- hosts: example.com
  become: true
  roles:
  - role: m3nu.ansible_role_borgbackup
    borg_encryption_passphrase: "{{ lookup('env', 'BORG_ENCRYPTION_PASSPHRASE') }}"
    create_repo: True
    bb_token: "{{ lookup('env', 'BORGBASE_TOKEN') }}"
    bb_region: eu
    bb_new_sshkey: True
    borg_source_directories:
      - /example/dir
m3nu commented 3 years ago

Agree that this should be documented better or included from the start. Would be best to vendor this dependency into the current repo.

Basically this should go there.

p-rintz commented 2 years ago

Personally, I use git submodule for this. Would be a good, easy fix.