Code Monkey home page Code Monkey logo

Comments (6)

LKaemmerling avatar LKaemmerling commented on May 26, 2024 1

Ansible comes with a own python binary (and own pip). You need to lookup the ansible path. In there is a python binary.

from hcloud-python.

dimejo avatar dimejo commented on May 26, 2024

Ansible comes with a own python binary (and own pip). You need to lookup the ansible path. In there is a python binary.

Thanks for the fast reply. Unfortunately it is of no help for me.

from hcloud-python.

github-actions avatar github-actions commented on May 26, 2024

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

from hcloud-python.

rawtaz avatar rawtaz commented on May 26, 2024

@dimejo Did you ever figure this out and find a solution?

I'm having the same symptom, that same error message despite having installed hcloud-python using pip install hcloud as per https://hcloud-python.readthedocs.io/en/latest/installation.html in a Docker image having this Dockerfile:

FROM python:3.11.0-alpine

RUN apk update
RUN apk add --upgrade apk-tools
RUN apk upgrade --available

RUN apk add openssh ansible
RUN pip install --upgrade pip
RUN pip install hcloud

WORKDIR /data

Running it yields this:

# ansible-inventory --graph
[WARNING]:  * Failed to parse /data/ansible/inventory/hcloud.yaml with ansible_collections.hetzner.hcloud.plugins.inventory.hcloud plugin: The Hetzner Cloud dynamic inventory
plugin requires hcloud-python.
[WARNING]: Unable to parse /data/ansible/inventory/hcloud.yaml as an inventory source
[WARNING]: Unable to parse /data/ansible/inventory as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
@all:
  |--@ungrouped:

For reference, the hcloud.yaml file has just this in it:

plugin: hetzner.hcloud.hcloud

from hcloud-python.

dimejo avatar dimejo commented on May 26, 2024

@dimejo Did you ever figure this out and find a solution?

Unfortunately not. I was unable to find Ansible's own python binary and spending hours to find a solution wasn't worth it for me.

But as you are using Docker you could try switching to Arch Linux as base image and see if the python-hcloud package from the community repos works.

from hcloud-python.

rawtaz avatar rawtaz commented on May 26, 2024

Thanks @dimejo for your input. I've dug a bit further and will document any solutions I find here:

  • The first and probably simplest way to fix the problem is to install ansible using pip instead of apk. So instead of apk install ansible just make it pip install ansible- this made it work for me and installed a slightly newer version of ansible than what apk had, although it's worth noting that the apk installed ansible might be better tailored to the operating system and perhaps also more secure, I don't know. It's on the hand older in my case.

from hcloud-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.