Commit 6fae4abe authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors-upgrade: adapt to new ors-amarisoft SR

parent e6bbdfbb
#!/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 - name: Get hostname
shell: hostname shell: hostname
register: 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 - name: Check hostname
debug: var=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: Install rm-tmp-lte script - name: Install rm-tmp-lte script
copy: src=rm-tmp-lte dest={{ install_folder }} owner=root mode=770 copy: src=rm-tmp-lte 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: Give permission to slapuser to remove tmp files owned by other slapuser - name: Give permission to slapuser to remove tmp files owned by other slapuser
copy: src=slapuser-rm-tmp dest=/etc/sudoers.d owner=root mode=440 copy: src=slapuser-rm-tmp dest=/etc/sudoers.d owner=root mode=440
......
--- ---
current_lte_version: "2021-09-18"
install_folder: "/opt/amarisoft" 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