Finished lb and db
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
20
roles/loadbalancer/tasks/configuration.yml
Normal file
20
roles/loadbalancer/tasks/configuration.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Template the nginx config file with dynamic upstreams
|
||||
template:
|
||||
src: templates/nginx.conf.j2
|
||||
dest: "{{ nginx_config_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
become: true
|
||||
notify:
|
||||
- Restart nginx
|
||||
vars:
|
||||
k3s_server_ips: "{{ k3s.server.ips }}"
|
||||
|
||||
- name: Enable nginx
|
||||
systemd:
|
||||
name: nginx
|
||||
daemon_reload: true
|
||||
enabled: true
|
||||
become: true
|
||||
12
roles/loadbalancer/tasks/installation.yml
Normal file
12
roles/loadbalancer/tasks/installation.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
||||
- name: Install Nginx
|
||||
apt:
|
||||
name:
|
||||
- nginx-full
|
||||
state: present
|
||||
become: true
|
||||
3
roles/loadbalancer/tasks/main.yml
Normal file
3
roles/loadbalancer/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- include_tasks: installation.yml
|
||||
- include_tasks: configuration.yml
|
||||
Reference in New Issue
Block a user