diff --git a/README.md b/README.md index b29e6b3..45f2292 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ Whether to install Ansible via the system `package` manager (`apt`, `yum`, `dnf` If `ansible_install_method` is set to `pip`, the specific Ansible version to be installed via Pip. If not set, the latest version of Ansible will be installed. + ansible_install_pip_extra_args: '' + +If `ansible_install_method` is set to `pip`, the extra arguments to be given to `pip` are listed here. If not set, no extra arguments are given. + ## Dependencies None. @@ -38,6 +42,7 @@ Install from pip: vars: ansible_install_method: pip ansible_install_version_pip: "2.7.0" + ansible_install_pip_extra_args: "--user" roles: - role: geerlingguy.pip - role: geerlingguy.ansible diff --git a/defaults/main.yml b/defaults/main.yml index 5898c33..8557c81 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,3 +6,6 @@ ansible_install_method: package # Used only if ansible_install_method is 'pip'. If empty, defaults to latest. ansible_install_version_pip: '' + +# Which extra arguments should be gived to pip +ansible_install_pip_extra_args: '' diff --git a/molecule/default/pip.yml b/molecule/default/pip.yml index 60e298e..888f2d3 100644 --- a/molecule/default/pip.yml +++ b/molecule/default/pip.yml @@ -6,6 +6,7 @@ vars: ansible_install_method: pip ansible_install_version_pip: "2.6.2" + ansible_install_pip_extra_args: "--user" roles: - role: geerlingguy.pip diff --git a/tasks/setup-pip.yml b/tasks/setup-pip.yml index a91049b..d16977a 100644 --- a/tasks/setup-pip.yml +++ b/tasks/setup-pip.yml @@ -3,3 +3,4 @@ pip: name: ansible version: "{{ ansible_install_version_pip | default(omit) }}" + extra_args: "{{ ansible_install_pip_extra_args | default(omit) }}"