Hello. Now there are many projects that are very similar: php, apache, redis, mysql and 2 daemons. This is set composer + from it Laravel.

Every time I use ssh, I have to spend ~ 1-2 hours to install and configure everything. What are the easiest ways to replicate servers in this case? It is clear that it is possible to write a sh-script, but this is unreliable: one module will fall off and everything else will fly.

Closed due to the fact that the question is too general for the participants aleksandr barakin , 0xdb , Kosta B. , Jarvis_J , Edward 16 Jul '18 at 8:26 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    ansible? [Seven Bores] - nobody
  • one
  • what can fall off if you spend the same 2 hours on script tests and then apply it ... As I understand it, you don’t admin? - Hellseher

2 answers 2

Good evening.

It all depends on your experience - this is the key to this issue.

The second is what types of services do you work with, what is the target OS? iron, VPS, AWS, Azure and td ...

Option 1

OS: GNU / Linux, Serv: hardware, vps

from scratch

  • organize a PXE boot rack or broadcast everything on the network deleted. We form preseed (Debian, Ubuntu), add to the end an archive with all configs that will be deployed after installation. Dopeil thin points (ssl, host name, virtual hosts)

already have access to the OS

if you need to cover 3 or more servers with different and similar settings, look towards automatic orchestrators

what I use myself (3-400 pieces of iron):

  • Ansible (Python / YAML)
  • AWX (Ansible GUI)
  • Rundeck

Also popular:

  • Puppet
  • Chef
  • Salt
  • Terraform

I have a complete waste of different types of preseeded ISO, scripts for Ansible and with the same result but in bash.

Just do not forget about the current container technologies today. Good luck in automation!

Links

    Docker - made a template, indicated there all the commands to install as in the sh script. You collect the image of the container and can be distributed. In this way, you skip all the stages of the deployment - only copy at once.

    You can also update this container from the image.

    Only the project and database folders are removed from the container for safekeeping.

    A separate service can be supplemented with some kind of software using image inheritance.