You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. ---
  2. - name: Create venv and install boussole with pip
  3. pip:
  4. virtualenv: "{{ boussole_venv_dir }}"
  5. virtualenv_command: python{{ python_version }} -m venv
  6. name: boussole
  7. - name: Create systemd service file
  8. template:
  9. src: boussole.service.jinja2
  10. dest: /etc/systemd/system/boussole.service
  11. owner: root
  12. group: root
  13. mode: 0644
  14. - name: Start and enable boussole service
  15. service:
  16. name: boussole
  17. state: started
  18. enabled: true
  19. - name: Create directory for compiled CSS
  20. file:
  21. path: "{{ app_dir }}/static/css"
  22. state: directory
  23. owner: "{{ app_username }}"
  24. group: "{{ app_username }}"
  25. mode: 0755
  26. - name: Check if any compiled CSS files exist
  27. find:
  28. path: "{{ app_dir }}/static/css"
  29. patterns:
  30. - "*.css"
  31. register: compiled_css_files
  32. - name: Run boussole manually if no compiled CSS exists yet
  33. command:
  34. chdir: "{{ app_dir }}"
  35. cmd: "{{ boussole_venv_dir }}/bin/boussole compile --backend=yaml --config=boussole.yaml"
  36. environment:
  37. LC_ALL: C.UTF-8
  38. LANG: C.UTF-8
  39. when: compiled_css_files.matched == 0