Skip to content

Commit 4812f85

Browse files
committed
fix home directory for rocky during image cleanup
1 parent 67e1972 commit 4812f85

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ansible/cleanup.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@
2323
path: /etc/NetworkManager/conf.d/99-cloud-init.conf
2424
state: absent
2525

26+
- name: Get remote environment for ansible_user
27+
setup:
28+
gather_subset: env
29+
become: no
30+
2631
- name: Delete any injected ssh config for ansible_user
2732
file:
28-
path: "/home/{{ ansible_user }}/.ssh/"
33+
path: "{{ ansible_env.HOME }}/.ssh/"
2934
state: absent
3035

3136
- name: Run cloud-init cleanup

0 commit comments

Comments
 (0)