diff options
Diffstat (limited to 'playbooks/roles/pre-install')
-rw-r--r-- | playbooks/roles/pre-install/tasks/main.yml | 26 | ||||
-rw-r--r-- | playbooks/roles/pre-install/vars/RedHat.yml | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/playbooks/roles/pre-install/tasks/main.yml b/playbooks/roles/pre-install/tasks/main.yml index db6534d..9b725c7 100644 --- a/playbooks/roles/pre-install/tasks/main.yml +++ b/playbooks/roles/pre-install/tasks/main.yml @@ -8,6 +8,13 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +- name: Ensure Python3 is installed (Equinix Metal) + raw: yum install -y python3 + when: lookup('env', 'VENDOR') == 'equinix-metal' + +- name: Gather facts + setup: + - name: Load distro variables include_vars: file: "{{ ansible_os_family }}.yml" @@ -18,3 +25,22 @@ name: "{{ item }}" state: present with_items: "{{ bmra_pkgs }}" + +- name: Check if Python is present in PATH + shell: "which python" + register: pypath + failed_when: false + +- name: Check if /usr/bin/python exists + stat: + path: /usr/bin/python + register: pybin + +- name: Create symlink for Python + file: + src: /usr/bin/python3 + dest: /usr/bin/python + state: link + when: + - not pybin.stat.exists + - pypath.rc != 0 diff --git a/playbooks/roles/pre-install/vars/RedHat.yml b/playbooks/roles/pre-install/vars/RedHat.yml index 5adac50..cf20b89 100644 --- a/playbooks/roles/pre-install/vars/RedHat.yml +++ b/playbooks/roles/pre-install/vars/RedHat.yml @@ -12,3 +12,5 @@ bmra_pkgs: - lshw - pciutils - ethtool + - python3 + - 'dnf-command(config-manager)' |