# setting up a new system with Ansible

**URL:** <https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459>\
**Category:** Ansible Project\
**Created:** [July 22, 2020, 1:22am UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459 "2020-07-22T01:22:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Wong](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Ed\_Wong](https://forum.ansible.com/u/Ed_Wong)\
**Post date:** [July 22, 2020, 1:22am UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/1 "2020-07-22T01:22:34Z")

</div>

Hi,

I’ve played with Ansible before but hadn’t really done much in terms of maintaining a whole infrastructure. I’m hoping to restart my foray into it in hopes to migrate off of the old way of standing up systems. I wish to migrate to using Ansible to manage the whole infrastructure. That said, I’m starting off simple. I’m not touching the existing systems. I have a basic control node and just set up a minimal CentOS 7 system.

Here is where i"m a tad bit confused in what I need to do and if someone can clarify things, I’d be appreciated.

Is the following process correct?

1. Log on to Alpha and create a new user, say automation.
2. create ssh keys for automation.
3. allow automation to have sudo access w/ no password.
4. copy ssh credentials to control node.

Is this the very first thing one does for every new system? (Granted, I won’t need to create new ssh-keys as I just need to copy the original ones to the new system).  
My understanding of this process is that in order to manage any system, I need a user that can have access to said system. Once I have that user set up properly,  
I won’t need to even log in manually to do things.

Thanks for the clarifications.

Ed

---

<div class="post-metadata">

**Author:** ![jcpetro](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jcpetro](https://forum.ansible.com/u/jcpetro)\
**Post date:** [July 22, 2020, 7:36pm UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/2 "2020-07-22T19:36:35Z")

</div>

That is pretty close to what I am doing. The only thing I want to do differently, is that I want to lock the automation account, so that it’s only accepted from a specific host. ( ie. the ansible control node)

–jp

---

<div class="post-metadata">

**Author:** ![Gildas\_Cotomale](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gildas\_Cotomale](https://forum.ansible.com/u/Gildas_Cotomale)\
**Post date:** [July 23, 2020, 6:52am UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/3 "2020-07-23T06:52:49Z")

</div>

Just tailor the authorized\_keys file to restrict to the control node IP and you’re done

---

<div class="post-metadata">

**Author:** ![Gildas\_Cotomale](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gildas\_Cotomale](https://forum.ansible.com/u/Gildas_Cotomale)\
**Post date:** [July 23, 2020, 6:58am UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/4 "2020-07-23T06:58:18Z")

</div>

> Here is where i"m a tad bit confused in what I need to do and if someone can clarify things, I’d be appreciated.
> 
> Is the following process correct?

Yes Ed, the steps you’ve listed are fine.

> 1. Log on to Alpha and create a new user, say automation.
> 2. create ssh keys for automation.
> 3. allow automation to have sudo access w/ no password.
> 4. copy ssh credentials to control node.
> 
> Is this the very first thing one does for every new system? (Granted, I won’t need to create new ssh-keys as I just need to copy the original ones to the new system).  
> My understanding of this process is that in order to manage any system, I need a user that can have access to said system. Once I have that user set up properly,  
> I won’t need to even log in manually to do things.

Correct.

---

<div class="post-metadata">

**Author:** ![jcpetro](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jcpetro](https://forum.ansible.com/u/jcpetro)\
**Post date:** [July 23, 2020, 4:17pm UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/5 "2020-07-23T16:17:33Z")

</div>

Oh, that’s a good idea, thanks for the suggestion. I hadn’t thought about that one

---

<div class="post-metadata">

**Author:** ![Ed\_Wong](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Ed\_Wong](https://forum.ansible.com/u/Ed_Wong)\
**Post date:** [July 24, 2020, 12:53am UTC](https://forum.ansible.com/t/setting-up-a-new-system-with-ansible/33459/6 "2020-07-24T00:53:23Z")

</div>

Hi Gildas,

Thanks for the info. Much appreciated.

Ed
