The production web server that hosts Ubuntu repositories will be secured
with HTTP Basic auth. Simulate this on the puddle web server as well.
/etc/nginx/htpasswd is managed outside of Ansible.
notify:
- restart nginx
+# Note: this file must be installed on the host independent of ansible.
+- name: set permissions on htaccess
+ file:
+ path: '/etc/nginx/htpasswd'
+ owner: root
+ group: nginx
+ mode: 0640
+ notify:
+ - restart nginx
+
- name: start the nginx service
service:
name: nginx
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
+ auth_basic "Restricted";
+ auth_basic_user_file /etc/nginx/htpasswd;
}
}