--- - name: "Install & start Apache" hosts: all # Les lignes de commentaires commencent par un croisillon tasks: - name: "Apache installation" become: yes apt: name: "httpd" state: "present" update_cache: true - name: "start Apache" become: yes service: name: httpd 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" - name: "Copy Homepage" become: yes copy: src: "index.html" dest: "/var/www/html/" # backup évite la précédente task backup: true owner: "www-data" group: "www-data"