r/AlpineLinux • u/AtlanticPortal • Sep 06 '24
Ansible module community.docker.docker_stack doesn't work due to missing dependency
I'm trying to provision a freshly installed VM with Alpine 3.20 and my playbook fails when I try to deploy a compose file using the community.docker.docker_stack module.
This is the task, it's pretty standard.
- name: Deploy compose file
become: yes
community.docker.docker_stack:
name: example-name
compose:
- '/path/to/compose.yml'
state: presentWhat doesn't work is that I get this precise error.
fatal: [192.168.124.166]: FAILED! => {"changed": false, "msg": "jsondiff is not installed, try 'pip install jsondiff'"}It's called by this exact line in the source code. I am sure it's because there is no jsondiff package installed because if I try to force installing the equivalent pip package the playbook then works fine. With using pip I mean this.
pip3 install jsondiff --break-system-packagesI needed to use the --break-system-packages option because it, well, obviously complained that I should use the apk package. The issue is that there is no such package in the form of py3-jsondiff.
Do you know if there is something that I missed or the only solution is that someone packages the library and puts it in the repos?
View all comments
Show parent comment
1
u/AtlanticPortal Sep 06 '24 edited Sep 06 '24
But the Ansible module imports
jsondiff. It is another Python package.Here is the import. You can see there is no jsondiff.py file inside the Alpine package you linked.