- name: Ensure SSL directory exists file: path: /etc/nginx/ssl state: directory mode: '0700' tags: ssl - name: Generate private key openssl_privatekey: path: /etc/nginx/ssl/{{ proxy_name }}.key size: 2048 type: RSA mode: '0600' owner: root group: root tags: ssl - name: Generate self-signed SSL certificate openssl_certificate: path: /etc/nginx/ssl/{{ proxy_name }}.crt privatekey_path: /etc/nginx/ssl/{{ proxy_name }}.key owner: root group: root mode: '0600' provider: selfsigned tags: ssl