Files
sib_10_premier_playbook/apache.yml
2023-12-22 14:19:24 +01:00

34 lines
713 B
YAML

---
- name: install apache via ansible playbook
hosts: cibles
tasks:
- name: install apache
ansible.builtin.package:
name: httpd
state: present
- name: conf httpd
ansible.builtin.template:
src: vhost.conf
dest: /etc/httpd/conf.d/vhost.conf
mode: 0640
owner: root
group: apache
- name: activate apache
ansible.builtin.service:
name: httpd
enabled: yes
state: started
- name: create documentroot
ansible.builtin.file:
name: /var/www/html/example.org/
state: directory
- name: copy index file
ansible.builtin.template:
src: index.txt
dest: /var/www/html/example.org/index.html
mode: 0644