From 5e2c14e916c0cdddfb9d0aa5be73118ca9857490 Mon Sep 17 00:00:00 2001 From: Markus Teufelberger Date: Sat, 12 Jan 2019 15:05:33 +0100 Subject: [PATCH] bootstrap-os: simplify pip3 installation on coreos --- roles/bootstrap-os/files/runner | 3 -- roles/bootstrap-os/tasks/bootstrap-coreos.yml | 28 +++++++------------ 2 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 roles/bootstrap-os/files/runner diff --git a/roles/bootstrap-os/files/runner b/roles/bootstrap-os/files/runner deleted file mode 100644 index f0f689f18..000000000 --- a/roles/bootstrap-os/files/runner +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -BINDIR="/opt/bin" -LD_LIBRARY_PATH=$BINDIR/pypy3/lib:$LD_LIBRARY_PATH $BINDIR/pypy3/bin/$(basename $0) $@ diff --git a/roles/bootstrap-os/tasks/bootstrap-coreos.yml b/roles/bootstrap-os/tasks/bootstrap-coreos.yml index 182fc39fb..0cd318d6e 100644 --- a/roles/bootstrap-os/tasks/bootstrap-coreos.yml +++ b/roles/bootstrap-os/tasks/bootstrap-coreos.yml @@ -23,27 +23,19 @@ tags: - facts -- name: Bootstrap | Check if we need to install pip - shell: "pip3 --version" - register: need_pip - failed_when: false - changed_when: false - check_mode: no - tags: - - facts - environment: - PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}" +- name: Bootstrap | Install pip3 + command: "{{ ansible_python_interpreter }} -m ensurepip" + args: + creates: "{{ bin_dir }}/pypy3/bin/pip3" + register: pip_installed -- name: Bootstrap | Install pip - shell: "{{ ansible_python_interpreter }} -m ensurepip" - when: need_pip.rc != 0 - -- name: Bootstrap | Install pip launcher - copy: - src: runner +- name: Bootstrap | Install pip3 link + file: + src: "{{ bin_dir }}/pypy3/bin/pip3" dest: "{{ bin_dir }}/pip3" mode: 0755 - when: need_pip.rc != 0 + state: link + when: pip_installed.changed - name: Install required python modules pip: