0

I am trying to get a file from gcloud bucket using gc_storage module but I get the error fatal: [10.xx.xxx.xx]: FAILED! => {"changed": false, "msg": "'boto' 2.9+ is required for this module. Try: pip install 'boto' --upgrade"}

My playbook looks like this

---
- name: update key
  hosts: tools

  tasks:
  - name: get link.sh
    gc_storage:
      bucket: cmg-tools-packer
      object: tenable/link.sh
      dest: /tmp
      mode: get
      gs_access_key: "0xxxxxxxxxxxxxxxxxxxxxxxxxxc"
      gs_secret_key: "-----BEGIN PRIVATE KEY-----\nMII\n-----END PRIVATE KEY-----\n"

My inventory looks like

[tools]
10.xx.xxx.xx ansible_python_interpreter=python3

I have boto installed on my ansible server as well as on the target server.

Version output on ansible server:

kkatyal@tools-ansible:~/playbooks$ pip show boto
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Name: boto
Version: 2.49.0
Summary: Amazon Web Services Library
Home-page: https://github.com/boto/boto/
Author: Mitch Garnaat
Author-email: mitch@garnaat.com
License: MIT
Location: /usr/local/lib/python2.7/dist-packages
Requires:
Required-by:


kkatyal@tools-ansible:~/playbooks$ pip3 show boto3
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Name: boto3
Version: 1.17.20
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: None
License: Apache License 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: botocore, jmespath, s3transfer
Required-by:

Not sure what is the issue here. TIA for your input.

zigarn
  • 10,892
  • 2
  • 31
  • 45
bilcy
  • 168
  • 1
  • 12
  • 1
    Your `pip3` is broken, it also runs under Python 2.7. Verify with `pip3 --version`. Fix with `python3 -m pip install -U pip` – phd Mar 04 '21 at 20:25
  • `python3 -m pip install -U pip` give me error `SyntaxError: invalid syntax`. `File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}")` – bilcy Mar 11 '21 at 16:32
  • https://stackoverflow.com/a/65871131/7976758 – phd Mar 11 '21 at 16:40
  • thank you. that fixed the error. – bilcy Mar 11 '21 at 17:03

0 Answers0