Created
August 2, 2023 09:55
-
-
Save dRumata/d1b7c4f2f996cab49f17b48eea959ac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Установка, запуск и проверка apache | |
hosts: servers | |
become: yes | |
tasks: | |
- name: Установка последней версии apache2 | |
apt: | |
name: "apache2" | |
state: latest | |
update_cache: yes | |
cache_valid_time: 3600 | |
- name: Отключаем AstraMode | |
lineinfile: | |
path: /etc/apache2/apache2.conf | |
insertafter: '^# AstraMode' | |
line: 'AstraMode off' | |
- name: Копируем индексные файлы | |
copy: | |
src: "index-{{ stadiya }}.html" | |
dest: "/var/www/html/index.html" | |
- name: Запускаем apache2 | |
service: | |
name: apache2 | |
state: restarted | |
enabled: yes | |
- name: Проверка работы веб-серверов | |
uri: | |
url: http://{{ ansible_host }} | |
return_content: yes | |
register: page | |
- name: Вывод содержимого веб-страницы | |
debug: | |
var: page.content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment