fix(ansible): hushlogin for root or user

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2023-07-12 18:47:13 -04:00
1 parent 700c248487
commit c92f732828
1 file changed
+3 -2
@@ -19,7 +19,7 @@
block: block:
- name: Packages | Install - name: Packages | Install
ansible.builtin.apt: ansible.builtin.apt:
name: apt-transport-https,ca-certificates,conntrack,curl,dirmngr,gdisk,gnupg,htop, name: apt-transport-https,ca-certificates,conntrack,curl,dirmngr,gdisk,gnupg,hdparm,htop,
iptables,iputils-ping,ipvsadm,libseccomp2,lm-sensors,neofetch,net-tools,nfs-common, iptables,iputils-ping,ipvsadm,libseccomp2,lm-sensors,neofetch,net-tools,nfs-common,
nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml, nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml,
smartmontools,socat,software-properties-common,unzip,util-linux smartmontools,socat,software-properties-common,unzip,util-linux
@@ -33,9 +33,10 @@
key: "https://github.com/{% raw %}{{ github_username }}{% endraw %}.keys" key: "https://github.com/{% raw %}{{ github_username }}{% endraw %}.keys"
- name: User Configuration | Silence login - name: User Configuration | Silence login
ansible.builtin.file: ansible.builtin.file:
dest: /root/.hushlogin dest: "{% raw %}{{ '/home/' + ansible_user if ansible_user != 'root' else '/root' }}{% endraw %}/.hushlogin"
state: touch state: touch
owner: "{% raw %}{{ ansible_user }}{% endraw %}" owner: "{% raw %}{{ ansible_user }}{% endraw %}"
group: "{% raw %}{{ ansible_user }}{% endraw %}"
mode: "0644" mode: "0644"
modification_time: preserve modification_time: preserve
access_time: preserve access_time: preserve