Hi Valayil,

> On 23. Apr 2019, at 22:35, Valayil Abraham <abrah...@gmail.com> wrote:
> 
> I dont have access to the Postgres database so I have to use AST Query 
> language and am struggling with how to get trusted facts pp_project 
> (puppet_product) and pp_department (product) given certain values of trusteds 
> fact pp_role (avrt) and pp_apptier (qa).

Do you want to access the trusted extensions from within Puppet code?
There is a special variable: 
https://puppet.com/docs/puppet/5.3/lang_facts_and_builtin_vars.html#trusted-facts
 
<https://puppet.com/docs/puppet/5.3/lang_facts_and_builtin_vars.html#trusted-facts>

$trusted[‘extensions’][‘pp_project’]

Best,
Martin

> 
> "pp_role" : "avrt",
> "pp_apptier" : "qa",
> "pp_project" : "puppet_product",
> "pp_department" : "product"
> 
> ["from", "facts",
>     ["extract", ["value.extensions.pp_project"],
>       ["subquery", "fact_contents",
>         ["and",
>           ["=", "path", ["trusted", "extensions", "pp_role"]],
>           ["=", "value", "product"]
>         ]
>       ]
>       ["subquery", "fact_contents",
>         ["and",
>           ["=", "path", ["trusted", "extensions", "pp_apptier"]],
>           ["=", "value", "qa"]
>         ]
>       ]
>     ]
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com 
> <mailto:puppet-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/7f142271-5312-4c73-832e-a650e6f598df%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/7f142271-5312-4c73-832e-a650e6f598df%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6D2C20F2-53F1-4AA9-B0C9-EF7E3395A5FB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to