From 4c9a4d480e8cfbdca928a81da4257285d868ef75 Mon Sep 17 00:00:00 2001 From: Alex Tavarez Date: Wed, 27 May 2026 13:12:57 -0400 Subject: [PATCH] added task checking for administrative login use --- roles/init-server/tasks/install-pkgs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/init-server/tasks/install-pkgs.yml b/roles/init-server/tasks/install-pkgs.yml index f973d7f..820a40e 100644 --- a/roles/init-server/tasks/install-pkgs.yml +++ b/roles/init-server/tasks/install-pkgs.yml @@ -1,6 +1,10 @@ #SPDX-License-Identifier: MIT-0 --- # tasks file for roles/init-vps +- name: Checking whether administrative login used + when: ansible_facts["user_id"] not in (admins | map(attribute="username") | list) + ansible.builtin.fail: + msg: Must use administrative user for subsequent tasks - name: Creating prerequisite directory tree ansible.builtin.file: path: "{{ ansible_facts['user_dir'] }}/.local/bin"