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.

69 lines
2.2 KiB

  1. ---
  2. - name: Manage and configure the Apache HTTP Server
  3. collections: [ 'debops.debops', 'debops.roles01',
  4. 'debops.roles02', 'debops.roles03' ]
  5. hosts: [ 'debian10' ]
  6. become: True
  7. environment: '{{ inventory__environment | d({})
  8. | combine(inventory__group_environment | d({}))
  9. | combine(inventory__host_environment | d({})) }}'
  10. vars:
  11. apache__base_packages:
  12. - libapache2-mod-php7.4
  13. apache__role_modules:
  14. 'headers': True
  15. 'alias': True
  16. 'php7.4': True
  17. 'ssl':
  18. enabled: '{{ True if (apache__https_listen and apache__https_enabled) else False }}'
  19. 'security2':
  20. enabled: '{{ apache__security_module_enabled|bool }}'
  21. 'status':
  22. enabled: '{{ apache__status_enabled|bool }}'
  23. config: |
  24. <Location /server-status>
  25. # Revoke default permissions granted in `/etc/apache2/mods-available/status.conf`.
  26. Require all denied
  27. </Location>
  28. 'socache_shmcb':
  29. enabled: '{{ True
  30. if (apache__ocsp_stapling_enabled|bool
  31. and "shmcb" in apache__ocsp_stapling_cache)
  32. else omit }}'
  33. 'authz_host':
  34. enabled: '{{ True
  35. if (apache__status_enabled|bool
  36. and apache__status_allow_localhost)
  37. else omit }}'
  38. 'rewrite':
  39. enabled: '{{ True
  40. if (apache__register_mod_rewrite_used is defined and
  41. apache__register_mod_rewrite_used.rc|d(1) == 0)
  42. else omit }}'
  43. apache__allow:
  44. - 0.0.0.0
  45. # apache__default_vhost:
  46. # name: '{{ apache__default_vhost_name }}'
  47. # filename: '000-default'
  48. # root: '/var/www/html'
  49. pre_tasks:
  50. - name: Prepare apache environment
  51. import_role:
  52. name: 'apache'
  53. tasks_from: 'main_env'
  54. tags: [ 'role::apache', 'role::apache:env' ]
  55. roles:
  56. # - role: ferm
  57. # tags: [ 'role::ferm', 'skip::ferm' ]
  58. # ferm__dependent_rules:
  59. # - '{{ apache__ferm__dependent_rules }}'
  60. - role: apache
  61. tags: [ 'role::apache', 'skip::apache' ]