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

Introduce support for Archlinux #79

Merged
merged 5 commits into from
Sep 23, 2021
Merged

Conversation

michalroxorpl
Copy link
Contributor

I have created a patch to allow installation on Archlinux ansible_os_family
Tested on 4 different hosts (2 Raspberry Pies, one VM and my daily work laptop).

What I dislike is:

  • The pacman may complain about conflicts if there will be existing files on filesystem belonging to to-be installed packages. My solution for that is (after manually reviewing changes to be done):
sudo rm -rf $(pacman --noconfirm -S borgmatic | grep : | awk '{print $2}' | xargs)
  • On two hosts there was a problem with correct recognition if virtualenv (python -m venv) is in path, it was, but as a symlink, which failed the test. The solution was to make hardlinks, ie:
cd /usr/bin
ln -Pf python3.9 python3
ln -Pf python3 python

Funny thing is on two hosts it worked out of the box, without any necessity for manual intervention.
Besides those two issues everything works like a charm.

Thank you for your great work guys.

@m3nu
Copy link
Collaborator

m3nu commented Sep 21, 2021

Thanks for the addition! Would it also make sense to test on Arch? If so, you could add an appropriate Docker image there: https://github.com/borgbase/ansible-role-borgbackup/blob/master/molecule/default/molecule.yml#L6

@michalroxorpl
Copy link
Contributor Author

I will try preparing the Docker image. I have found out a permanent solution for my doubts listed above. Some packages need to be installed not as system packages, but as python setup-tools / pip installed modules. I have tested it on minimal new Arch installation to make sure it will work for everyone. I will create an appropriate PR soon.

@michalroxorpl
Copy link
Contributor Author

Ok, molecule is something new for me, however I managed to add what I feel is missing to the molecule.yml.
I hope this does the job.

@m3nu
Copy link
Collaborator

m3nu commented Sep 22, 2021

Yeah, now working on Arch yet. See the test.

fatal: [archlinux-latest]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "failed": true, "module_stderr": "/bin/sh: line 1: /usr/bin/python: No such file or directory\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127, "warnings": ["No python interpreters found for host archlinux-latest (tried ['/usr/bin/python', 'python3.9', 'python3.8', 'python3.7', 'python3.6', 'python3.5', 'python2.7', 'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])"]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

@michalroxorpl
Copy link
Contributor Author

Tested with molecule (new thing learned), took 2.5 hours (definitely need a new pc) and works.
Thank you for pointing out everything, that could have been done better.
I hope it can be merged now, after the test workflow completes green.

@m3nu m3nu merged commit aa5830a into borgbase:master Sep 23, 2021
@m3nu
Copy link
Collaborator

m3nu commented Sep 23, 2021

All good! Thanks for the contribution! Already merged and put a shout-out on Twitter, since I know we have a bunch of Arch users out there:

https://twitter.com/borg_base/status/1440983268183187457

kitos9112 pushed a commit to kitos9112/ansible-role-borgbackup that referenced this pull request Sep 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants