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

No package matching 'python-pip' is available when use ansible 5.4 (2.12.2) on ubuntu 16.04, 18.04, 20.04 #22

Open
patsevanton opened this issue Mar 16, 2022 · 4 comments

Comments

@patsevanton
Copy link

SUMMARY

Unable to find any of pip3 to use when use ansible 5.4 on ubuntu 16.04, 18.04, 20.04

ISSUE TYPE
  • Bug Report
COMPONENT NAME

pip or ansible

ANSIBLE VERSION
ansible --version
ansible [core 2.12.2]
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  jinja version = 2.11.1

and

Version: 5.4.0-1ppa~focal
CONFIGURATION
CALLBACKS_ENABLED(/home/user/github/yc-terraform-examples/15-provisioner-gitlab-by-ansible/ansible.cfg) = ['profile_tasks']
OS / ENVIRONMENT

Main server Ubuntu 20.04
Remote server Ubuntu 16.04, 18.04, 20.04

STEPS TO REPRODUCE
- hosts: gitlab
  become: yes
  pre_tasks:
    - name: Update apt cache.
      apt: update_cache=true cache_valid_time=600
      when: ansible_os_family == 'Debian'
      changed_when: false
  roles:
    - role: lean_delivery.gitlab
ACTUAL RESULTS
FAILED - RETRYING: [gitlab]: Install pyapi-gitlab (for external management from Ansible) (1 retries left).Result was: {
    "attempts": 3,
    "changed": false,
    "invocation": {
        "module_args": {
            "chdir": null,
            "editable": false,
            "executable": null,
            "extra_args": null,
            "name": [
                "pyapi-gitlab",
                "python-gitlab",
                "pyOpenSSL"
            ],
            "requirements": null,
            "state": "present",
            "umask": null,
            "version": null,
            "virtualenv": null,
            "virtualenv_command": "virtualenv",
            "virtualenv_python": null,
            "virtualenv_site_packages": false
        }
    },
    "msg": "Unable to find any of pip3 to use.  pip needs to be installed.",
    "retries": 4
}
<51.250.44.7> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.7> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' 51.250.44.7 '/bin/sh -c '"'"'echo ~ubuntu && sleep 0'"'"''
<51.250.44.7> (0, b'/home/ubuntu\n', b'')
<51.250.44.7> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.7> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' 51.250.44.7 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/ubuntu/.ansible/tmp `"&& mkdir "` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862 `" && echo ansible-tmp-1647403698.3497248-2886-154731052069862="` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862 `" ) && sleep 0'"'"''
<51.250.44.7> (0, b'ansible-tmp-1647403698.3497248-2886-154731052069862=/home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862\n', b'')
Using module file /usr/lib/python3/dist-packages/ansible/modules/pip.py
<51.250.44.7> PUT /home/user/.ansible/tmp/ansible-local-28243827alzy/tmpz2uupzza TO /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/AnsiballZ_pip.py
<51.250.44.7> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' '[51.250.44.7]'
<51.250.44.7> (0, b'sftp> put /home/user/.ansible/tmp/ansible-local-28243827alzy/tmpz2uupzza /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/AnsiballZ_pip.py\n', b'')
<51.250.44.7> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.7> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' 51.250.44.7 '/bin/sh -c '"'"'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/ /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/AnsiballZ_pip.py && sleep 0'"'"''
<51.250.44.7> (0, b'', b'')
<51.250.44.7> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.7> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' -tt 51.250.44.7 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-piobgoimtopusrjbehpjzqelmpsrrdhw ; /usr/bin/python3 /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/AnsiballZ_pip.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<51.250.44.7> (1, b'\r\n{"failed": true, "msg": "Unable to find any of pip3 to use.  pip needs to be installed.", "invocation": {"module_args": {"name": ["pyapi-gitlab", "python-gitlab", "pyOpenSSL"], "state": "present", "virtualenv_site_packages": false, "virtualenv_command": "virtualenv", "editable": false, "version": null, "requirements": null, "virtualenv": null, "virtualenv_python": null, "extra_args": null, "chdir": null, "executable": null, "umask": null}}}\r\n', b'Shared connection to 51.250.44.7 closed.\r\n')
<51.250.44.7> Failed to connect to the host via ssh: Shared connection to 51.250.44.7 closed.
<51.250.44.7> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.7> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/5f3c54168a"' 51.250.44.7 '/bin/sh -c '"'"'rm -f -r /home/ubuntu/.ansible/tmp/ansible-tmp-1647403698.3497248-2886-154731052069862/ > /dev/null 2>&1 && sleep 0'"'"''
<51.250.44.7> (0, b'', b'')
fatal: [gitlab]: FAILED! => {
    "attempts": 3,
    "changed": false,
    "invocation": {
        "module_args": {
            "chdir": null,
            "editable": false,
            "executable": null,
            "extra_args": null,
            "name": [
                "pyapi-gitlab",
                "python-gitlab",
                "pyOpenSSL"
            ],
            "requirements": null,
            "state": "present",
            "umask": null,
            "version": null,
            "virtualenv": null,
            "virtualenv_command": "virtualenv",
            "virtualenv_python": null,
            "virtualenv_site_packages": false
        }
    },
    "msg": "Unable to find any of pip3 to use.  pip needs to be installed."
}
@patsevanton patsevanton changed the title Unable to find any of pip3 to use when use ansible 5.4 on ubuntu 16.04, 18.04, 20.04 Unable to find any of pip3 to use when use ansible 5.4 (2.12.2) on ubuntu 16.04, 18.04, 20.04 Mar 16, 2022
@patsevanton
Copy link
Author

Check install pip/pip3 on Ubuntu 20.04

pip
Command 'pip' not found, but can be installed with:
sudo apt install python3-pip
ubuntu@gitlab:~$ pip3
Command 'pip3' not found, but can be installed with:
sudo apt install python3-pip
ubuntu@gitlab:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04

@patsevanton
Copy link
Author

I installed python3-pip

sudo apt install python3-pip

Try run playbook again

FAILED - RETRYING: [gitlab]: Install requirements (1 retries left).Result was: {
    "attempts": 3,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_downgrade": false,
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "fail_on_autoremove": false,
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "lock_timeout": 60,
            "name": [
                "openssh-server",
                "postfix",
                "curl",
                "python-pip",
                "ca-certificates",
                "git",
                "policycoreutils",
                "tzdata"
            ],
            "only_upgrade": false,
            "package": [
                "openssh-server",
                "postfix",
                "curl",
                "python-pip",
                "ca-certificates",
                "git",
                "policycoreutils",
                "tzdata"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "update_cache_retries": 5,
            "update_cache_retry_max_delay": 12,
            "upgrade": null
        }
    },
    "msg": "No package matching 'python-pip' is available",
    "retries": 4
}
<51.250.44.12> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.12> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' 51.250.44.12 '/bin/sh -c '"'"'echo ~ubuntu && sleep 0'"'"''
<51.250.44.12> (0, b'/home/ubuntu\n', b'')
<51.250.44.12> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.12> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' 51.250.44.12 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/ubuntu/.ansible/tmp `"&& mkdir "` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636 `" && echo ansible-tmp-1647407713.8296707-4176-48286140816636="` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636 `" ) && sleep 0'"'"''
<51.250.44.12> (0, b'ansible-tmp-1647407713.8296707-4176-48286140816636=/home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636\n', b'')
Using module file /usr/lib/python3/dist-packages/ansible/modules/apt.py
<51.250.44.12> PUT /home/user/.ansible/tmp/ansible-local-4141_tr2t66u/tmpod77ngxh TO /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/AnsiballZ_apt.py
<51.250.44.12> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' '[51.250.44.12]'
<51.250.44.12> (0, b'sftp> put /home/user/.ansible/tmp/ansible-local-4141_tr2t66u/tmpod77ngxh /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/AnsiballZ_apt.py\n', b'')
<51.250.44.12> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.12> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' 51.250.44.12 '/bin/sh -c '"'"'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/ /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/AnsiballZ_apt.py && sleep 0'"'"''
<51.250.44.12> (0, b'', b'')
<51.250.44.12> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.12> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' -tt 51.250.44.12 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-xmtlmqiokkbctxngplgxowhsblqzjjob ; /usr/bin/python3 /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/AnsiballZ_apt.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<51.250.44.12> (1, b'\r\n{"failed": true, "msg": "No package matching \'python-pip\' is available", "exception": "  File \\"/tmp/ansible_ansible.legacy.apt_payload_xasw967y/ansible_ansible.legacy.apt_payload.zip/ansible/modules/apt.py\\", line 485, in package_status\\n  File \\"/usr/lib/python3/dist-packages/apt/cache.py\\", line 305, in __getitem__\\n    raise KeyError(\'The cache has no package named %r\' % key)\\n", "invocation": {"module_args": {"name": ["openssh-server", "postfix", "curl", "python-pip", "ca-certificates", "git", "policycoreutils", "tzdata"], "state": "present", "package": ["openssh-server", "postfix", "curl", "python-pip", "ca-certificates", "git", "policycoreutils", "tzdata"], "update_cache_retries": 5, "update_cache_retry_max_delay": 12, "cache_valid_time": 0, "purge": false, "force": false, "upgrade": null, "dpkg_options": "force-confdef,force-confold", "autoremove": false, "autoclean": false, "fail_on_autoremove": false, "only_upgrade": false, "force_apt_get": false, "allow_unauthenticated": false, "allow_downgrade": false, "lock_timeout": 60, "update_cache": null, "deb": null, "default_release": null, "install_recommends": null, "policy_rc_d": null}}}\r\n', b'Shared connection to 51.250.44.12 closed.\r\n')
<51.250.44.12> Failed to connect to the host via ssh: Shared connection to 51.250.44.12 closed.
<51.250.44.12> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.44.12> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/a5335df35c"' 51.250.44.12 '/bin/sh -c '"'"'rm -f -r /home/ubuntu/.ansible/tmp/ansible-tmp-1647407713.8296707-4176-48286140816636/ > /dev/null 2>&1 && sleep 0'"'"''
<51.250.44.12> (0, b'', b'')
The full traceback is:
  File "/tmp/ansible_ansible.legacy.apt_payload_xasw967y/ansible_ansible.legacy.apt_payload.zip/ansible/modules/apt.py", line 485, in package_status
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 305, in __getitem__
    raise KeyError('The cache has no package named %r' % key)
fatal: [gitlab]: FAILED! => {
    "attempts": 3,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_downgrade": false,
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "fail_on_autoremove": false,
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "lock_timeout": 60,
            "name": [
                "openssh-server",
                "postfix",
                "curl",
                "python-pip",
                "ca-certificates",
                "git",
                "policycoreutils",
                "tzdata"
            ],
            "only_upgrade": false,
            "package": [
                "openssh-server",
                "postfix",
                "curl",
                "python-pip",
                "ca-certificates",
                "git",
                "policycoreutils",
                "tzdata"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "update_cache_retries": 5,
            "update_cache_retry_max_delay": 12,
            "upgrade": null
        }
    },
    "msg": "No package matching 'python-pip' is available"
}

@patsevanton
Copy link
Author

Try install python-pip on Ubuntu 20.04

sudo apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-pip

E: Package 'python-pip' has no installation candidate
ubuntu@gitlab:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04

@patsevanton
Copy link
Author

If changed python-pip to python3-pip then get error

TASK [lean_delivery.gitlab : Prepare default user script] ******************************************************************************************************************************
task path: /home/user/.ansible/roles/lean_delivery.gitlab/tasks/install.yml:53
Wednesday 16 March 2022  11:36:54 +0600 (0:05:01.522)       0:07:19.164 *******
<51.250.42.231> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.42.231> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/56ebd43faa"' 51.250.42.231 '/bin/sh -c '"'"'echo ~ubuntu && sleep 0'"'"''
<51.250.42.231> (0, b'/home/ubuntu\n', b'')
<51.250.42.231> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.42.231> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/56ebd43faa"' 51.250.42.231 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/ubuntu/.ansible/tmp `"&& mkdir "` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647409014.250319-5676-29981081308034 `" && echo ansible-tmp-1647409014.250319-5676-29981081308034="` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1647409014.250319-5676-29981081308034 `" ) && sleep 0'"'"''
<51.250.42.231> (0, b'ansible-tmp-1647409014.250319-5676-29981081308034=/home/ubuntu/.ansible/tmp/ansible-tmp-1647409014.250319-5676-29981081308034\n', b'')
<51.250.42.231> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<51.250.42.231> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o 'ControlPath="/home/user/.ansible/cp/56ebd43faa"' 51.250.42.231 '/bin/sh -c '"'"'rm -f -r /home/ubuntu/.ansible/tmp/ansible-tmp-1647409014.250319-5676-29981081308034/ > /dev/null 2>&1 && sleep 0'"'"''
<51.250.42.231> (0, b'', b'')
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ansible/plugins/test/core.py", line 197, in version_compare
    return method(Version(to_text(value)), Version(to_text(version)))
  File "/usr/lib/python3/dist-packages/ansible/module_utils/compat/version.py", line 78, in __ge__
    c = self._cmp(other)
  File "/usr/lib/python3/dist-packages/ansible/module_utils/compat/version.py", line 338, in _cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ansible/plugins/action/template.py", line 150, in run
    resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False)
  File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 1139, in do_template
    res = j2_concat(rf)
  File "<template>", line 29, in root
  File "/usr/lib/python3/dist-packages/ansible/plugins/test/core.py", line 199, in version_compare
    raise errors.AnsibleFilterError('Version comparison failed: %s' % to_native(e))
ansible.errors.AnsibleFilterError: Version comparison failed: '<' not supported between instances of 'str' and 'int'
fatal: [gitlab]: FAILED! => {
    "changed": false,
    "msg": "AnsibleFilterError: Version comparison failed: '<' not supported between instances of 'str' and 'int'"
}

@patsevanton patsevanton changed the title Unable to find any of pip3 to use when use ansible 5.4 (2.12.2) on ubuntu 16.04, 18.04, 20.04 No package matching 'python-pip' is available when use ansible 5.4 (2.12.2) on ubuntu 16.04, 18.04, 20.04 Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant