Add playbooks/apache.yml
This commit is contained in:
56
playbooks/apache.yml
Normal file
56
playbooks/apache.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
- name: install required software
|
||||
hosts: apache-intranet
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: install apache
|
||||
apt:
|
||||
name:
|
||||
- apache2
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: create intranet directory
|
||||
file:
|
||||
path: /var/www/intranet
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: create files directory
|
||||
file:
|
||||
path: /var/www/files
|
||||
state: directory
|
||||
owner: jigglypuff
|
||||
group: jigglypuff
|
||||
mode: 0755
|
||||
|
||||
- name: install apache config
|
||||
template:
|
||||
src: ../configs/apache.j2
|
||||
dest: /etc/apache2/sites-available/000-default.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: copy the index file
|
||||
copy:
|
||||
src: ../configs/index.html
|
||||
dest: /var/www/intranet
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: copy the favourite icon
|
||||
copy:
|
||||
src: ../configs/favicon.ico
|
||||
dest: /var/www/intranet
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: restart apache
|
||||
ansible.builtin.systemd:
|
||||
name: apache2
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user