Files
Ansible/PB-Apache.yml
T
2026-09-08 19:55:06 +02:00

41 lines
989 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- name: "Install & start Apache"
hosts: debian
# Les lignes de commentaires commencent par un croisillon
tasks:
- name: "Apache installation"
become: yes
apt:
name: "apache2"
state: "present"
update_cache: true
- name: "start Apache"
become: yes
service:
name: apache2
state: started
# Activation au boot :
enabled: yes
# Sauvegarde du fichier distant
# - name: "Save default file"
# become: yes
# copy:
# remote_src: true
# src: "/var/www/html/index.html"
# dest: "/var/www/html/index.html.old"
# owner: "www-data"
# group: "www-data"
# index.html est une page web que lon aura créé dans ~ansible
- name: "Copy Homepage"
become: yes
copy:
src: "/home/ansible/index.html"
dest: "/var/www/html/"
# backup évite la précédente task
backup: true
owner: "www-data"
group: "www-data"