Hi again Tekchand,

On Wed, Jan 2, 2019 at 9:52 PM Tekchand Dagar <[email protected]>
wrote:

> Hello Vincent,
>
> Thank you for your prompt response.
>
> Please refer the attach file of ansible-playbook which us used for clone
> from git. I am switching the user from root to deploy so when it switch the
> user deploy then it will go into deploy user home directory.
>

There is no guarantee about the directory switch being made when changing
users, this will depend on the internal implementation of the 'become'
command within Ansible. As you can see at
https://docs.ansible.com/ansible/latest/user_guide/become.html?highlight=become,
'become' has 'become_method' which can provide different means to do so
(su, sudo, etc).

For instance, with the 'su' command, it will depend on whether this is a
login shell ('su' does not switch directories, 'su -' or 'su -l' does
switch directories).


> And user deploy have full right to create a file in his/her home
> directory. I am correct?
>

You are right _if_ the directory is the 'deploy' user home dir.

I suggest adding a simple call to 'pwd' in your shell 'git clone' command
to check you are where you expect to be (another way would be to do a
'touch test_file ./' before running the 'git clone' command). Then past the
output here.

Note that I do not doubt you also have a connection issue (cf your
unability to connect via ssh), I just think there might be 2 issues, with
the 'permission denied' one masking the other (you have seen that your SSH
connection fails with a timeout for instance, not a permission problem).

HTH,

Vincent

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CADZPgZdsLXWGV7a_hPc1Ht8My0toApYGZ1GcO184WR5svOMR%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to