Files @ e007d7c95bcf
Branch filter:

Location: freifunk/Ansible-Configuration/api/api.freifunk.lu.yml

x
fix: dhparam, not dhparam.pem
---
- 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