# Gather\_Fact Issue while Configure New VM

**URL:** <https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695>\
**Category:** Ansible Project\
**Created:** [June 3, 2018, 4:05pm UTC](https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695 "2018-06-03T16:05:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Saurabh](https://forum.ansible.com/u/Saurabh)\
**Post date:** [June 3, 2018, 4:05pm UTC](https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695/1 "2018-06-03T16:05:07Z")

</div>

Hi Team,

I want to configure new VM and ssh login setup 1st time through Ansible Playbook below is code.

---

<div class="post-metadata">

**Author:** ![Saurabh](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Saurabh](https://forum.ansible.com/u/Saurabh)\
**Post date:** [June 4, 2018, 6:28am UTC](https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695/2 "2018-06-04T06:28:43Z")

</div>

Any Help on This issue ?

---

<div class="post-metadata">

**Author:** ![Ronald\_Lawhorn](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@Ronald\_Lawhorn](https://forum.ansible.com/u/Ronald_Lawhorn)\
**Post date:** [June 4, 2018, 9:35am UTC](https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695/3 "2018-06-04T09:35:03Z")

</div>

Set the ssh key, disconnect and then reconnect using it. Conversely you can put the service account and key in the template your using and avoid setting it on first boot.

---

<div class="post-metadata">

**Author:** ![Saurabh](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Saurabh](https://forum.ansible.com/u/Saurabh)\
**Post date:** [June 4, 2018, 10:51am UTC](https://forum.ansible.com/t/gather-fact-issue-while-configure-new-vm/27695/4 "2018-06-04T10:51:10Z")

</div>

Can you please Show me one Example ?

Thank you
