--- - name: Setup nginx auth scaffolding dirs hosts: [ 'debian10' ] tasks: - shell: |- cd /etc/nginx mkdir -p auth.d passwords.d - copy: dest: '/etc/nginx/auth.d/grant-access-certbot.conf' content: |- set $auth_basic Restricted; if ($request_uri ~* "well-known") { set $auth_basic off; } auth_basic $auth_basic;