From 5b5546adf1c15ec250bd775211236e2f64978c53 Mon Sep 17 00:00:00 2001 From: Markus Teufelberger Date: Sat, 12 Jan 2019 15:04:33 +0100 Subject: [PATCH 1/3] bootstrap-os: Install pypy3 portable --- roles/bootstrap-os/files/bootstrap.sh | 21 ++++----------------- roles/bootstrap-os/templates/python_shim.j2 | 2 -- 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 roles/bootstrap-os/templates/python_shim.j2 diff --git a/roles/bootstrap-os/files/bootstrap.sh b/roles/bootstrap-os/files/bootstrap.sh index e54f4eaa2..631dd34c0 100755 --- a/roles/bootstrap-os/files/bootstrap.sh +++ b/roles/bootstrap-os/files/bootstrap.sh @@ -11,25 +11,12 @@ if [[ -e $BINDIR/.bootstrapped ]]; then exit 0 fi -PYPY_VERSION=v6.0.0 +PYPY_VERSION=6.0.0 -wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy3-$PYPY_VERSION-linux64.tar.bz2 | tar -xjf - -mv -n pypy3-$PYPY_VERSION-linux64 pypy3 +wget -O - https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-$PYPY_VERSION-linux_x86_64-portable.tar.bz2 | tar -xjf - +mv -n pypy3.5-$PYPY_VERSION-linux_x86_64-portable pypy3 -## library fixup -mkdir -p pypy3/lib -if [ -f /lib64/libncurses.so.5.9 ]; then - ln -snf /lib64/libncurses.so.5.9 $BINDIR/pypy3/lib/libtinfo.so.5 -elif [ -f /lib64/libncurses.so.6.1 ]; then - ln -snf /lib64/libncurses.so.6.1 $BINDIR/pypy3/lib/libtinfo.so.5 -fi - -cat > $BINDIR/python < Date: Sat, 12 Jan 2019 15:05:33 +0100 Subject: [PATCH 2/3] 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: From 87c9a871b938c7e9661c5992125f3bb5f94b8572 Mon Sep 17 00:00:00 2001 From: Markus Teufelberger Date: Sat, 12 Jan 2019 15:06:01 +0100 Subject: [PATCH 3/3] bootstrap-os: use the systemd module to stop and mask locksmithd --- roles/bootstrap-os/tasks/bootstrap-coreos.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/bootstrap-os/tasks/bootstrap-coreos.yml b/roles/bootstrap-os/tasks/bootstrap-coreos.yml index 0cd318d6e..1bd861ca7 100644 --- a/roles/bootstrap-os/tasks/bootstrap-coreos.yml +++ b/roles/bootstrap-os/tasks/bootstrap-coreos.yml @@ -46,6 +46,9 @@ PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}" - name: Bootstrap | Disable auto-upgrade - shell: "systemctl stop locksmithd.service && systemctl mask --now locksmithd.service" + systemd: + name: locksmithd.service + masked: true + state: stopped when: - not coreos_auto_upgrade