Skip to content

fix many rows result only return one#13

Open
chestarss wants to merge 1 commit intocrayfishx:masterfrom
chestarss:mybranch
Open

fix many rows result only return one#13
chestarss wants to merge 1 commit intocrayfishx:masterfrom
chestarss:mybranch

Conversation

@chestarss
Copy link
Copy Markdown


: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