Run a task only on remote host if this hosts a specific database

14 views
Skip to first unread message

Christian Marquardt

unread,
Dec 9, 2018, 11:06:28 AM12/9/18
to Ansible Project
Hello,

I'm looking for ideas on how I can realize the following:

I wan't to change some database parameters on a specific database. I've several ideas but I'm not sure how to realize this.
For example:
- Having local facts defined on remote machine containing a list of databases running on this host
- Having local list of host-database-relationship on the ansible host itself

Does anyone of you have an better idea?


thanks
Christian

Andy Smith

unread,
Dec 9, 2018, 12:15:15 PM12/9/18
to ansible...@googlegroups.com
Hi Christian,

On Sun, Dec 09, 2018 at 08:06:28AM -0800, Christian Marquardt wrote:
> - Having local facts defined on remote machine containing a list of
> databases running on this host
> - Having local list of host-database-relationship on the ansible host itself
>
> Does anyone of you have an better idea?

If I was going to have multiple tasks interacting with the list of
databases I think I would go the fact route.

Otherwise I would probably run a command that listed the databases,
register it in a variable and then do things in later tasks based on
that variable.

Cheers,
Andy
Reply all
Reply to author
Forward
0 new messages