Skip to content
Snippets Groups Projects
Select Git revision
  • fadadc0affc73eef7149ca63ff8eeed2f0f288bf
  • master default protected
  • th/caddy-wip
  • th/caddy
  • th/lego
  • th/acmebot
  • pyzabbix
  • th/keycloak
8 results

protokollsystem.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    protokollsystem.yml 1.75 KiB
    ---
    # file: protokollsystem/tasks/main.yml
    
    - name: check our config
      command: "{{app_path}/bin/python {{app_path}}/configproxy.py check --log-level warning"
      args:
        chdir: "{{app_path}}"
      become: yes
      become_user: "{{app_user}}"
      changed_when: no
    
    - name: ensure data model upgrades are applied
      command: "{{app_path}}/bin/python {{app_path}}/server.py db upgrade"
      args:
        chdir: "{{app_path}}"
      become: yes
      become_user: "{{app_user}}"
      notify:
        - "restart uwsgi instance {{app.instance}}" 
    
    - name: ensure we have our local templates
      copy:
        src: "{{ protokolle_local_templates }}"
        dest: "{{ app_path }}/"
        owner: "{{ protokolle_user }}"
        group: "{{ protokolle_group }}"
        mode: 0644
      when: protokolle_local_templates|default('') != ''
      notify:
        - "restart uwsgi instance {{app.instance}}"
    
    - name: ensure one local template is the default
      file:
        src: "{{ app_path }}/{{ protokolle_latex_local_templates }}/{{ protokolle_local_templates_default }}/{{ item.path }}"
        dest: "{{ app_path }}/{{ protokolle_latex_local_templates }}/{{ item.path }}"
        state: link
      with_filetree: "{{ protokolle_local_templates }}/{{ protokolle_local_templates_default }}"
      when: protokolle_local_templates|default(False) and protokolle_local_templates_default|default(False)
      notify:
        - "restart uwsgi instance {{app.instance}}"
    
    - name: ensure the celery unit file exists
      template:
        src: apps/protokollsystem-celery.service.j2
        dest: "/etc/systemd/system/{{ app_name }}-celery.service"
        owner: root
        group: root
        mode: 0644
      notify:
        - reload systemd service files
        - "restart uwsgi instance {{app.instance}}"
    
    - name: ensure the celery service is enabled
      service:
        name: "{{app_name}}-celery"
        enabled: yes
        state: started