postgresql - chef-solo not updating postgres pg_hba.conf -
i using chef solo provision vagrant virtual machine. here relevant vagrantfile snippet:
chef.run_list = [ "databox::default", "mydbstuff" ] chef.json = { "postgresql": { "config" : { "listen_addresses": "*" }, "pg_hba": [ {"type": "local", "db": "all", "user": "postgres", "addr": null, "method": "ident"}, {"type": "local", "db": "all", "user": "all", "addr": null, "method": "md5"}, {"type": "host", "db": "all", "user": "all", "addr": "127.0.0.1/32", "method": "md5"}, {"type": "host", "db": "all", "user": "all", "addr": "::1/128", "method": "md5"}, {"type": "local", "db": "all", "user": "vagrant", "addr": null, "method": "ident"}, {"type": "host", "db": "all", "user": "all", "addr": "192.168.248.1/24", "method": "md5"} ] }, "databox": { "db_root_password": "abc123", "databases": { "postgresql": [ { "username": "db1", "password": "abc123", "database_name": "db1" }, { "username": "db2", "password": "abc123", "database_name": "db2" } ] } } }
the mydbstuff::default
recipe looks this:
postgresql_connection_info = { :host => "localhost", :port => node['postgresql']['config']['port'], :username => 'postgres', :password => node['postgresql']['password']['postgres'] } postgresql_database_user 'vagrant' connection postgresql_connection_info password 'vagrant' action :create end node['databox']['databases']['postgresql'].each |db| postgresql_database_user 'vagrant' connection postgresql_connection_info action :grant database_name db.database_name end end
i trying allow connections local vagrant
user without password, , user virtualbox private network. pg_hba
array in chef.json
has 4 lines copied default configuration , 2 lines other stuff want do. if add together these 2 lines pg_hba.conf
file manually, work fine.
the problem changes aren't written pg_hba.conf
file. what's preventing them beingness written?
it appears databox cookbook overwrites postgres permissions array using node.set
instead of modifying part needs.
i have submitted a pull request project alter behavior additional entries can added file.
postgresql chef access-control
No comments:
Post a Comment