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

[PipX - Ansible] ERROR! Use of "manifest" requires the python "distlib" library #11881

Open
Amphaal opened this issue Jan 11, 2025 · 4 comments
Labels
kind/documentation Categorizes issue or PR as related to documentation.

Comments

@Amphaal
Copy link

Amphaal commented Jan 11, 2025

What would you like to be added

Enhance documentation regarding pipx usage and requirements importing.

Why is this needed

If we use pipx in case of the very common python's externally-managed-environment to use ansible / ansible-galaxy (as advertized here: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-and-upgrading-ansible-with-pipx) we would stumble upon the error message above trying to install Kubespray with ansible-galaxy.

To fix this issue, we must do once pipx inject <ansible-venv> distlib beforehand.

@Amphaal Amphaal added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 11, 2025
@tico88612
Copy link
Member

/remove-kind feature
/kind documentation

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jan 13, 2025
@tico88612
Copy link
Member

tico88612 commented Jan 13, 2025

Why you need ansible-galaxy in Kubespray? If you're regular user (not contributor or developer), you don't need to install ansible-galaxy.

ref: https://github.com/kubernetes-sigs/kubespray/blob/1f186ed451894a55d0336c9736df7d147b2c3a55/requirements.txt

@Amphaal
Copy link
Author

Amphaal commented Jan 13, 2025

You might want to use Ansible to orchestrate the setup of your stack with Kubespray, and along with it install services on your stack in the same run, still using Ansible to do so.

My guess is that it would be a rather common usecase; if that's not something you wish to add to the documentation, I think the mere presence of this ticket would help a few folks out there like me !

@Amphaal
Copy link
Author

Amphaal commented Jan 13, 2025

Why you need ansible-galaxy in Kubespray? If you're regular user (not contributor or developer), you don't need to install ansible-galaxy.

ref: https://github.com/kubernetes-sigs/kubespray/blob/1f186ed451894a55d0336c9736df7d147b2c3a55/requirements.txt

You would not actually need ansible-galaxy per-se in Kubespray requirements (binary which is I think installed along ansible's pip dependency).

But, you might want to use Kubespray as a collection, installed with ansible-galaxy, and use it within your own playbooks :

# ansible/requirements.yml
---
collections:
  - name: https://github.com/kubernetes-sigs/kubespray
    type: git
    version: master

# in shell...
ansible-galaxy collection install -r ansible/requirements.yml
# ansible/playbooks/site.yml
---
# runs the kubespray's "reset.yml" playbook - delete all that Kubespray could have installed
- name: Reset any Kubespray cluster installed
   ansible.builtin.import_playbook: kubernetes_sigs.kubespray.reset

# runs the kubespray's "cluster.yml" playbook - Installs Kubespray configuration
- name: Install & Configure Kubernetes cluster & tools (Containerd, Helm, Ingress Controllers...)
   ansible.builtin.import_playbook: kubernetes_sigs.kubespray.cluster

### then follow up with your services playbook...

# in shell...
ansible-playbook -i ansible/inventories/production/hosts --vault-password-file .ansible-vault-pw --become --become-user=root ansible/playbooks/site.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

3 participants