--- - name: Converge hosts: all remote_user: ansible become: yes vars: nginx_use_ppa: true nginx_remove_default_vhost: true nginx_vhosts: - server_names: - "localhost" upstream: name: local server: localhost:8000 template: django-vhost.j2 extra_snippets: - location: "~* /static/(.*\\.)(js|css)" expiries: 365d alias: "/var/www/static/$1$2" template: cache-snippet.j2 enable_https: true filename: localhost-django.conf static_root: /var/www/static/ media_root: /var/www/media/ certificate: /etc/nginx/ssl/fullchain.pem # selfsigned private_key: /etc/nginx/ssl/privkey.pem # selfsigned pre_tasks: - debug: var: ansible_python roles: - role: nginx