Hello, I'm Maneshwar. I'm building git-lrc, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product.
---Need to automate PostgreSQL 16 installation and make sure it ships with your exact postgresql.conf and pg_hba.conf? Here’s how to set it up like a dev who’s tired of ssh and vim.
Directory Structure
We’re working with a typical Ansible role structure. Your roles/db folder looks like this:
roles/db/
├── tasks/
│ ├── main.yml
│ └── install_postgres.yml
├── templates/
│ ├── pg_hba.conf.j2
│ └── postgresql.conf.j2
Inventory
hosts.ini example:
[db]
my-postgres-host ansible_host=192.168.0.10 ansible_user=ubuntu
db.yml (Entry point)
- name: Setup PostgreSQL
hosts: db
become: yes
roles:
- db
roles/db/tasks/main.yml
---
- include_tasks: install_postgres.yml
roles/db/tasks/install_postgres.yml
---
- name: Update apt cache
apt:
update_cache: yes
- name: Install postgresql-common
apt:
name: postgresql-common
state: present
- name: Run pgdg script
command: /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
args:
creates: /etc/apt/sources.list.d/pgdg.list
- name: Update apt cache after adding PGDG
apt:
update_cache: yes
- name: Install PostgreSQL 16 and contrib
apt:
name:
- postgresql-16
- postgresql-contrib-16
state: present
- name: Set custom postgresql.conf
template:
src: postgresql.conf.j2
dest: /etc/postgresql/16/main/postgresql.conf
owner: postgres
group: postgres
mode: 0644
notify: Restart PostgreSQL
- name: Set custom pg_hba.conf
template:
src: pg_hba.conf.j2
dest: /etc/postgresql/16/main/pg_hba.conf
owner: postgres
group: postgres
mode: 0640
notify: Restart PostgreSQL
roles/db/handlers/main.yml
---
- name: Restart PostgreSQL
service:
name: postgresql
state: restarted
roles/db/templates/postgresql.conf.j2
Minimal working config (customize as needed):
listen_addresses = '*'
port = 5432
max_connections = 100
shared_buffers = 128MB
logging_collector = on
log_directory = 'log'
log_filename = 'postgresql.log'
roles/db/templates/pg_hba.conf.j2
Allow local and password-based remote access:
# TYPE DATABASE USER ADDRESS METHOD
local all all peer
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
Run it
ansible-playbook -i hosts.ini db.yml
Bonus Tip
To reset the password for postgres user after install:
yaml
- name: Set postgres user password
become_user: postgres
shell: psql -c "ALTER USER postgres WITH PASSWORD '{{ postgres_password }}';"
`Define `postgres_password` in `roles/db/vars/main.yml`.
That’s it — your infra now auto-installs PostgreSQL 16 with config hardcoded to your needs.
---
With LiveAPI, you can generate interactive API docs that allow users to search and execute endpoints directly from the browser.
Return only the cleaned text without any additional commentary:
[](https://github.com/HexmosTech/git-lrc)
*AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.*
Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.
⭐ Star it on GitHub:
HexmosTech
/
git-lrc
Free, Unlimited AI Code Reviews That Run on Commit
| 🇩🇰 Dansk | 🇪🇸 Español | 🇮🇷 Farsi | 🇫🇮 Suomi | 🇯🇵 日本語 | 🇳🇴 Norsk | 🇵🇹 Português | 🇷🇺 Русский | 🇦🇱 Shqip | 🇨🇳 中文 |
git-lrc
Free, Unlimited AI Code Reviews That Run on Commit
AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.
See It In Action
See git-lrc catch serious security issues such as leaked credentials, expensive cloud
operations, and sensitive material in log statements
git-lrc-intro-60s.mp4
Why
- 🤖 AI agents silently break things. Code removed. Logic changed. Edge cases gone. You won't notice until production.
- 🔍 Catch it before it ships. AI-powered inline comments show you exactly what changed and what looks wrong.
- 🔁 Build a…
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.