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

fix many rows result only return one #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix many rows result only return one #13

wants to merge 1 commit into from

Conversation

chestarss
Copy link


:backends:

  • mysql
    :mysql:
    :host : localhost
    :user : root
    :pass : mypass
    :database : config

    :query:
    - select value from node_params as a,nodes as b where a.node_id=b.node_id and b.fqdn='%{::fqdn}' and param='%{key}'
    - select class_name as %{key} from %{ostype} as a,classes as b where a.class_id=b.class_id;

:logger: console

root@debian:/usr/lib/ruby/vendor_ruby/hiera/backend# hiera -c /etc/puppet/hiera.yaml classes ostype='Redhat'
test
root@debian:/usr/lib/ruby/vendor_ruby/hiera/backend# hiera -c /etc/puppet/hiera.yaml classes ostype='Debian'
["ntp", "nginx"]
root@debian:/usr/lib/ruby/vendor_ruby/hiera/backend# hiera -c /etc/puppet/hiera.yaml -a nginx::params::config_file_abs_path ::fqdn='squid.example.com'
["/etc/nginx/nginx.conf"]
root@debian:/usr/lib/ruby/vendor_ruby/hiera/backend# hiera -c /etc/puppet/hiera.yaml classes ostype='Redhat' -a
["test"]

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

Successfully merging this pull request may close these issues.

1 participant