<p>What you are trying to accomplish is referred to as <em><a href="https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as-code" rel="noreferrer">infrastructure as code</a></em>.</p>
<p>Which tools you select will depend on where you are operating, and what your business needs are.  If you are operating in AWS exclusively, you can skip 3rd party solutions and focus on their <a href="https://aws.amazon.com/cloudformation/" rel="noreferrer">CloudFormation</a> service.  Terraform (infrastructure) and Ansible (configuration) are popular cloud agnostic tools if you are operating On-Prem or across multiple cloud providers.</p>

CC BY-SA 4.0
2021-04-24T13:36:29.177Z
This is the way. We use Jenkins as the orchestrator calling on terraform to create initial vanilla hosts on AWS/GC/OnPrem (vCenter. The terraform outputs are YML structured and used as direct input into Ansible for specific configuration and application deployment. It takes a while to achieve >90% full automation but the payback is huge.
wowbagger
CC BY-SA 4.0
2021-04-22T16:40:45.167Z
2021-04-22T16:40:45.167Z
Wesley Rolnick
<p>I’m trying to add new nodes (Linux servers) to my cluster but I have to first configure my nodes properly, i.e. setting up the firewall, closing ports, disabling password login, setting up git,  etc…
This is all very time consuming and can go wrong easily due to human mistakes. How do I automate this process ideally? What tools are used for this? I read about Terraform, Ansible,  but I feel kinda lost with all those different technologies. My desired result would be whenever I buy a new VPS, I run a script (or connect it to a master node) and then configuration happens based on a template or so</p>
<p>Thanks in advance</p>

<configuration><infrastructure-as-code>
How to automate initial server configuration?
Martin Nowosad
# How to automate initial server configuration?

(Asked by: username_0 on 2021-04-21)

I’m trying to add new nodes (Linux servers) to my cluster but I have to first configure my nodes properly, i.e. setting up the firewall, closing ports, disabling password login, setting up git, etc…
This is all very time consuming and can go wrong easily due to human mistakes. How do I automate this process ideally? What tools are used for this? I read about Terraform, Ansible, but I feel kinda lost with all those different technologies. My desired result would be whenever I buy a new VPS, I run a script (or connect it to a master node) and then configuration happens based on a template or so

Thanks in advance

**Tags:** configuration, infrastructure-as-code


---

## 1 answers

### Answer by username_1 on 2021-04-22. Score: 6

What you are trying to accomplish is referred to as *[infrastructure as code](https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as-code)*.

Which tools you select will depend on where you are operating, and what your business needs are. If you are operating in AWS exclusively, you can skip 3rd party solutions and focus on their [CloudFormation](https://aws.amazon.com/cloudformation/) service. Terraform (infrastructure) and Ansible (configuration) are popular cloud agnostic tools if you are operating On-Prem or across multiple cloud providers.

> **Comments:**
> **username_2**: This is the way. We use Jenkins as the orchestrator calling on terraform to create initial vanilla hosts on AWS/GC/OnPrem (vCenter. The terraform outputs are YML structured and used as direct input into Ansible for specific configuration and application deployment. It takes a while to achieve >90% full automation but the payback is huge.  

---

