Compare commits

..

No commits in common. "54f9f8df11a2ed581f3b578d343d95bf356da6c0" and "293bf6d004f3ce1f24f4aa9e48a7663619600e26" have entirely different histories.

9 changed files with 47 additions and 55 deletions

View File

@ -2,4 +2,3 @@
inventory = inventory.yml inventory = inventory.yml
roles_path = ./roles roles_path = ./roles
force_color = true force_color = true
interpreter_python = /usr/bin/python3

View File

@ -1,26 +1,26 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
32383831316464663266383334396166313235356563376262623739323138343738363066346162 65316433646437363338333233313530386265396432326633303334363130396438623632373733
3330333861363833363435323762306236386461323363610a363965333935326132363031346564 6234643334313336376439343564616333366632393666320a623066663130336665663763626337
62666163383837333362363532326661343337323633643063303132363031613436633336313831 36353135383933386431643036336561653438356537363262333530663363333138663966336231
6562353233353663320a336638653239633130353934393838333063653862633732626166356635 3631333939653033370a643061336136313031336163346431393034653237646265653665316466
33363138663432373965666532633634383234633232306631613664336134663030336363626439 63333966383038666635636462393361313731666239356139653466663761383531653063343733
33336236633431393139393834313939646362663164653161326634613736373530346438636565 64396533303131666139323333653838323961396437326438353733653262393164343263643738
64666335626431333635643632303963393039343763353238633737623331383365363761326431 37626464353762656532373739376363363935383065336637333161356331303230356163626533
30356535653336366238373039356137353132643034363638356166666566646331306330363535 66363331616263383366303534376235663564313031343031323466333564646233393238336665
64376234636664646164633763636165326161333237326666613365393665623138623061386130 62383138623137323761656163336631393861386436626338666662313739353338373563626335
31366664656461623938356234633265643962396138316536373963353663346138616233633837 31663831366135396437643562373463613566333433666162313833653230396439353461633437
37633730666362326433353834313035306461633034303466653536323938616633343531326234 31663937343437643363323137313331373839313032333830316135303734376264396539396339
66363132346632306166626462323634336562623063613735663862643738663565363062643861 37613031376235316439303363326134613136616137623133353738313236383436386631636432
37633065383037306236363865363639633334653938393733663830313161316337343039303966 64373861346631386234316234663134316231336666356230373862396237346565393434383039
35313532383761383838613539653132643165643536663439306232353961633835383865363434 64323462653532636161333339623138663564396261363832626630393533323139616165363065
65336339653930353934313063343538333833376561386230643161366230636232323565333562 66376166306131333531323966633036623762323037616261643930343733383165333939326537
30383231666131393562393166323230643937316531636332333236373462663863646333663836 34636534343436313132383532633631363631356563336365393437616337333062323862336164
66356365303730366563353936633436333962626338663430656534306666316632633030343131 66656463643761366335663331633733383065316530653935613134653837666332653262326266
63383031333537383762326366633535316136323430626666343736623561333264333933626166 39396237616235383163386662363637346633366231373236323734383934383035623739333263
35313861323763393334393632336330316436346635356164313466643163393138626263356432 65316364306462376134373165393661316561383837383438306365666437373365366461663439
31393662336462303131366236366461336231613239383663396531313039656431326435323634 61336463636462333363313766363465313163373063323864613136303564396137333536373235
30613564653232666237306332663266393433306432366438323030346334643464386633306665 33656135393732653230373031613663633866386537643164623138623663626663303331656631
61333236626339346336633862613964303061383236353864323039343932636637396663336161 37666562663135643832386335373132643738393233656361663931306563386666613135303033
30333132633330303539396236326661323963623363623039383735326138613665346333653666 32663633373439646564663036626561336338313239316634623838633534306530633739363831
34653939336562386361636366663863363062363362643261653866373836343264316664363831 39306631356662363430633866653538623837303537343331363066326466646430346638623162
6137 6438

View File

@ -1,4 +1,6 @@
all: all:
children:
postgres_servers:
hosts: hosts:
192.168.0.71: 192.168.0.71:
ansible_user: ansible ansible_user: ansible

View File

@ -1,4 +1,4 @@
- name: Configure postgresql.conf - name: Configure postgresql.conf with template
template: template:
src: postgresql.conf.j2 src: postgresql.conf.j2
dest: /var/lib/pgsql/data/postgresql.conf dest: /var/lib/pgsql/data/postgresql.conf
@ -7,7 +7,7 @@
mode: '0644' mode: '0644'
notify: Restart PostgreSQL notify: Restart PostgreSQL
- name: Configure pg_hba.conf - name: Configure pg_hba.conf with template
template: template:
src: pg_hba.conf.j2 src: pg_hba.conf.j2
dest: /var/lib/pgsql/data/pg_hba.conf dest: /var/lib/pgsql/data/pg_hba.conf

View File

@ -5,7 +5,7 @@
encoding: UTF8 encoding: UTF8
state: present state: present
- name: Create contacts table - name: Create contacts table in PostgreSQL
community.postgresql.postgresql_query: community.postgresql.postgresql_query:
db: '{{ postgres_db }}' db: '{{ postgres_db }}'
query: | query: |

View File

@ -1,4 +1,4 @@
- name: Insert data into PostgreSQL database - name: Insert data into PostgreSQL database idempotently
community.postgresql.postgresql_query: community.postgresql.postgresql_query:
db: '{{ postgres_db }}' db: '{{ postgres_db }}'
query: | query: |

View File

@ -5,8 +5,6 @@
state: enabled state: enabled
become: true become: true
- name: Reload firewalld - name: Reload firewall using command
systemd: command: firewall-cmd --reload
name: firewalld
state: reloaded
become: true become: true

View File

@ -1,11 +1,12 @@
listen_addresses = '{{ postgres_listen_addresses }}' listen_addresses = '{{ postgres_listen_addresses | default("*") }}'
port = {{ postgres_port }} port = {{ postgres_port | default(5432) }}
max_connections = {{ postgres_max_connections }}
shared_buffers = {{ postgres_shared_buffers }} max_connections = {{ postgres_max_connections | default(100) }}
effective_cache_size = {{ postgres_effective_cache_size }} shared_buffers = {{ postgres_shared_buffers | default("128MB") }}
maintenance_work_mem = {{ postgres_maintenance_work_mem }} effective_cache_size = {{ postgres_effective_cache_size | default("4GB") }}
checkpoint_completion_target = {{ postgres_checkpoint_completion_target }} maintenance_work_mem = {{ postgres_maintenance_work_mem | default("64MB") }}
wal_buffers = {{ postgres_wal_buffers }} checkpoint_completion_target = {{ postgres_checkpoint_completion_target | default(0.7) }}
default_statistics_target = {{ postgres_default_statistics_target }} wal_buffers = {{ postgres_wal_buffers | default("16MB") }}
default_statistics_target = {{ postgres_default_statistics_target | default(100) }}

View File

@ -8,11 +8,3 @@ postgres_hba_entries:
backup_dir: "/var/backups/postgresql" backup_dir: "/var/backups/postgresql"
postgres_user: "postgres" postgres_user: "postgres"
postgres_db: "mydb" postgres_db: "mydb"
postgres_max_connections: 100
postgres_shared_buffers: '128MB'
postgres_effective_cache_size: '4GB'
postgres_maintenance_work_mem: '64MB'
postgres_checkpoint_completion_target: 0.7
postgres_wal_buffers: '16MB'
postgres_default_statistics_target: 100