2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Install the apache packages
|
2017-02-02 15:04:39 +01:00
|
|
|
apt: pkg={{ item }} state={{ apache_pkg_state }} update_cache=yes cache_valid_time=3600
|
2016-01-26 19:51:14 +01:00
|
|
|
with_items: '{{ apache_packages }}'
|
2015-10-14 18:22:30 +02:00
|
|
|
tags: [ 'apache', 'apache_main_packages' ]
|
|
|
|
|
2017-02-02 15:02:56 +01:00
|
|
|
- name: Install the apache modules packages
|
2017-02-02 15:04:39 +01:00
|
|
|
apt: pkg={{ item }} state={{ apache_pkg_state }} update_cache=yes cache_valid_time=3600
|
2017-02-02 15:02:56 +01:00
|
|
|
with_items: '{{ apache_modules_packages }}'
|
|
|
|
when: not apache_from_ppa
|
2016-01-26 19:51:14 +01:00
|
|
|
tags: [ 'apache', 'apache_additional_packages' ]
|
|
|
|
|
2017-02-02 14:55:40 +01:00
|
|
|
# - name: Load the required worker module
|
|
|
|
# apache2_module: name={{ item.name }} state={{ item.state }} force=yes
|
|
|
|
# with_items: '{{ apache_worker_modules }}'
|
|
|
|
# when: is_trusty
|
|
|
|
# notify: apache2 restart
|
|
|
|
# ignore_errors: True
|
|
|
|
# tags: [ 'apache', 'apache_modules', 'apache_workers_modules' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
2017-02-02 14:55:40 +01:00
|
|
|
# - name: Load the required modules
|
|
|
|
# apache2_module: name={{ item }} state=present force=yes
|
|
|
|
# with_items: '{{ apache_default_modules }}'
|
|
|
|
# notify: apache2 reload
|
|
|
|
# ignore_errors: True
|
|
|
|
# tags: [ 'apache', 'apache_modules' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
2017-02-02 15:02:56 +01:00
|
|
|
- name: Install the apache additional packages, if any
|
2017-02-02 15:04:39 +01:00
|
|
|
apt: pkg={{ item }} state={{ apache_pkg_state }} update_cache=yes cache_valid_time=3600
|
2017-02-02 15:02:56 +01:00
|
|
|
with_items: '{{ apache_additional_packages_list }}'
|
|
|
|
when: apache_additional_packages
|
|
|
|
tags: [ 'apache', 'apache_additional_packages' ]
|
|
|
|
|
2015-05-28 11:32:57 +02:00
|
|
|
- name: Remove the default virtualhost file
|
|
|
|
file: dest=/etc/apache2/sites-enabled/{{ item }} state=absent
|
|
|
|
with_items:
|
|
|
|
- 000-default
|
|
|
|
- 000-default.conf
|
|
|
|
notify: apache2 reload
|
2015-07-14 17:43:27 +02:00
|
|
|
tags: apache
|
2015-10-14 18:22:30 +02:00
|
|
|
|
|
|
|
- name: Ensure that the apache service is enabled and started
|
|
|
|
service: name=apache2 state=started enabled=yes
|
|
|
|
when: apache_service_enabled
|
2016-01-27 15:22:45 +01:00
|
|
|
ignore_errors: True
|
2015-10-14 18:22:30 +02:00
|
|
|
tags: apache
|
|
|
|
|
|
|
|
- name: Ensure that the apache service is disabled and stopped if we do not want it running
|
|
|
|
service: name=apache2 state=stopped enabled=no
|
|
|
|
when: not apache_service_enabled
|
2016-01-27 15:22:45 +01:00
|
|
|
ignore_errors: True
|
2015-10-14 18:22:30 +02:00
|
|
|
tags: apache
|