diff --git a/molecule/resources/playbooks/verify.yml b/molecule/resources/playbooks/verify.yml index 75b4ec42da9476fb96b73bf285acf95e9984aadc..61a63af88e67d1af2d26dd88fd32246790dce394 100644 --- a/molecule/resources/playbooks/verify.yml +++ b/molecule/resources/playbooks/verify.yml @@ -42,3 +42,15 @@ that: "'MediaConch Command Line Interface' in mediaconch_output.stdout" success_msg: MediaConch runs as expected. fail_msg: MediaConch couldn't be run without errors. + + - name: Install shellcheck. + ansible.builtin.dnf: + name: "ShellCheck" + state: latest + become: true + - name: Run shellcheck for deployed Shell scripts. + ansible.builtin.command: + cmd: "shellcheck --shell=bash {{ item }}" + loop: + - "/usr/local/bin/nfs_timeout_notification.service.sh" + become: true diff --git a/molecule/virtualbox_alma8/molecule.yml b/molecule/virtualbox_alma8/molecule.yml index 960221bfdb2d2dc41dec757365222b5fe23c05be..b1facf5bb4475888fd195fc4e8874ade20a4d77c 100644 --- a/molecule/virtualbox_alma8/molecule.yml +++ b/molecule/virtualbox_alma8/molecule.yml @@ -57,6 +57,7 @@ provisioner: # https://stackoverflow.com/questions/57435811/ansible-molecule-pass-multiple-vault-ids # vault_identity_list: "@$HOME/.ansible/roles/lza_install_common.pass, @$HOME/.ansible/roles/passfile_1.pass" vault_identity_list: "../../../lza_install_common.pass, ../../../lza_rosetta_app.pass" + stdout_callback: debug vvv: false playbooks: # create: ../resources/playbooks/create.yml diff --git a/tasks/rosetta/install_mediaconch.yml b/tasks/rosetta/install_mediaconch.yml index 9c25c0f29e31b3cb0317235e76fc09150fbcb554..3cf606ffec3af4a2a76ec42760c8d1d855101779 100644 --- a/tasks/rosetta/install_mediaconch.yml +++ b/tasks/rosetta/install_mediaconch.yml @@ -20,6 +20,14 @@ update_cache: true state: latest +- name: create directory + ansible.builtin.file: + path: "/operational_shared/software/" + state: directory + mode: "0o755" + owner: "{{ vault_rosetta_user }}" + group: "{{ vault_rosetta_group }}" + - name: check MediaConch symlink ansible.builtin.stat: path: "/operational_shared/software/mediaconch" diff --git a/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 b/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 index ad5e7d4e5a7ad1d8d16374edff3ca0ece0b62125..45e49ae2accb6760e894d90ceaa09e9a17334af2 100644 --- a/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 +++ b/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 @@ -4,7 +4,7 @@ WAIT_BETWEEN_MAILS_IN_SECONDS={{ vault_nfs_timeout_notification_service.wait_bet NO_MAIL_UNTIL_EPOCH=0; journalctl -f | while read -r LINE; do TIMEOUT=$(echo "${LINE}" | grep "nfs.*timed out"); - if [[ ! -z "${TIMEOUT}" ]]; then + if [[ -n "${TIMEOUT}" ]]; then TIME=$(date +%s); if [[ "${TIME}" -ge "${NO_MAIL_UNTIL_EPOCH}" ]]; then NO_MAIL_UNTIL_EPOCH=$((TIME + WAIT_BETWEEN_MAILS_IN_SECONDS)); @@ -13,4 +13,4 @@ journalctl -f | while read -r LINE; do fi; fi; TIMEOUT=""; -done; \ No newline at end of file +done;