From b232b894c3cbe087c8d504e91637dcf62199eed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 29 Jul 2021 17:00:20 +0200 Subject: Bump to third revision of homelab --- roles/htpasswd/defaults/main.yml | 4 ++++ roles/htpasswd/tasks/main.yml | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 roles/htpasswd/defaults/main.yml create mode 100644 roles/htpasswd/tasks/main.yml (limited to 'roles/htpasswd') diff --git a/roles/htpasswd/defaults/main.yml b/roles/htpasswd/defaults/main.yml new file mode 100644 index 0000000..458b9c1 --- /dev/null +++ b/roles/htpasswd/defaults/main.yml @@ -0,0 +1,4 @@ +htpasswd_user: "www" +htpasswd_password: "" +htpasswd_dir: "/htpasswd" +htpasswd_service: "" diff --git a/roles/htpasswd/tasks/main.yml b/roles/htpasswd/tasks/main.yml new file mode 100644 index 0000000..9586c82 --- /dev/null +++ b/roles/htpasswd/tasks/main.yml @@ -0,0 +1,11 @@ +- name: ensure htpasswd service is specified + fail: + when: + +- name: set variable for realm generation + set_facts: + htpasswd_credentials_: "{{ htpasswd_user }}:{{ htpasswd_password }}" + htpasswd_file_: "{{ htpasswd_dir }}/{{ htpasswd_service }}" + +- name: generate realm file + shell: echo "{{ htpasswd_credentials_ }}" | htpasswd -I "{{ htpasswd_file_ }}" -- cgit v1.2.3