Files
@ 2d97a06ce475
Branch filter:
Location: freifunk/Ansible-Configuration/api/api.freifunk.lu.yml - annotation
2d97a06ce475
977 B
text/x-yaml
fix: define ansible_managed to avoid error
ansible_managed is only available in templates. This is a workaround.
ansible_managed is only available in templates. This is a workaround.
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
|