diff --git a/apache.yml b/apache.yml index c398c1a..7d8b597 100644 --- a/apache.yml +++ b/apache.yml @@ -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 \ No newline at end of file diff --git a/index.txt b/index.txt new file mode 100644 index 0000000..416474e --- /dev/null +++ b/index.txt @@ -0,0 +1 @@ +