Reputation: 30895
im using ansible 2.9 from venv i created using python 3.7 in AWS Linux
the remote hosts are using default python 2.7 and i can't upgrade it
I'm using boto3 and need to install it but first, i need pip to be installed on remote
and i try to invoke it but i keep getting :
fatal: [10.0.6.182]: FAILED! => changed=false
invocation:
module_args:
chdir: null
editable: false
executable: null
extra_args: null
name:
- pip
requirements: null
state: latest
umask: null
version: null
virtualenv: null
virtualenv_command: virtualenv
virtualenv_python: null
virtualenv_site_packages: false
msg: Unable to find any of pip2, pip to use. pip needs to be installed.
I'm using :
- name: Upgrade pip
pip: name=pip state=latest
tags:
- packages
- name: Ensure botocore and boto3 modules are installed
pip:
name: [ "boto3", "botocore"]
extra_args: "--user"
Upvotes: 1
Views: 4147
Reputation: 423
I think you need use yum to install python2-pip first, please have a try. if you have further questions, please let me know.
- name: install python2-pip
yum:
name: python2-pip
state: present
- name: Upgrade pip
pip: name=pip state=latest
tags:
- packages
- name: Ensure botocore and boto3 modules are installed
pip:
name: [ "boto3", "botocore"]
extra_args: "--user"
Upvotes: 1