Roots Discourse

Aws-cli role can't install pip

Following this guide: https://roots.io/guides/backing-up-trellis-sites-to-an-s3-bucket/

When provision server, aws-cli role can’t install pip.

On Ubuntu 18.04. (maybe outdated role? https://github.com/dstil/ansible-aws-cli )

TASK [aws-cli : Install AWS CLI] ***********************************************************
task path: /Volumes/B/Documentos/trellis3/ansible/vendor/roles/aws-cli/tasks/main.yml:9
Using module file /Library/Python/2.7/site-packages/ansible/modules/packaging/language/pip.py
<188.166.148.220> ESTABLISH SSH CONNECTION FOR USER: root
<188.166.148.220> SSH: EXEC ssh -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/aitor/.ansible/cp/9954a5df53 188.166.148.220 '/bin/sh -c '"'"'python3 && sleep 0'"'"''
<188.166.148.220> (1, '\n{"msg": "Unable to find any of pip3 to use.  pip needs to be installed.", "failed": true, "invocation": {"module_args": {"name": ["awscli"], "state": "latest", "virtualenv_site_packages": false, "virtualenv_command": "virtualenv", "use_mirrors": true, "editable": false, "version": null, "requirements": null, "virtualenv": null, "virtualenv_python": null, "extra_args": null, "chdir": null, "executable": null, "umask": null}}}\n', '')
System info:
  Ansible 2.7.2; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
Unable to find any of pip3 to use.  pip needs to be installed.
fatal: [188.166.148.220]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "chdir": null, 
            "editable": false, 
            "executable": null, 
            "extra_args": null, 
            "name": [
                "awscli"
            ], 
            "requirements": null, 
            "state": "latest", 
            "umask": null, 
            "use_mirrors": true, 
            "version": null, 
            "virtualenv": null, 
            "virtualenv_command": "virtualenv", 
            "virtualenv_python": null, 
            "virtualenv_site_packages": false
        }
    }
}

This fork has a fix:

So, just change in trellis/requirements.yml

- name: aws-cli
  src: https://github.com/dstil/ansible-aws-cli
  version: 5c1c14d9b0e6264605bd475c86d4ea67e7d5896f

to

- name: aws-cli
  src: https://github.com/3stack-software/ansible-aws-cli
  version: 67f6a400de7ef2260a5d0a64a5cb98156b65efaf

This topic was automatically closed after 42 days. New replies are no longer allowed.