This commit is contained in:
chase
2026-05-04 08:50:53 +03:00
parent dfdf616ee6
commit d2cbf9b3c5
8 changed files with 31 additions and 0 deletions
@@ -139,5 +139,36 @@ inventory   = inventory/hosts.yml
<img src="./assets/image_1777543685692.jpg" width="auto">
<font color="#f79646">ok=2 </font>всё отлично
## Дополнение playbook
Добавим в наш playbook еще одну роль
<img src="./assets/image_1777872818078.jpg" width="auto">
Роль `nginx`, через нее мы будем устанавливать на сервер nginx пакет и копировать на него .html файл, вот структура роли nginx:
<img src="./assets/image_1777873462863.jpg" width="auto">
Файл `index.html`:
<img src="./assets/image_1777873545177.jpg" width="auto">
Файл `main.yml`:
<img src="./assets/image_1777873651918.jpg" width="auto">
Запускаем playbook и видим такую картину:
<img src="./assets/image_1777873776351.jpg" width="auto">
Проверим, что nginx установлен и скопировал ли он файл:
<img src="./assets/image_1777873837528.jpg" width="auto">
Отлично, всё рааботает.
## Документация
Все модули, их параметры, настройка инвентарного файла и много чего еще есть в [документации Ansible](https://docs.ansible.com/projects/ansible/latest/index.html)
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB