Browse Source

bootstrap-os: simplify pip3 installation on coreos

pull/4033/head
Markus Teufelberger 5 years ago
parent
commit
5e2c14e916
2 changed files with 11 additions and 22 deletions
  1. 3
      roles/bootstrap-os/files/runner
  2. 30
      roles/bootstrap-os/tasks/bootstrap-coreos.yml

3
roles/bootstrap-os/files/runner

@ -1,3 +0,0 @@
#!/bin/bash
BINDIR="/opt/bin"
LD_LIBRARY_PATH=$BINDIR/pypy3/lib:$LD_LIBRARY_PATH $BINDIR/pypy3/bin/$(basename $0) $@

30
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 pip
shell: "{{ ansible_python_interpreter }} -m ensurepip"
when: need_pip.rc != 0
- name: Bootstrap | Install pip launcher
copy:
src: runner
- name: Bootstrap | Install pip3
command: "{{ ansible_python_interpreter }} -m ensurepip"
args:
creates: "{{ bin_dir }}/pypy3/bin/pip3"
register: pip_installed
- 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:

Loading…
Cancel
Save