Skip to content

Commit a76a5e5

Browse files
committed
update
1 parent 9f4b51f commit a76a5e5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

roles/nam/roles/azure-nam-guru.bash

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ function main()
1515
"${appFolderPath}/../../../cookbooks/nginx/recipes/install-from-source.bash"
1616
"${appFolderPath}/../../../cookbooks/node-js/recipes/install.bash"
1717

18-
addUserToSudoWithoutPassword "${firstLoginUser}"
19-
autoSudo "${firstLoginUser}" '.bashrc'
20-
2118
setupRepository
2219
updateRepositoryOnLogin "$(whoami)"
2320

24-
addUserAuthorizedKey "${firstLoginUser}" "${firstLoginUser}" "$(cat "${appFolderPath}/../files/authorized_keys")"
21+
if [[ "$(existUserLogin "${firstLoginUser}")" = 'true' ]]
22+
then
23+
addUserToSudoWithoutPassword "${firstLoginUser}"
24+
autoSudo "${firstLoginUser}" '.bashrc'
25+
addUserAuthorizedKey "${firstLoginUser}" "${firstLoginUser}" "$(cat "${appFolderPath}/../files/authorized_keys")"
26+
fi
2527

2628
cleanUpSystemFolders
2729
resetLogs

roles/nam/roles/vmware-desktop.bash

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ function main()
1717
"${appFolderPath}/../../../cookbooks/vim/recipes/install.bash"
1818
"${appFolderPath}/../../../cookbooks/vmware-tools/recipes/install.bash"
1919

20-
addUserToSudoWithoutPassword "${firstLoginUser}"
21-
autoSudo "${firstLoginUser}" '.bashrc'
22-
2320
setupRepository
2421
updateRepositoryOnLogin "$(whoami)"
2522

26-
addUserAuthorizedKey "${firstLoginUser}" "${firstLoginUser}" "$(cat "${appFolderPath}/../files/authorized_keys")"
23+
if [[ "$(existUserLogin "${firstLoginUser}")" = 'true' ]]
24+
then
25+
addUserToSudoWithoutPassword "${firstLoginUser}"
26+
autoSudo "${firstLoginUser}" '.bashrc'
27+
addUserAuthorizedKey "${firstLoginUser}" "${firstLoginUser}" "$(cat "${appFolderPath}/../files/authorized_keys")"
28+
fi
2729

2830
cleanUpSystemFolders
2931
resetLogs

0 commit comments

Comments
 (0)