Skip to content
Snippets Groups Projects
Commit a93f3682 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: install repairtools from Debian package repository instead of manually compiling them

parent e7d1a428
No related branches found
No related tags found
No related merge requests found
--- ---
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_module.html
- name: systemctl daemon-reload - name: systemctl daemon-reload
systemd: systemd:
daemon-reload: "yes" daemon-reload: "yes"
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_module.html
- name: restart repairtools
systemd:
name: "{{ item }}"
state: restarted
loop:
- "repair_daemon_ddz.service"
- "repair_daemon_digas.service"
...@@ -16,13 +16,33 @@ ...@@ -16,13 +16,33 @@
tags: [apt] tags: [apt]
when: "ansible_facts['distribution'] == 'Debian'" when: "ansible_facts['distribution'] == 'Debian'"
- name: cleanup legacy tools
file:
path: "{{ item }}"
state: absent
loop:
- "/usr/local/bin/checkit_tiff"
- "/usr/local/bin/fixit_tiff"
- "/home/{{ vault_service_user }}/.cache/SLUB_LZA_Reparaturtool.cache"
notify: restart repairtools
- name: install repairtool (package dependencies are encoded in the package) - name: install repairtool (package dependencies are encoded in the package)
apt: apt:
name: [ name: [
'libslub-lza-repair-perl' 'libslub-lza-repair-perl',
'checkit_tiff',
'fixit_tiff'
] ]
state: present state: present
tags: [repairtools, apt] tags: [apt]
- name: install checkit_tiff config
copy:
src: "/usr/share/checkit_tiff/example_configs/cit_tiff6_baseline_SLUB.cfg"
dest: "/etc/cit_tiff6_baseline_SLUB.cfg"
owner: "{{ vault_service_user }}"
group: "{{ vault_service_user }}"
mode: 0600
- name: create caching directory - name: create caching directory
file: file:
...@@ -35,22 +55,6 @@ ...@@ -35,22 +55,6 @@
- "/home/{{ vault_service_user }}/.cache/" - "/home/{{ vault_service_user }}/.cache/"
- "/home/{{ vault_service_user }}/.config/repair/bin/" - "/home/{{ vault_service_user }}/.config/repair/bin/"
- "/home/{{ vault_service_user }}/.config/repair/cfg/" - "/home/{{ vault_service_user }}/.config/repair/cfg/"
tags: [repairtools]
### TIFF-REPAIR-TOOLS INSTALLIEREN ###
- name: checkit_tiff und fixit_tiff kompilieren und installieren (1/2)
template:
src: "tiff_treatment_loop/compile_checkit.sh.j2"
dest: "/tmp/compile_checkit.sh"
mode: "0544"
register: checkit_tiff_result
tags: [repairtools]
- name: checkit_tiff und fixit_tiff kompilieren und installieren (2/2)
command: bash /tmp/compile_checkit.sh &> /tmp/compile_checkit.log # noqa 301
#when: checkit_tiff_result.changed
#tags: [repairtools, molecule-notest]
tags: [repairtools]
- name: Symlinks zu Binaries und Configs für checkit_tiff und fixit_tiff erstellen - name: Symlinks zu Binaries und Configs für checkit_tiff und fixit_tiff erstellen
file: file:
...@@ -60,10 +64,9 @@ ...@@ -60,10 +64,9 @@
owner: "{{ vault_service_user }}" owner: "{{ vault_service_user }}"
group: "{{ vault_service_user }}" group: "{{ vault_service_user }}"
with_items: with_items:
- src: "/usr/local/bin/checkit_tiff" - src: "/usr/bin/checkit_tiff"
dest: "/home/{{ vault_service_user }}/.config/repair/bin/checkit_tiff" dest: "/home/{{ vault_service_user }}/.config/repair/bin/checkit_tiff"
- src: "/usr/local/bin/fixit_tiff" - src: "/usr/bin/fixit_tiff"
dest: "/home/{{ vault_service_user }}/.config/repair/bin/fixit_tiff" dest: "/home/{{ vault_service_user }}/.config/repair/bin/fixit_tiff"
- src: "/etc/cit_tiff6_baseline_SLUB.cfg" - src: "/etc/cit_tiff6_baseline_SLUB.cfg"
dest: "/home/{{ vault_service_user }}/.config/repair/cfg/cit_tiff6_baseline_SLUB.cfg" dest: "/home/{{ vault_service_user }}/.config/repair/cfg/cit_tiff6_baseline_SLUB.cfg"
tags: [repairtools]
#!/usr/bin/env bash
set -ex
FIXIT_PATH="fixit_tiff"
GITDIR="/tmp/git/"
CHECKIT_TIFF_GITREPO="{{ vault_checkit_tiff_gitrepo }}"
FIXIT_TIFF_GITREPO="{{ vault_fixit_tiff_gitrepo }}"
# CHECKIT_TIFF_PLUGIN_GITREPO="{{ vault_checkit_tiff_plugin_gitrepo }}"
# DEB_PACKAGES="git make cmake build-essential libpcre3 libpcre3-dev libtiff5 libtiff5-dev"
DEB_PACKAGES="git make cmake build-essential libpcre3-dev libtiff5-dev"
[[ -d "${GITDIR}" ]] && rm -r "${GITDIR}" && echo "removed ${GITDIR}"
mkdir "${GITDIR}" && cd "${GITDIR}"
pwd
apt-get install -y ${DEB_PACKAGES}
# THIS IS A BAD IDEA!!! ONLY SKIP CERTIFICATE VALIDATION IF THERE'S NO OTHER
# ALTERNATIVE!!!
export GIT_SSL_NO_VERIFY=true
# git clone ${CHECKIT_TIFF_PLUGIN_GITREPO}
# cd ./checkit_tiff_plugin4rosetta || ( echo "Couldn't cd to ./checkit_tiff_plugin4rosetta, exiting." && exit 1 )
# tag_current=$( head deploy_checkit_tiff/Dockerfile | grep -Fv '#' | grep -F "checkit_tiff_current_version=" | cut -d "=" -f 2 )
tag_current="{{ checkit_tiff_version }}"
# compile checkit_tiff CURRENT version
cd "${GITDIR}" || ( echo "Couldn't cd to $GITDIR, exiting." && exit 1 )
git clone "${CHECKIT_TIFF_GITREPO}"
cd "${GITDIR}checkit_tiff${CHECKIT_CURRENT_NAME}/"
git checkout "tags/${tag_current}"
mkdir build/ && cd build/
#cmake ../src/
cmake -DCMAKE_C_FLAGS="-O3 -s -Wno-unused-function -fstack-check -fstack-protector-strong -Wformat -Werror=format-security" ../src/
make -j
cp checkit_tiff /usr/local/bin/checkit_tiff && \
chown lza.lza /usr/local/bin/checkit_tiff && \
chmod 0700 /usr/local/bin/checkit_tiff
cp ../example_configs/cit_tiff6_baseline_SLUB.cfg /etc/cit_tiff6_baseline_SLUB.cfg && \
chown lza.lza /usr/local/etc/cit_tiff6_baseline_SLUB.cfg && \
chmod 0600 /usr/local/etc/cit_tiff6_baseline_SLUB.cfg
# compile fixit_tiff
cd ${GITDIR} || ( echo "Couldn't cd to $GITDIR, exiting." && exit 1 )
git clone "${FIXIT_TIFF_GITREPO}"
mkdir -p ${FIXIT_PATH}/build/ && cd ${FIXIT_PATH}/build/
cmake ../src/
make -j
cp fixit_tiff /usr/local/bin/fixit_tiff && \
chown lza.lza /usr/local/bin/fixit_tiff && \
chmod 0700 /usr/local/bin/fixit_tiff
# cleanup
apt-get purge -y ${DEB_PACKAGES}
apt-get clean -y
apt-get autoremove -y
rm -r /tmp/git/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment