--- # SPDX-license-identifier: Apache-2.0 ############################################################################## # Copyright (c) 2020 Samsung Electronics # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # 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" - name: Install BRMA requirements become: true package: 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