X Tutup
Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 0d855dc

Browse files
committed
User: Also copies '.ansible_vault' file during home folder migration.
Fix
1 parent 047ec68 commit 0d855dc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

roles/user/tasks/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@
8888
- "{{ playbook_dir }}/*.txt"
8989
ignore_errors: yes
9090

91+
- name: "Look for '.ansible_vault' file in current home folder"
92+
stat:
93+
path: "{{ playbook_dir | dirname }}/.ansible_vault"
94+
register: ansible_vault
95+
96+
- name: "Copy '.ansible_vault' to new home folder."
97+
copy:
98+
src: "{{ playbook_dir | dirname }}/.ansible_vault"
99+
dest: "{{ new_home_path }}"
100+
owner: "{{ user }}"
101+
group: "{{ user }}"
102+
mode: 0664
103+
force: yes
104+
when: (ansible_vault.stat.exists)
105+
91106
- name: "Quit playbook after creation of new cloudbox folder location"
92107
fail:
93108
msg:

0 commit comments

Comments
 (0)
X Tutup