From ac2fc8372c51004c485580d42c6fa83795398499 Mon Sep 17 00:00:00 2001 From: Steve Jorgensen Date: Thu, 27 Apr 2023 13:19:21 -0600 Subject: [PATCH] Fixes for epel repo name, and allow to specify a pip executable name (#25) * Fixes for epel repo name, and allow to specify a pip executable name * Renamed ansible_epel_name to ansible_epel_repo_name --------- Co-authored-by: Steven Jorgensen --- README.md | 9 +++++++++ defaults/main.yml | 6 ++++++ tasks/setup-RedHat.yml | 2 +- tasks/setup-pip.yml | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45f2292..320fd2a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,15 @@ If `ansible_install_method` is set to `pip`, the specific Ansible version to be 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. + ansible_pip_executable: '' + +if `ansible_install_method` is set to `pip`, this is the path to the pip executable, in case your platform doesn't find the right name. + + ansible_epel_repo_name: 'epel' + +if `ansible_install_method` is set to `package` and you are on a RHEL machine, and your local satellite server admins decided to name the epel repository something other than epel, this variable gives you the opportunity to provide the right name. + + ## Dependencies None. diff --git a/defaults/main.yml b/defaults/main.yml index 8557c81..f1c55d9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,3 +9,9 @@ ansible_install_version_pip: '' # Which extra arguments should be gived to pip ansible_install_pip_extra_args: '' + +# path to pip executable to use +ansible_pip_executable: '' + +# name of epel repo if it isn't standard +ansible_epel_repo_name: 'epel' diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 170f243..3a45666 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -3,4 +3,4 @@ package: name: ansible state: "{{ ansible_package_state }}" - enablerepo: epel + enablerepo: "{{ ansible_epel_repo_name }}" diff --git a/tasks/setup-pip.yml b/tasks/setup-pip.yml index d16977a..cd8d879 100644 --- a/tasks/setup-pip.yml +++ b/tasks/setup-pip.yml @@ -2,5 +2,6 @@ - name: Install Ansible via Pip. pip: name: ansible + executable: "{{ ansible_pip_executable | default(omit) }}" version: "{{ ansible_install_version_pip | default(omit) }}" extra_args: "{{ ansible_install_pip_extra_args | default(omit) }}"