diff --git a/roles/client-ssh/tasks/main.yml b/roles/client-ssh/tasks/main.yml index 52ad1a04..abcd6a63 100644 --- a/roles/client-ssh/tasks/main.yml +++ b/roles/client-ssh/tasks/main.yml @@ -37,9 +37,10 @@ - name: Ensure ~/.profile exists with common environment lineinfile: - path: "{{ ansible_env.HOME }}/.profile" + path: "$HOME/.profile" line: 'export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"' insertafter: EOF state: present create: yes - mode: "0644" \ No newline at end of file + mode: "0644" + become: false \ No newline at end of file diff --git a/roles/shell/tasks/main.yml b/roles/shell/tasks/main.yml index 18b15514..f0904732 100644 --- a/roles/shell/tasks/main.yml +++ b/roles/shell/tasks/main.yml @@ -1,20 +1,20 @@ --- -# roles/shell/tasks/main.yml - - name: Ensure ~/.bash_profile sources ~/.profile lineinfile: - path: "{{ ansible_env.HOME }}/.bash_profile" + path: "$HOME/.bash_profile" line: '[ -f ~/.profile ] && . ~/.profile' insertafter: EOF state: present create: yes mode: "0644" + become: false - name: Ensure ~/.zprofile sources ~/.profile lineinfile: - path: "{{ ansible_env.HOME }}/.zprofile" + path: "$HOME/.zprofile" line: '[ -f ~/.profile ] && . ~/.profile' insertafter: EOF state: present create: yes mode: "0644" + become: false