feat: install and init postgres
This commit is contained in:
parent
057f49c0ad
commit
6cddd76963
1 changed files with 17 additions and 1 deletions
18
debian/ansible/playbook.yml
vendored
18
debian/ansible/playbook.yml
vendored
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- name: Configure webservers
|
||||
hosts: debainbasic
|
||||
remote_user: root
|
||||
remote_user: atm
|
||||
|
||||
tasks:
|
||||
- name: Ensure all VMs are reachable
|
||||
|
@ -30,6 +30,9 @@
|
|||
- dnsutils
|
||||
- bind9
|
||||
- python3-setuptools
|
||||
- postgresql
|
||||
- postgresql-contrib
|
||||
- python3-psycopg2
|
||||
|
||||
- name: Create /etc/apt/keyrings dir
|
||||
ansible.builtin.file:
|
||||
|
@ -107,6 +110,16 @@
|
|||
state:
|
||||
started
|
||||
|
||||
- name: "Find out if PostgreSQL is initialized"
|
||||
ansible.builtin.stat:
|
||||
path: "/var/lib/pgsql/data/pg_hba.conf"
|
||||
register: postgres_data
|
||||
|
||||
- name: "Start and enable services"
|
||||
service: "name={{ item }} state=started enabled=yes"
|
||||
with_items:
|
||||
- postgresql
|
||||
|
||||
# - debug: var=ansible_all_ipv4_addresses
|
||||
# - debug: var=ansible_default_ipv4.address
|
||||
|
||||
|
@ -115,3 +128,6 @@
|
|||
ansible.builtin.service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: restart postgres
|
||||
service: name=postgresql state=restarted
|
||||
|
|
Loading…
Reference in a new issue