ansible-schulung/roles/nginx/tasks/main.yml
2024-12-18 08:49:20 +01:00

43 lines
786 B
YAML

---
- tags: nginx
block:
- name: Package
apt:
state: present
name:
- nginx-light
- curl
- wget
update_cache: true
- name: Service
systemd:
state: started
name: nginx
enabled: true
- name: Config
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: '0644'
notify:
- Restart
- Waitfor
loop_control:
label: "{{ item.src }}"
loop:
- src: nginx.conf
dest: /etc/nginx/nginx.conf
- src: default
dest: /etc/nginx/sites-enabled/default
- name: Defaultpage
copy:
src: index.htm
dest: /var/www/html/index.nginx-debian.html
owner: root
group: root
mode: '0644'