simplification et mise au point

This commit is contained in:
2020-10-09 10:28:55 +02:00
parent 7c639fb85d
commit 2a18887941
3 changed files with 30 additions and 26 deletions

View File

@@ -2,28 +2,6 @@
- name: install apache via ansible playbook
hosts: centos
pre_tasks:
- name: get ressources
get_url:
url: "{{ item }}"
dest: /tmp
loop:
- https://cours.opendoor.fr/Fichiers/SIB/index.txt
- https://cours.opendoor.fr/Fichiers/SIB/vhost.conf
delegate_to: localhost
become: false
post_tasks:
- name: cleanup
file:
path: "{{ item }}"
state: absent
loop:
- /tmp/index.txt
- /tmp/vhost.conf
become: false
delegate_to: localhost
tasks:
- name: install apache
yum:
@@ -32,7 +10,7 @@
- name: conf httpd
template:
src: /tmp/vhost.conf
src: vhost.conf
dest: /etc/httpd/conf.d/vhost.conf
mode: 0640
owner: root
@@ -50,14 +28,15 @@
permanent: yes
immediate: yes
state: enabled
ignore_errors: true
- name: create documentroot
file:
name: /var/www/html/{{ ansible_hostname }}
name: /var/www/html/example.org/
state: directory
- name: copy index file
template:
src: /tmp/index.txt
dest: /var/www/html/{{ ansible_hostname }}/index.html
src: index.txt
dest: /var/www/html/example.org/index.html
mode: 0644