branch solution
This commit is contained in:
42
apache.yml
42
apache.yml
@@ -1,42 +0,0 @@
|
|||||||
---
|
|
||||||
- name: install apache via ansible playbook
|
|
||||||
hosts: centos
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: install apache
|
|
||||||
yum:
|
|
||||||
name: httpd
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: conf httpd
|
|
||||||
template:
|
|
||||||
src: vhost.conf
|
|
||||||
dest: /etc/httpd/conf.d/vhost.conf
|
|
||||||
mode: 0640
|
|
||||||
owner: root
|
|
||||||
group: apache
|
|
||||||
|
|
||||||
- name: activate apache
|
|
||||||
service:
|
|
||||||
name: httpd
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
|
|
||||||
- name: open firewall port
|
|
||||||
firewalld:
|
|
||||||
service: http
|
|
||||||
permanent: yes
|
|
||||||
immediate: yes
|
|
||||||
state: enabled
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: create documentroot
|
|
||||||
file:
|
|
||||||
name: /var/www/html/example.org/
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: copy index file
|
|
||||||
template:
|
|
||||||
src: index.txt
|
|
||||||
dest: /var/www/html/example.org/index.html
|
|
||||||
mode: 0644
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
---
|
|
||||||
- name: install apache via ansible playbook
|
|
||||||
CHANGEME: centos
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: get ressources
|
|
||||||
CHANGEME:
|
|
||||||
url: "{{ item }}"
|
|
||||||
dest: /tmp
|
|
||||||
loop:
|
|
||||||
- https://cours.opendoor.fr/Fichiers/SIB/index.txt
|
|
||||||
- https://cours.opendoor.fr/Fichiers/SIB/vhost.conf
|
|
||||||
CHANGEME: localhost
|
|
||||||
become: false
|
|
||||||
|
|
||||||
CHANGEME_tasks:
|
|
||||||
- name: cleanup
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: absent
|
|
||||||
CHANGEME:
|
|
||||||
- /tmp/index.txt
|
|
||||||
- /tmp/vhost.conf
|
|
||||||
CHANGEME: false
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: install apache
|
|
||||||
CHANGEME:
|
|
||||||
name: httpd
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: conf httpd
|
|
||||||
CHANGEME:
|
|
||||||
CHANGEME: /tmp/vhost.conf
|
|
||||||
CHANGEME: /etc/httpd/conf.d/vhost.conf
|
|
||||||
mode: 0640
|
|
||||||
owner: root
|
|
||||||
group: apache
|
|
||||||
|
|
||||||
- name: activate apache
|
|
||||||
CHANGEME:
|
|
||||||
name: httpd
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
|
|
||||||
- name: open firewall port
|
|
||||||
firewalld:
|
|
||||||
CHANGEME: http
|
|
||||||
permanent: yes
|
|
||||||
immediate: yes
|
|
||||||
state: enabled
|
|
||||||
|
|
||||||
- name: create documentroot
|
|
||||||
CHANGEME:
|
|
||||||
name: /var/www/html/orsys.fr
|
|
||||||
state: CHANGEME
|
|
||||||
|
|
||||||
- name: copy index file
|
|
||||||
CHANGEME:
|
|
||||||
src: /tmp/index.txt
|
|
||||||
CHANGEMEdest: /var/www/html/orsys.fr/index.html
|
|
||||||
mode: 0644
|
|
||||||
Reference in New Issue
Block a user