Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
914 B

---
- include_role:
name: 'service'
vars:
service_name: 'nginx'
service_packages:
- 'nginx'
tags:
- 'packages'
- name: 'disable nginx default configuration'
file:
path: '/etc/nginx/sites-enabled/default'
state: 'absent'
notify: 'restart nginx'
- name: 'create nginx location configuration directory'
file:
path: '{{ item }}'
state: 'directory'
mode: '0755'
owner: 'www-data'
group: 'www-data'
loop:
- '/etc/nginx/locations/'
- '/etc/nginx/locations/{{ server_fqdn }}/'
- name: 'upload nginx configuration'
template:
src: 'base.j2'
dest: '/etc/nginx/sites-available/{{ server_fqdn }}.conf'
notify: 'restart nginx'
- name: 'enable nginx configurations'
file:
src: '/etc/nginx/sites-available/{{ server_fqdn }}.conf'
dest: '/etc/nginx/sites-enabled/{{ server_fqdn }}.conf'
state: 'link'
notify: 'restart nginx'
...