semaphore
semaphore copied to clipboard
Dynamic inventory module and docker
Hi, I am looking for some guidance with plugin setup and docker, I have managed to get the plugin working correctly locally but when I try and run from within semaphore it fails with the following
As you can see its missing linode-api4 so I created a new docker image with the following and deployed it.
FROM semaphoreui/semaphore
USER root
RUN /sbin/apk add py3-pip
USER semaphore
RUN pip install linode-api4
However it still fails to find the module with the same error as above
If I exec into the running container it can clearly see the installation...
Is there another way of achieving this via ansible?
It would be good to get this problem sorted as its not clear what you are supposed to do in the documentation or online.
Thanks for an help.
From my testing, the better way to get the dependencies for the linode API is to install the galaxy collection linode.cloud and then installing the requirements from: {galaxy-collections-path}/ansible_collections/linode/cloud/requirements.txt
Thanks @andreas-marschke would you be able to elaborate a bit more? I usually run very simple scripts in ansible and I'm not very familiar with galaxy
Thanks
@d11ahirst Ansible Galaxy is another tool provided by the ansible project allowing you to use collections of integrations such as additional task types eg. interactions with Linode or other Clouds and shared roles allowing for easy setup of common infrastructure. Browse around and you will find the Linode.Cloud collection allowing you to work with the Linode Cloud services.
Review the galaxy user guide for general information: https://docs.ansible.com/ansible/latest/galaxy/user_guide.html
This is out of scope for Semaphore as we're not directly associated with the Ansible project.
Thanks @andreas-marschke i have created a file called collections/requirements.yml with the following contents
---
collections:
- name: linode.cloud
version: ">=0.25.1"
unfortunately it is unable to find this file on running the playbook
No collections/requirements.yml file found. Skip galaxy install process.
my task resides as playbooks/task.yml
The collections directory needs to be under playbooks it's a longer standing peculiarity with Semaphore.
Thanks andreas
@d11ahirst Assuming the patches helped, do we need to keep the ticket open?
They didn't help due to the plugin needed before main playbooks for grabbing the dyanmic inventory but please feel free to close this issue, Thanks
With recent container versions you are able to mount a requirements.txt file into /etc/semaphore which installs the define list of pypi dependencies into the container.