Blog_IMIE/ops/ansible/httpd-centos.yml
2018-11-18 16:15:03 +01:00

61 lines
1.1 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: Permissions /etc/httpd
file:
path: /etc/httpd
owner: apache
group: apache
recurse: yes
- name: Change file ownership, group and mode
file:
path: /var/www
owner: apache
group: apache
mode: "u=r,g=r,o=r"
recurse: yes
- name: Install python-passlib
yum:
name: python-passlib
state: latest
- htpasswd:
path: /etc/httpd/passwords
name: hifive
password: hifive
owner: apache
group: apache
mode: 0640
- name: Create httpd.conf
template:
src: httpd.j2
dest: /etc/httpd/conf/httpd.conf
force: yes
- name: Systemd start httpd
systemd:
name: httpd
state: started