Giter Site home page Giter Site logo

Comments (7)

robertdebock avatar robertdebock commented on August 30, 2024

This role requires a few preparations, please see requirements.yml and example prepare playbook.

from ansible-role-bootstrap.

staticdev avatar staticdev commented on August 30, 2024

@robertdebock there is no option to reopen the issue in this repo, but basically, if I run the exact prepare.yml in the documentation, I get the same error:

ansible-playbook prepare.yml -i inventory -K
BECOME password: 

PLAY [prepare] ********************************************************************************************************************************************************************************************

TASK [robertdebock.bootstrap : include assert.yml] ********************************************************************************************************************************************************
included: /home/static/workspace/linux-developer-playbook/roles/robertdebock.bootstrap/tasks/assert.yml for 127.0.0.1

TASK [robertdebock.bootstrap : test if bootstrap_user is set correctly] ***********************************************************************************************************************************
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : test if bootstrap_wait_for_host is set correctly] **************************************************************************************************************************
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : test if bootstrap_timeout is set correctly] ********************************************************************************************************************************
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : wait for host] *************************************************************************************************************************************************************
skipping: [127.0.0.1]

TASK [robertdebock.bootstrap : test connection] ***********************************************************************************************************************************************************
[WARNING]: Reset is not implemented for this connection
[WARNING]: Unhandled error in Python interpreter discovery for host 127.0.0.1: '<' not supported between instances of 'str' and 'int'
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : set bootstrap_ansible_user] ************************************************************************************************************************************************
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : gather ansible facts] ******************************************************************************************************************************************************
[WARNING]: Unhandled error in Python interpreter discovery for host 127.0.0.1: '<' not supported between instances of 'str' and 'int'
[WARNING]: Platform linux on host 127.0.0.1 is using the discovered Python interpreter at /home/static/.pyenv/shims/python3.7, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information.
ok: [127.0.0.1]

TASK [robertdebock.bootstrap : install bootstrap packages] ************************************************************************************************************************************************
[WARNING]: Updating cache and auto-installing missing dependency: python3-apt
failed: [127.0.0.1] (item=python3) => {"ansible_loop_var": "item", "changed": false, "item": "python3", "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."}
failed: [127.0.0.1] (item=sudo) => {"ansible_loop_var": "item", "changed": false, "item": "sudo", "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."}
failed: [127.0.0.1] (item=gnupg) => {"ansible_loop_var": "item", "changed": false, "item": "gnupg", "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."}
failed: [127.0.0.1] (item=python3-apt) => {"ansible_loop_var": "item", "changed": false, "item": "python3-apt", "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."}

PLAY RECAP ************************************************************************************************************************************************************************************************
127.0.0.1                  : ok=7    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0  

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Hm, especially this line is pretty weird:

failed: [127.0.0.1] (item=python3-apt) => {"ansible_loop_var": "item", "changed": false, "item": "python3-apt", "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."}

In human readable: "installing python3-apt failes please install python3-apt.".

I can't reproduce this issue, neither locally, nor in CI. There must be something different in your environment compared to mine. Let's analyse.

item you me
ansible --version 2.10.3 2.10.4
role bootstrap version ? 4.3.8

I'm wondering does any package installation work for you? Is the error you're seeing generic for any task that installs a package, on only for this obs role?

I'll reopen the issue, and will move it to the bootstrap repository.

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

So a couple of questions:

  1. Does ansible --module-name apt --args "name=screen" --inventory localhost, all --connection local --become --ask-become-pass work?
  2. I'm wondering does any package installation work for you?
  3. What version do you use for the roles, specifically bootstrap.

from ansible-role-bootstrap.

staticdev avatar staticdev commented on August 30, 2024

@robertdebock

  1. No, it seems ansible cannot identify correctly my python interpreter (but it works for when the playbook does not use apt. Output:
[WARNING]: Unhandled error in Python interpreter discovery for host localhost: '<' not supported between instances of 'str' and 'int'
[WARNING]: Updating cache and auto-installing missing dependency: python3-apt
[WARNING]: Platform linux on host localhost is using the discovered Python interpreter at /home/static/.pyenv/shims/python3.7, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information.
localhost | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/home/static/.pyenv/shims/python3.7"
    },
    "changed": false,
    "msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."
}

I changed a bit your command to reproduce the error to: ansible localhost --module-name apt --args "name=screen" --connection local --become --ask-become-pass. Then I get the same old error.

  1. No.

  2. The version of roles I am using:
    bootstrap: 4.3.8
    epel: 2.5.5
    rpmfusion: 1.3.6
    obsproject: 1.3.6

UPDATE: I just created an upstream issue on ansible: ansible/ansible#73075

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Ah, okay, cool that you have created the issue on ansible/ansible. Let's wait for some response there.

Thanks!

from ansible-role-bootstrap.

staticdev avatar staticdev commented on August 30, 2024

I will close this one.. the answer was that:

The python3-apt library is only available to the system Python and not available in virtual environments. When you are using the implicit localhost it is necessary to specify the system Python interpreter. On a task, you would have to define ansible_python_interpreter.

from ansible-role-bootstrap.

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.