Blog_IMIE/ops/ansible/httpd-centos.yml
2018-11-18 17:06:48 +01:00

54 lines
978 B
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: Change file ownership, group and mode
file:
path: /var/www
owner: apache
group: apache
mode: 0750
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