From 60d542103397d51923dc68cd9607ebe16b7c2dc5 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 19 Sep 2023 17:04:59 +0200 Subject: [PATCH] Remove secrets variable from role --- defaults/main.yml | 2 +- tasks/main.yml | 2 ++ tasks/preflight.yml | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tasks/preflight.yml diff --git a/defaults/main.yml b/defaults/main.yml index 5f5f4fc..cdfdb35 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,7 @@ --- userli_version: "3.2.1" userli_mysql_user: "userli" -userli_mysql_password: "{{ secrets_userli_mysql_password }}" +userli_mysql_password: "" userli_mysql_db: "userli" userli_mysql_priv: "{{ userli_mysql_db }}.*:ALL" userli_db_type: mysql diff --git a/tasks/main.yml b/tasks/main.yml index 211612a..93d2c7c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,6 @@ --- +- name: Preflight checks + ansible.builtin.include_tasks: preflight.yml - name: Ensure group is present group: diff --git a/tasks/preflight.yml b/tasks/preflight.yml new file mode 100644 index 0000000..7babe77 --- /dev/null +++ b/tasks/preflight.yml @@ -0,0 +1,7 @@ +--- +- name: Assert that required variables are set + ansible.builtin.assert: + that: + - userli_mysql_password is defined and userli_mysql_password != "" + fail_msg: "userli_mysql_password is not defined or empty" + success_msg: "userli_mysql_password is defined and not empty"