From 4dc758b46d87abe73d0ba457c243ac4290f54157 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 | 3 +++ tasks/preflight.yml | 7 +++++++ 3 files changed, 11 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 f08f428..f7ff862 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,7 @@ --- +- name: Preflight checks + ansible.builtin.include_tasks: preflight.yml + - name: Ensure group is present ansible.builtin.group: name: "{{ userli_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"