Blog_IMIE/ops/ansible/httpd-centos.yml
2018-11-01 14:37:02 +01:00

78 lines
1.5 KiB
YAML

---
- hosts: hifive
become: yes
become_user: root
tasks:
- name: Yum update
yum:
name: '*'
state: latest
- name: Install httpd
yum:
name: httpd
state: latest
- name: Systemd enable httpd
systemd:
name: httpd
enabled: yes
masked: no
- name: Systemd start httpd
systemd:
name: httpd
state: started
#- name: Permissions apache2
#file:
#path: /etc/apache2
#owner: www-data
#group: www-data
#recurse: yes
#
#- name: Permissions www
#file:
#path: /var/www
#owner: www-data
#group: www-data
#recurse: yes
#
#- name: Start service httpd, if not started
#service:
#name: apache2
#state: started
#
#- name: Enable service apache2, and not touch the state
#service:
#name: apache2
#enabled: yes
#
#- name: Enable mod_rewrite
#apache2_module:
#name: rewrite
#state: present
#
#- htpasswd:
#path: /etc/apache2/.htpasswd
#name: hifive
#password: hifive
#owner: root
#group: www-data
#mode: 0640
#
#- name: Create virtual host file
#template:
#src: virtualhost.j2
#dest: /etc/apache2/sites-available/{{ domain }}.conf
#force: yes
#
#- name: a2ensite {{ domain }}
#command: a2ensite {{ domain }}
#
#- name: Reload service apache2
#service:
#name: apache2
#state: reloaded