Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-10-08 11:31:26 +02:00
parent 0c1a8a95f2
commit 5d0f56ce38
15 changed files with 49 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
---
- name: Restart postgres
systemd:
ansible.builtin.systemd:
name: postgresql
state: restarted
become: true

View File

@@ -1,10 +1,10 @@
---
- name: Update apt cache
apt:
ansible.builtin.apt:
update_cache: true
become: true
- name: Install ansible dependencies
apt:
ansible.builtin.apt:
name: "{{ ansible_dependencies }}"
become: true

View File

@@ -1,12 +1,12 @@
---
- name: Install postgres
apt:
ansible.builtin.apt:
name: "{{ postgres_packages }}"
state: present
become: true
- name: Start and enable the service
systemd:
ansible.builtin.systemd:
name: postgresql
state: started
daemon_reload: true

View File

@@ -1,4 +1,7 @@
---
- include_tasks: ansible_deps.yml
- include_tasks: installation.yml
- include_tasks: configuration.yml
- name: Install ansible dependencies for this role
ansible.builtin.include_tasks: ansible_deps.yml
- name: Install postgres
ansible.builtin.include_tasks: installation.yml
- name: Configure Database
ansible.builtin.include_tasks: configuration.yml