2024-04-27 01:33:18 +03:00
|
|
|
---
|
2025-01-20 00:10:37 +02:00
|
|
|
- name: Wait for ssh
|
|
|
|
gather_facts: false
|
|
|
|
hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: check 22/tcp
|
|
|
|
ansible.builtin.wait_for:
|
|
|
|
port: 22
|
|
|
|
connect_timeout: 30
|
|
|
|
|
2024-04-27 01:33:18 +03:00
|
|
|
- name: Configure nginx
|
2025-01-03 11:33:57 +02:00
|
|
|
become: true
|
2024-04-27 01:33:18 +03:00
|
|
|
hosts: all
|
|
|
|
tasks:
|
2024-05-29 03:19:00 +03:00
|
|
|
- name: install nginx
|
2024-06-28 21:04:05 +03:00
|
|
|
ansible.builtin.apt:
|
2024-05-29 03:19:00 +03:00
|
|
|
name: nginx
|
2024-06-28 21:04:05 +03:00
|
|
|
state: present
|
|
|
|
update_cache: true
|
2024-05-29 03:19:00 +03:00
|
|
|
|
2024-04-27 01:33:18 +03:00
|
|
|
- name: copy config
|
2024-05-29 03:19:00 +03:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: nginx.conf.j2
|
2024-04-27 01:33:18 +03:00
|
|
|
dest: /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
- name: restart service
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: nginx
|
|
|
|
state: restarted
|