main.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git-tiny,php82,php82-pecl-memcached,php82-pecl-redis,php82-ldap,php82-filter,php82-session,py311-pexpect
  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. expect:
  27. command: "./install.sh -f -c /usr/local/www/hauk"
  28. chdir: /usr/local/src/hauk
  29. responses:
  30. Question:
  31. 'Config file already exists! Overwrite? [y/N]:' : 'n'
  32. 'Do you wish to open this file for editing now? [Y/n]: ' : 'n'
  33. ignore_errors: true
  34. - name: Nginx location file installed
  35. ansible.builtin.copy:
  36. src: nginx.conf
  37. dest: /usr/local/etc/nginx/locations/hauk.conf
  38. notify: Nginx restarted
  39. - name: Installed Hauk config file
  40. template:
  41. src: config.php.j2
  42. dest: /usr/local/etc/hauk/config.php
  43. mode: 0660
  44. notify: PHP-fpm restarted