--- - 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: /etc/httpd/conf.d/welcome.conf state: absent - 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