|
|
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
- name: Install apache packages |
|
|
|
|
|
apt: |
|
|
|
|
|
name: "{{item}}" |
|
|
|
|
|
state: present |
|
|
|
|
|
loop: |
|
|
|
|
|
- "{{apache_packages}}" |
|
|
|
|
|
- "{{apache_extra_packages}}" |
|
|
|
|
|
|
|
|
|
|
|
- name: Configure Apache ip/port. |
|
|
|
|
|
template: |
|
|
|
|
|
src: ports.conf.j2 |
|
|
|
|
|
dest: "{{apache_server_root}}/ports.conf" |
|
|
|
|
|
notify: restart apache |
|
|
|
|
|
|
|
|
|
|
|
- name: Enable Apache mods. |
|
|
|
|
|
apache2_module: |
|
|
|
|
|
state: present |
|
|
|
|
|
name: "{{item}}" |
|
|
|
|
|
loop: "{{ apache_mods_enabled + apache_extra_mods_enabled }}" |
|
|
|
|
|
notify: restart apache |
|
|
|
|
|
|
|
|
|
|
|
- name: Disable Apache mods. |
|
|
|
|
|
apache2_module: |
|
|
|
|
|
state: absent |
|
|
|
|
|
name: "{{item}}" |
|
|
|
|
|
loop: "{{ apache_mods_disabled }}" |
|
|
|
|
|
notify: restart apache |
|
|
|
|
|
|
|
|
|
|
|
- name: Remove default vhost in sites-enabled. |
|
|
|
|
|
file: |
|
|
|
|
|
path: "{{ apache_conf_path }}/sites-enabled/{{ apache_default_vhost_filename }}" |
|
|
|
|
|
state: absent |
|
|
|
|
|
notify: restart apache |
|
|
|
|
|
when: apache_remove_default_vhost |
|
|
|
|
|
|
|
|
|
|
|
- name: Ensure Apache has selected state and enabled on boot. |
|
|
|
|
|
service: |
|
|
|
|
|
name: "{{ apache_service }}" |
|
|
|
|
|
state: "{{ apache_state }}" |
|
|
|
|
|
enabled: "{{ apache_state == 'started' }}" |
|
|
|
|
|
|