| From: | bertrand HARTWIG <hartwig(dot)bertrand(at)gmail(dot)com> |
|---|---|
| To: | Roland Müller <rolmur(at)gmail(dot)com> |
| Cc: | pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Looking for a linux tool to automate PG admin tasks |
| Date: | 2025-10-17 14:36:52 |
| Message-ID: | D29B3A16-D65F-4CCF-B03C-A1101AEA1C7A@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
Hi all,
An option worth considering is Ansible AWX (the open-source version of Ansible Tower).
It allows you to:
Schedule jobs easily (no need for external crons),
Track job executions and results in a clear web UI,
Manage credentials and inventories securely,
And of course, execute Ansible playbooks or ad-hoc commands conditionally across multiple servers and databases.
For your use case — running SQL queries on specific databases that meet certain criteria — you could write lightweight Ansible playbooks and let AWX handle the orchestration, scheduling, and logging.
It’s simple to set up and provides much better visibility and control than scattered bash scripts.
Best,
Bertrand
ps.: i am using AWX every day for this kind of job
> Le 17 oct. 2025 à 06:16, Roland Müller <rolmur(at)gmail(dot)com> a écrit :
>
> May be Ansible? There is a dedicated module for Postgresql and a lot of modules for general tasks such as installation etc. https://docs.ansible.com/ansible/latest/collections/community/postgresql/index.html
>
> Br
> Roland
>
> Ron Johnson <ronljohnsonjr(at)gmail(dot)com <mailto:ronljohnsonjr(at)gmail(dot)com>> ezt írta (időpont: 2025. okt. 16., Cs 17:12):
>> On Thu, Oct 16, 2025 at 9:46 AM hubert depesz lubaczewski <depesz(at)depesz(dot)com <mailto:depesz(at)depesz(dot)com>> wrote:
>>> On Thu, Oct 16, 2025 at 03:17:16PM +0200, Jean-Christophe Boggio wrote:
>>> > Hello,
>>> > I have several servers with many databases on them for different
>>> > applications.
>>> > I need to execute some tasks on some databases depending on some criteria.
>>> > For example, execute query xxx but only on databases where table
>>> > public.sometable exists or if number of rows in table yyy is > 1M.
>>> > Before reinventing the wheel with ugly bash scripts, do you know of some
>>> > tools that would suit my case ?
>>> > Some tasks will have to execute periodically (with crons probably) and
>>> > others will be one-off.
>>> > CLI tools if possible because I'm working remotely on those servers of
>>> > course.
>>>
>>> Well, I'd just use psql, with some simple script using \gexec
>>> functionality. Solves virtually any problem of this kind.
>>
>>
>> Ditto. bash scripts are only ugly if you write ugly bash.
>>
>> --
>> Death to <Redacted>, and butter sauce.
>> Don't boil me, I'm still alive.
>> <Redacted> lobster!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | mahamood hussain | 2025-10-17 19:49:38 | Re: Guidance Requested: Migrating Large-Scale DB2 Databases to PostgreSQL |
| Previous Message | raphi | 2025-10-17 12:24:41 | Re: Looking for a linux tool to automate PG admin tasks |