From 70114784a56f45521ca17e60bdfaa7b5207524c5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 16 Jul 2026 17:37:33 -0700 Subject: [PATCH] Move path changes to `.profile` so that display managers see it. --- tasks/general/acct_mgmt/users.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 198c9d0..73b79bd 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1113,6 +1113,8 @@ - name: General | Account Management | Users | Files | Common Variable set_fact: + rc_profile: | + {{ export_path_additions }} rc_common: | # Fixes "command not found" when using aliases within functions. shopt -s expand_aliases @@ -1129,7 +1131,6 @@ export server="{{ server }}" export domain="{{ domain }}" - {{ export_path_additions }} {{ source_shared }} {{ alias_cp }} {{ alias_mv }} @@ -1193,6 +1194,24 @@ {{ function_loop }} {{ process_notify_log }} +- name: General | Account Management | Users | Files | .profile + blockinfile: + path: "{{ item }}/.profile" + block: | + {{ rc_profile }} + + [[ $(whoami) != "root" ]] && + echo "`date` - Ansible .profile loaded successfully!" + marker: '# {mark} MANAGED BY ANSIBLE | Aliases' + state: present + create: yes + backup: no + loop: + - "{{ user_root.home }}" + - "{{ user_user.home }}" + ignore_errors: yes + when: user_root.home != "" and user_user.home != "" + - name: General | Account Management | Users | Files | .bashrc blockinfile: path: "{{ item }}/.bashrc"