Files
bab-backend-ansible/playbooks/install_nginx.yml
2024-04-17 14:32:23 -04:00

37 lines
957 B
YAML

---
- name: Ensure Nginx is installed and configured
hosts: all
become: true
tasks:
# This is incomplete
# - name: Certificates Installed
# ansible.builtin.include_tasks:
# file: upate_certificates.yml
- name: Nginx Installed
ansible.builtin.include_role:
name: nginxinc.nginx_core.nginx
- name: Nginx Configured to serve Front-end Application
ansible.builtin.include_role:
name: nginxinc.nginx_core.nginx_config
- name: Ensure python firewall library is installed
ansible.builtin.package:
name: python3-firewall
state: present
- name: Ensure firewalld is enabled
ansible.builtin.service:
name: firewalld
enabled: true
- name: Ensure firewall ports are open
ansible.posix.firewalld:
port: "{{ item }}"
permanent: true
immediate: true
state: enabled
loop:
- 80/tcp
- 22/tcp