Implement configure-webproxy for setting up basic nginx server

Fix init playbook
Add nginx config
Fix networkd install on fedora
This commit is contained in:
2020-12-07 20:24:57 -05:00
parent 1e1d4d75a0
commit ae0be16dd6
6 changed files with 107 additions and 47 deletions

View File

@@ -17,7 +17,7 @@
- name: Install systemd-networkd on Fedora
when: ansible_distribution == "Fedora" and ansible_distribution_major_version == "8"
when: ansible_distribution == "Fedora"
become: true
dnf:
state: "{{ _runtime_update_state }}"

36
tasks/nginx/install.yml Normal file
View File

@@ -0,0 +1,36 @@
---
- name: Install Nginx and CertBot on CentOS 8 and Fedora
when: >-
(ansible_distribution == "CentOS" and ansible_distribution_major_version == "8")
or
ansible_distribution == "Fedora"
become: true
dnf:
state: "{{ _runtime_update_state }}"
name:
- nginx
- certbot
- python3-certbot-nginx
notify:
- restart-nginx
- name: Install Nginx and CertBot on CentOS 7
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
become: true
yum:
state: "{{ _runtime_update_state }}"
name:
- nginx
- certbot
- python-certbot-nginx
notify:
- restart-nginx
#
# - name: Install configuration
# become: true
# copy:
# src: nginx.conf
# dest: /etc/nginx/nginx.conf
# notify:
# - restart_nginx

7
tasks/nginx/services.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Restart nginx
become: true
systemd:
name: nginx
state: restarted
enabled: true