Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File e.g. pool_hba.conf not properly updated #16

Open
khdevel opened this issue Dec 16, 2015 · 4 comments
Open

File e.g. pool_hba.conf not properly updated #16

khdevel opened this issue Dec 16, 2015 · 4 comments

Comments

@khdevel
Copy link

khdevel commented Dec 16, 2015

Hello,

I see that the when you execute a pgpool::hba class with some content it will create a file /etc/pgpool-II-94/pool_hba.conf which is proper behavior. After this I may have something like this in it:
host inapp postgres 127.0.0.1/32 md5
host postgres postgres 127.0.0.1/32 md5

Now, lets say that I remove from puppet's configuration a configuration which creates the second line. I assume that the file should be updated and have a structure:

host inapp postgres 127.0.0.1/32 md5

...but it does not have it. It looks like it is not updated "backward". Values are not removed?

Is it an issue in your module or I use it in a wrong way?

Thank you,
Kamil

@mwhahaha
Copy link
Owner

It depends on how you are using the module. What do you mean when you say you remove the puppet configuration? Puppet won't manage files it doesn't know about so you would need to explicitly define what you want to remove. If you simply no longer define the pgpool classes, it won't remove any configuration and will leave them as they were.

@khdevel
Copy link
Author

khdevel commented Dec 17, 2015

OK, so maybe I did not precise my question properly, so lets start from the beginning.
My starting configuration, in my_config.pp file, for pool_hab.conf is:

class ops_pgpool::my_config (
) {
  pgpool::hba { 'postgres':
     type        => 'host',
     database    => 'postgres',
     user        => 'postgres',
     address     => '127.0.0.1/32',
     auth_method => 'md5',
  }
  pgpool::hba { 'inapp':
     type        => 'host',
     database    => 'inapp',
     user        => 'postgres',
     address     => '127.0.0.1/32',
     auth_method => 'md5',
  }
}

Above part of the code creates the file /etc/pgpool-II-94/pool_hba.conf which is proper behavior. But when I remove the part for the inapp the file will not be updated and this entry will still be in it, which is improper behavior in my opinion.
I think that every time, when the puppet is running on the pgpool host the files should be cleared and their content updated by the configuration from the *.pp files.

How do you see this?

@mwhahaha
Copy link
Owner

Yes unless you do...

  pgpool::hba { 'inapp':
     ensure      => 'absent',
     type        => 'host',
     database    => 'inapp',
     user        => 'postgres',
     address     => '127.0.0.1/32',
     auth_method => 'md5',
  }

The item will remain until you manually remove it. This is the way puppet works and not specific to this module.

@khdevel
Copy link
Author

khdevel commented Dec 18, 2015

I see... I will do this in that way, but I see that e.g. pgpool::config::backend type (similar to pgpool::hba) works as expected - when I remove configuration related to some backend the entries related to it will be deleted from the /etc/pgpool-II-94/pgpool.conf and I do not need to put any 'absent' value.

Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants