install-raspberry/inst-apache.yml

47 lines
958 B
YAML

---
- name: install apache
yum:
state: installed
name:
- httpd
- mod_ssl
- name: start and enable the httpd service
service:
state: started
name: httpd
enabled: true
- name: open http port
firewalld:
service: http
permanent: true
immediate: true
state: enabled
- name: open https port
firewalld:
service: https
permanent: true
immediate: true
state: enabled
- name: create cert path
file:
path: /etc/httpd/certs
state: directory
- name: delete welcome.conf
file:
path: "{{ item }}"
state: absent
with_items:
- /etc/httpd/conf.d/welcome.conf
- /etc/httpd/conf.d/userdir.conf
- name: modify config to not navigate on os from browser (You don't have permission to access / on this server.)
lineinfile:
path: /etc/httpd/conf/httpd.conf
regexp: 'Options Indexes FollowSymLinks'
line: '#Options Indexes FollowSymLinks'
notify: restart httpd