Commit 3c4c9495 authored by Joanne Hugé's avatar Joanne Hugé

Add ors and ors-upgrader playbooks

parent 2be17561
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars_files:
- settings/ors-upgrade.yml
roles:
- ors-upgrade
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
roles:
- ors
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Missing argument"; exit 1;
fi
element-in () {
local e match="$1"; shift
for e in "$@"; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
BINARY=$1
# List of hash for all supported lteenb / lteenb-avx2 binaries
SHA256_LIST=(\
"03e8641094b1909562dbf25678354ea09edb8109743cc3cdda43c4b423a36c07" \
"09e5ff98bb6839e72d14728e9839fcbfb5873f786281b658a6c0d790ac1ff227" \
)
element-in $(sha256sum $BINARY) "${SHA256_LIST[@]}" || { echo "$1 sha256sum mismatch" >&2; exit 1; }
# relative RPATH gets ignored after capability has been set on binary
patchelf --set-rpath $(dirname $BINARY) $BINARY;
setcap cap_sys_nice=+pe $BINARY;
slapsoft ALL=NOPASSWD:/opt/amarisoft/give-cap-sys-nice-lteenb
---
- name: Get current LTE version
stat: path=/opt/amarisoft/lte
register: lte_version
- name: Get hostname
shell: hostname
register: hostname
- name: Check new LTE
debug: msg="New amarisoft LTE available"
when: lte_version.stat.lnk_target is not search(current_lte_version)
- name: Check hostname
debug: var=hostname
- name: Install give-cap-sys-nice-lteenb script
copy: src=give-cap-sys-nice-lteenb dest={{ install_folder }} owner=root mode=770
- name: Give permission to slapsoft to execute give-cap-sys-nice-lteenb script
copy: src=slapsoft-give-cap-sys-nice-lteenb dest=/etc/sudoers.d owner=root mode=440
---
- name: Install upgrader
shell: ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook=ors-upgrade.yml upgrade_kernel=False"
---
current_lte_version: "2021-09-18"
install_folder: "/opt/amarisoft"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment