rogeduardo / hiera-psql Goto Github PK
View Code? Open in Web Editor NEWPostgreSQL backend for Hiera
License: Apache License 2.0
PostgreSQL backend for Hiera
License: Apache License 2.0
Thanks for writing this backend. I ran into some difficulty getting it to work and found the following got me in business:
This backend needs to be updated to use something similar to pg_jruby. I did some testing myself and was unable to get it functioning properly. This update is necessary for the hiera backend to function outside command line calls.
Hi,
we are using hiera-psql-0.1.0. we observed that puppet is not releasing connections from postgres DB, which is eventually causing postgrsql to reach max connections.
Thanks,
Saleem
Hi Dalen,
We use your excellent hiera-psql module for our cloud project, it works perfectly with PE 3.0. Yesterday I upgraded to 3.1, and it looks like something went wrong, it does not work any more. Here is the issue.
Database:
hiera=> select * from config;
path | key | value
---------------------+---------+-----------------------------
dev/agent02 | testvar | "Test string from Postgres"
(1 row)
Test puppet code:
class test {
$testVariable = hiera('testvar',undef)
notify { "$testVariable": }
}
Command line hiera test on master:
[root@master manifests]# hiera testvar environment=dev fqdn=agent02
Test string from Postgres
Puppet run fails on agent:
[root@agent02 ~]# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppetdb_server_status.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 757: unexpected token at '"Test string from Postgres"' at /etc/puppetlabs/puppet/environments/dev/modules/test/manifests/init.pp:2 on node agent02
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
If I put the Hiera property into a YAML file on the master it works:
[root@master dev]# hiera testvar environment=dev fqdn=agent02
Test string from YAML
[root@agent02 ~]# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppetdb_server_status.rb
Info: Caching catalog for agent02
Info: Applying configuration version '1385726108'
Notice: Test string from YAML
Notice: /Stage[main]/Test/Notify[Test string from YAML]/message: defined 'message' as 'Test string from YAML'
Notice: Finished catalog run in 8.46 seconds
Could you please have a look on that?
Cheers,
Chris
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.