freehck.script_with_locks

freehck.script_with_locks

Diese Rolle kopiert das Skript, das einen Befehl mit dem angegebenen Lock ausführt.

Sehr nützlich für Cronjobs. Führen Sie es mit --help aus, um die Optionen zu erfahren.

Rollenvariablen

with_locks_script_dir: Verzeichnis zur Installation des Skripts, Standardwert "/opt/scripts"

with_locks_script_name: Skriptname, Standardwert "with-locks"

with_locks_install_deps: Abhängigkeiten installieren (moreutils), Standardwert "ja"

Beispiel-Playbook

- hosts:
    - database
  become: ja
  vars:
    lockfile: "/var/lock/db-update-index.lock"
    logfile: "/var/log/db-update-index.log"
  roles:
    - role: freehck.script_with_locks
    - role: freehck.crontask
      crontask_file: "database"
      crontask_name: "Index aktualisieren"
      crontask_minute: "*/30"
      crontask_user: "root"
      crontask_job: "/opt/scripts/with-locks --timestamp --pid --highlight-errors --silent --lock {{ lockfile }} --log {{ logfile }} -- /opt/scripts/perform_update_index.sh"
      # oder dasselbe ohne lange Optionen:
      # crontask_job: "/opt/scripts/with-locks -tpes -l {{ lockfile }} -j {{ logfile }} -- /opt/scripts/perform_update_index.sh"

Lizenz

MIT

Autoreninformation

Dmitrii Kashin, freehck@freehck.ru

Über das Projekt

create a script that allows to run commands with locks

Installieren
ansible-galaxy install freehck.script_with_locks
GitHub Repository
Lizenz
mit
Downloads
2k
Besitzer