Skip to content

Commit 61302c5

Browse files
committed
prevent ssh hanging after NFS server reimaged in CI
1 parent 048e96c commit 61302c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ansible/bootstrap.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
- hosts: cluster
4141
gather_facts: false
4242
tasks:
43-
- name: Add groups
43+
- name: Prevent ssh hanging if shared home is unavailable
44+
lineinfile:
45+
path: /etc/profile
46+
search_string: HOSTNAME=$(/usr/bin/hostnamectl --transient 2>/dev/null) || \
47+
state: absent
48+
- name: Add system user groups
4449
ansible.builtin.group: "{{ item.group }}"
4550
loop: "{{ appliances_local_users }}"
4651
when:
@@ -50,7 +55,7 @@
5055
# Need to change working directory otherwise we try to switch back to non-existent directory.
5156
become_flags: '-i'
5257
become: true
53-
- name: Add users
58+
- name: Add system users
5459
ansible.builtin.user: "{{ item.user }}"
5560
loop: "{{ appliances_local_users }}"
5661
when: item.enable | default(true) | bool

0 commit comments

Comments
 (0)