Files
@ eff5e9720cff
Branch filter:
Location: freifunk/Ansible-Configuration/api/api.freifunk.lu.yml - annotation
eff5e9720cff
977 B
text/x-yaml
fix: become when root perms are necessary
5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 5a1431fa7615 | ---
- hosts: test
become: yes
vars:
server_name: 'api.freifunk.lu '
document_root: /var/www/api.freifunk.lu
tasks:
- name: Update apt cache and install Nginx
apt:
name: nginx
state: latest
update_cache: yes
# Create directory api.freifunk.lu
- name: Create the directory api.freifunk.lu in /var/www if it does not exist
ansible.builtin.file:
path: /var/www/api.freifunk.lu
state: directory
mode: '0755'
- name: Apply Nginx template
template:
src: /etc/ansible/playbooks/files/api.conf.j2
dest: /etc/nginx/sites-available/api.freifunk.lu
notify: Restart Nginx
- name: Enable new site
file:
src: /etc/nginx/sites-available/api.freifunk.lu
dest: /etc/nginx/sites-enabled/api.freifunk.lu
state: link
notify: Restart Nginx
handlers:
- name: Restart Nginx
service:
name: nginx
state: restarted
|