32 lines
621 B
YAML
32 lines
621 B
YAML
---
|
|
- name: Wait for ssh
|
|
gather_facts: false
|
|
hosts: all
|
|
tasks:
|
|
- name: Check port
|
|
ansible.builtin.wait_for:
|
|
port: 22
|
|
connect_timeout: 30
|
|
|
|
- name: Configure nginx
|
|
become: true
|
|
hosts: all
|
|
tasks:
|
|
- name: Install
|
|
ansible.builtin.apt:
|
|
name: nginx
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Config
|
|
ansible.builtin.template:
|
|
src: nginx.conf.j2
|
|
dest: /etc/nginx/nginx.conf
|
|
mode: '0644'
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Restart
|
|
ansible.builtin.service:
|
|
name: nginx
|
|
state: restarted
|