initial commit

This commit is contained in:
Patrick Neff 2022-01-24 19:04:09 +01:00
commit 676eb4c7c5
3 changed files with 37 additions and 0 deletions

9
handlers/main.yml Normal file
View File

@ -0,0 +1,9 @@
- name: reload nginx
ansible.builtin.service:
name: nginx
state: reloaded
- name: restart nginx
ansible.builtin.service:
name: nginx
state: restarted

4
meta/main.yml Normal file
View File

@ -0,0 +1,4 @@
galaxy_info:
role_name: nginx
dependencies: []

24
tasks/main.yml Normal file
View File

@ -0,0 +1,24 @@
- name: Install packages.
tags: nginx
ansible.builtin.package:
state: present
name:
- nginx
register: nginx_installed
- name: Remove default nginx directory.
tags: nginx
ansible.builtin.file:
path: /etc/nginx
state: absent
register: nginx_config_cleared
when: nginx_installed.changed == true
- name: Clone h5bp nginx config.
tags: nginx
ansible.builtin.git:
repo: https://github.com/h5bp/server-configs-nginx
dest: /etc/nginx
depth: 1
notify: restart nginx
when: nginx_config_cleared.changed == true