Answer the question
In order to leave comments, you need to log in
How to write environment configuration script for linux?
I would like to be able to make the initial configuration of the environment on a remote machine using a script.
You need to install and configure such software as apache, postgress, r-base, configure access, deploy a database, etc.
Are there any projects for writing such scripts, or can everything be done through shell scripts?
Answer the question
In order to leave comments, you need to log in
It is necessary to separate questions, deploying a database and installing and configuring packages, OS are different tasks (I think that they should not be mixed).
By installing and configuring packages, OS, here are a couple of options:
1. The most correct (IMHO) use ready-made solutions for similar tasks puppet, chef, salt and etc
2. Write a bash bike script that will be uploaded to the target host (any way, even ssh , at least git clone) and will be executed there, install packages, download packages, configuration files, settings, etc. from their source, template them, report on the result.
According to the database deployment, the solution here is very dependent on the initial data.
At a minimum, this task can be solved by sql dump and its upload: you can merge-upload the file (ftp scp ssh rsync), you can pump it through ssh with a pipe and immediately push it into the database ...
Если машин много и они постоянно переустанавливаются, то однозначно Puppet. У нас он дерижирует как по нотам парк из более, чем 1000 серверов.
Хотя, про Ansible тоже слышал много хорошего.
It will be easier to collect the necessary settings in an archive, which can be deployed on the target machine. Using sed, you can tweak scripts according to the name and IP address of the target machine, and then decompose into the desired directories.
Naturally, this is only suitable for 1-to-1 copying with minimal differences. In other cases, only manually.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question