main.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git-tiny,php80,php80-openssl,php80-pecl-memcached,php80-pecl-redis,php80-ldap,php80-filter,php80-session
  5. state: latest
  6. - name: PHP-fpm enabled
  7. shell: sysrc php_fpm_enable="YES"
  8. - name: Source folder exists
  9. file: path=/usr/local/src mode=0755 state=directory
  10. - name: Conf folder exists
  11. file: path=/usr/local/etc/hauk mode=0755 state=directory
  12. - name: Www folder exists
  13. file: path=/usr/local/www mode=0755 state=directory
  14. - name: Hauk source deployed
  15. git:
  16. repo: "https://github.com/bilde2910/hauk"
  17. dest: /usr/local/src/hauk
  18. force: yes
  19. accept_hostkey: yes
  20. update: yes
  21. - name: Removed Hauk config file
  22. file:
  23. state: absent
  24. path: /usr/local/etc/hauk/config.php
  25. - name: Hauk installed
  26. shell:
  27. cmd: "./install.sh -f -c /usr/local/www/hauk"
  28. chdir: /usr/local/src/hauk
  29. - name: Nginx location file installed
  30. ansible.builtin.copy:
  31. src: nginx.conf
  32. dest: /usr/local/etc/nginx/locations/hauk.conf
  33. notify: Nginx restarted
  34. - name: Installed Hauk config file
  35. template:
  36. src: config.php.j2
  37. dest: /usr/local/etc/hauk/config.php
  38. mode: 0660
  39. notify: PHP-fpm restarted