---
- yum: name={{ item }} state=installed
  with_items:
  - python-passlib
  - httpd
  - mod_ssl

- service: name=httpd state=started enabled=yes

- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
  with_items:
  - name_vhost.conf
  - mod_filter.conf
  - remove_sslv3.conf
  - mod_status.conf
  - various.conf
  notify: restart httpd

- shell: lokkit -s {{ item }}
  with_items:
  - http
  - https
  when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')

- firewalld: service={{ item }} permanent=true state=enabled immediate=yes
  with_items:
  - http
  - https
  when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'

- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
  when: log_retention_week is defined

---
- yum: name={{ item }} state=installed
  with_items:
  - python-passlib
  - httpd
  - mod_ssl
  - logrotate

- service: name=httpd state=started enabled=yes

- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
  with_items:
  - name_vhost.conf
  - mod_filter.conf
  - remove_sslv3.conf
  - mod_status.conf
  - various.conf
  notify: restart httpd

- shell: lokkit -s {{ item }}
  with_items:
  - http
  - https
  when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')

- firewalld: service={{ item }} permanent=true state=enabled immediate=yes
  with_items:
  - http
  - https
  when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'

- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
  when: log_retention_week is defined

Add logrotate by default for apache logs
Add logrotate by default for apache logs

(not present on Fedora anymore)
