From 7155286ed00a8bce09a948fb54fb4eeb85027e49 Mon Sep 17 00:00:00 2001 From: "Michael S. Pedersen" Date: Thu, 26 Nov 2020 11:19:08 +0000 Subject: Update BMRA to v2.0 Also adds configuration of BMRA through the existing hw_config files (idf, pdf) and better handling of dependencies. Signed-off-by: Michael S. Pedersen Change-Id: Iedaf249f01ea3e1e00c889e846e21644adff98c7 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71504 Tested-by: jenkins-ci Reviewed-by: Rihab Banday Reviewed-by: Georg Kunz --- playbooks/roles/pre-install/tasks/main.yml | 26 ++++++++++++++++++++++++++ playbooks/roles/pre-install/vars/RedHat.yml | 2 ++ 2 files changed, 28 insertions(+) (limited to 'playbooks/roles/pre-install') 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)' -- cgit 1.2.3-korg