Можно ли сохранить конфигурацию Ubuntu?

Я купил VPS (Ubuntu 20.04) для развертывания моего проекта Laravel.

После установки всех зависимостей:

  • PHP (7.4)
  • Mysql
  • Java 8
  • Композитор
  • Npm
  • ElasticSearch
  • (...)

Мой вопрос: возможно ли создать нечто подобное изображению с предыдущими установками, чтобы использовать его в следующий раз для установки других VPS без повторения той же работы?

задан 20 June 2020 в 01:00

1 ответ

If you are willing to read a little bit, ansible could be your friend here. You could build a simple playbook to deploy your packages automatically, distribute configuration files, and change system settings. Cloud-init could also be of use here, however I do not have experience with that tool. A simple ansible playbook that would just deploy your packages would look like(considering all are available in default repos):

- hosts: target_host
  become: true
    - /path/to/vars/file/if/needed
    - name: Install Dependencies
        - php=version
        - mysql
        - java-default
        - composer
        - npm
        - elasticsearch

You can also do a system backup with something like clonezilla or Veeam (the free veeam product for Linux does not require a reboot, and allows you to build bootable media for restores), though at that point you are going to have to worry about the underlying hardware matching that of your existing VM.

Basically, I do not believe there is a simple answer to throw at this. It may also be worth checking with your hosting provider to see if they have cloning functionality / image creating functionality (I know this is easy to accomplish in azure).

ответ дан 30 July 2020 в 22:24

Другие вопросы по тегам:

Похожие вопросы: