+Skript um unbenutzte Kunden zu loeschen

This commit is contained in:
phil 2021-08-07 12:50:06 +02:00
parent cc0b9a729e
commit 4282a7536f
2 changed files with 14 additions and 0 deletions

View file

@ -1,4 +1,5 @@
--- ---
cron_file: /etc/cron.d/zammad
debian_version: buster debian_version: buster
ruby_path: "{{ zammad_user_home }}/.rbenv" ruby_path: "{{ zammad_user_home }}/.rbenv"

View file

@ -28,3 +28,16 @@
- name: "zammad: Ermittle Ruby-Version" - name: "zammad: Ermittle Ruby-Version"
shell: cat "{{ zammad_home }}/.ruby-version" shell: cat "{{ zammad_home }}/.ruby-version"
register: ruby_version register: ruby_version
- name: "zammad: Kopiere Skripte"
template:
src: zammad-delete-customers.rb.j2
dest: "{{ local_scripts_dir }}/zammad-delete-customers.rb"
- name: "zammad: Richte cron ein"
cron:
cron_file: "{{ cron_file }}"
user: "{{ zammad_user }}"
name: "Loesche unbenutzte Zammad-Kunden"
day: "1"
job: "cd {{ zammad_home }} && RAILS_ENV=production rbenv exec rails r {{ local_scripts_dir }}/zammad-delete-customers.rb"