Initial commit
This commit is contained in:
18
tasks/aktivera-apache-v3.yml
Normal file
18
tasks/aktivera-apache-v3.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: Aktivera Apache i Debian
|
||||
tags:
|
||||
- apache
|
||||
- systemd
|
||||
systemd:
|
||||
name: apache2
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Aktivera Apache i RedHat
|
||||
tags:
|
||||
- apache
|
||||
- systemd
|
||||
systemd:
|
||||
name: httpd
|
||||
enabled: yes
|
||||
state: started
|
||||
|
20
tasks/aktivera-apache.yml
Normal file
20
tasks/aktivera-apache.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
- name: Aktivera Apache i Debian
|
||||
tags:
|
||||
- apache
|
||||
- systemd
|
||||
when: ansible_os_family == 'Debian'
|
||||
systemd:
|
||||
name: apache2
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Aktivera Apache i RedHat
|
||||
tags:
|
||||
- apache
|
||||
- systemd
|
||||
when: ansible_os_family == 'RedHat'
|
||||
systemd:
|
||||
name: httpd
|
||||
enabled: yes
|
||||
state: started
|
||||
|
10
tasks/firewalld-http.yml
Normal file
10
tasks/firewalld-http.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: Öppna brandväggen i RedHat
|
||||
tags:
|
||||
- firewall
|
||||
when: ansible_os_family == 'RedHat'
|
||||
firewalld:
|
||||
service: http
|
||||
permanent: yes
|
||||
immediate: yes
|
||||
state: enabled
|
||||
|
9
tasks/firewalld-httpd-v3.yml
Normal file
9
tasks/firewalld-httpd-v3.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
- name: Öppna brandväggen i RedHat
|
||||
tags:
|
||||
- firewall
|
||||
firewalld:
|
||||
service: http
|
||||
permanent: yes
|
||||
immediate: yes
|
||||
state: enabled
|
||||
|
34
tasks/installera-apache-php-v3.yml
Normal file
34
tasks/installera-apache-php-v3.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
- name: Installera Apache och PHP i Debian
|
||||
tags:
|
||||
- apache
|
||||
- package
|
||||
when: ansible_os_family == 'Debian'
|
||||
apt:
|
||||
update_cache: yes
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
install_recommends: yes
|
||||
with_items:
|
||||
- apache2
|
||||
- libapache2-mod-php
|
||||
notify:
|
||||
- Ta bort eventuell exempelsida
|
||||
- Aktivera Apache i Debian
|
||||
|
||||
- name: Installera Apache och PHP i RedHat
|
||||
tags:
|
||||
- apache
|
||||
- package
|
||||
when: ansible_os_family == 'RedHat'
|
||||
dnf:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
install_weak_deps: yes
|
||||
with_items:
|
||||
- httpd
|
||||
- php
|
||||
notify:
|
||||
- Ta bort eventuell exempelsida
|
||||
- Aktivera Apache i RedHat
|
||||
- Öppna brandväggen i RedHat
|
28
tasks/installera-apache-php.yml
Normal file
28
tasks/installera-apache-php.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: Installera Apache och PHP i Debian
|
||||
tags:
|
||||
- apache
|
||||
- package
|
||||
when: ansible_os_family == 'Debian'
|
||||
apt:
|
||||
update_cache: yes
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
install_recommends: yes
|
||||
with_items:
|
||||
- apache2
|
||||
- libapache2-mod-php
|
||||
|
||||
- name: Installera Apache och PHP i RedHat
|
||||
tags:
|
||||
- apache
|
||||
- package
|
||||
when: ansible_os_family == 'RedHat'
|
||||
dnf:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
install_weak_deps: yes
|
||||
with_items:
|
||||
- httpd
|
||||
- php
|
||||
|
8
tasks/radera-exempelsida-v3.yml
Normal file
8
tasks/radera-exempelsida-v3.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- name: Ta bort eventuell exempelsida
|
||||
tags:
|
||||
- index
|
||||
- remove
|
||||
file:
|
||||
path: /var/www/html/index.html
|
||||
state: absent
|
||||
|
8
tasks/skapa-webbsida-v3.yml
Normal file
8
tasks/skapa-webbsida-v3.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- name: Kopiera PHP-filen till värdarna
|
||||
tags:
|
||||
- index
|
||||
- copy
|
||||
copy:
|
||||
src: ../files/index.php
|
||||
dest: /var/www/html/index.php
|
||||
|
16
tasks/skapa-webbsida.yml
Normal file
16
tasks/skapa-webbsida.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
- name: Ta bort eventuell exempelsida
|
||||
tags:
|
||||
- index
|
||||
- remove
|
||||
file:
|
||||
path: /var/www/html/index.html
|
||||
state: absent
|
||||
|
||||
- name: Kopiera PHP-filen till värdarna
|
||||
tags:
|
||||
- index
|
||||
- copy
|
||||
copy:
|
||||
src: ../files/index.php
|
||||
dest: /var/www/html/index.php
|
||||
|
8
tasks/testa-webbservrarna.yml
Normal file
8
tasks/testa-webbservrarna.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- name: Anslut till webbservrarna
|
||||
tags:
|
||||
- connect
|
||||
uri:
|
||||
url: "http://{{ item }}"
|
||||
with_items: "{{ groups[min_grupp] | map('extract', \
|
||||
hostvars, ['ansible_host']) }}"
|
||||
|
Reference in New Issue
Block a user