freehck.script_with_locks
freehck.script_with_locks
Este rol copia el script que ejecuta cualquier comando con un bloqueo especificado.
Es muy útil para trabajos de crontab. Ejecútalo con --help
para aprender las opciones.
Variables del Rol
with_locks_script_dir
: directorio para instalar el script, por defecto "/opt/scripts"
with_locks_script_name
: nombre del script, por defecto "with-locks"
with_locks_install_deps
: instalar dependencias (moreutils), por defecto "sí"
Ejemplo de Playbook
- hosts:
- database
become: sí
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: "actualizar índice"
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"
# o lo mismo sin opciones largas:
# crontask_job: "/opt/scripts/with-locks -tpes -l {{ lockfile }} -j {{ logfile }} -- /opt/scripts/perform_update_index.sh"
Licencia
MIT
Información del Autor
Dmitrii Kashin, freehck@freehck.ru
Acerca del proyecto
create a script that allows to run commands with locks
Instalar
ansible-galaxy install freehck.script_with_locks
Licencia
mit
Descargas
2k
Propietario