Reconnect after the user is added

70 views
Skip to first unread message

anatoly techtonik

unread,
Dec 30, 2014, 8:25:47 AM12/30/14
to ansible...@googlegroups.com
Hi.

Is there a way to make Ansible reconnect to continue? I am adding user and I need to execute the rest of the operations under this user - making checkout of the project with his forwarded SSH key.

Paul Tötterman

unread,
Dec 30, 2014, 10:51:16 AM12/30/14
to ansible...@googlegroups.com
Hi Anatoly,
 
Is there a way to make Ansible reconnect to continue? I am adding user and I need to execute the rest of the operations under this user - making checkout of the project with his forwarded SSH key.

Remember that one playbook in ansible can contain several plays. Create the user in the first play and run the second play as the freshly created user.

Cheers,
Paul

anatoly techtonik

unread,
Jan 3, 2015, 5:52:46 AM1/3/15
to ansible...@googlegroups.com
Hi Paul,
Thanks for the hint. Does that mean that Ansible reconnect to remote
machine after each play? (Can't test it right now)

Paul Tötterman

unread,
Jan 3, 2015, 9:34:22 AM1/3/15
to ansible...@googlegroups.com
Thanks for the hint. Does that mean that Ansible reconnect to remote
machine after each play? (Can't test it right now)

If you increase the verbosity using -v you'll see that ansible connects for each task. But it's probably easier to group tasks to be executed with a certain user as a play.

Cheers,
Paul 
Reply all
Reply to author
Forward
0 new messages