Steve, how you doing?? It's been very long time.......

The list-of-users was just an example.  The command that I actually wanna 
run is:

$site_id = inline_template("<%= `/usr/bin/mysql -h0 -u${db_user} 
-p${db_password} -s -r -N -e 'SELECT id FROM 
${db_name}.${wp_table_prefix}domain_mapping;'` %>")


on a multi-tenant server where domain_mapping is not  present for all the 
${db_name}. I thought about the custom fact and I think I can work around 
it that way but having something equivalent to inline_template()that I can 
run on the fly is useful and simpler in this case.

-S


On Friday, January 29, 2016 at 6:19:41 PM UTC, Steve Traylen wrote:
>
>
> Hi Santanu,
> Hope your well.
> This kind of thing is exactly what custom facts are for. Write a custom 
> fact to report the users.
> Steve.
> ---
> Steve Traylen
>
> *From:* Sans <r.sant...@gmail.com <javascript:>>
> *Sent:* 29 Jan 2016 7:16 pm
> *To:* Puppet Users
> *Subject:* [Puppet Users] How to run shell command on puppet agent
>
>
> Hi all,
>
> Just trying to solve a little thing: I understand that inline_template() 
> gets complied on the PM and return the result that is not native to puppet 
> agent . i.e.
>
> $ls_users = inline_template("<%= `cat /etc/passwd|awk -F: '{print $1}'` 
> %>")
> notify { "THE SITE NAME: ${ls_users}": }
>
> will print all the users that exist on the PuppetMaster. What's the 
> equivalent thing to do to get the result from the Puppet Agent? I know 
> exec{} can be used but I need to put that value in a variable. Any help?
>
> -S
>
>
> -- 
> 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...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/a47c2632-5c8d-4e94-bf25-2563fc071e8f%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/a47c2632-5c8d-4e94-bf25-2563fc071e8f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit 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/df7b03e5-8801-4a7f-92e2-174d72607b7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to