[Puppet Users] Re: Environment variable setting while using a module

2018-04-19 Thread Ugo Bellavance


On Thursday, April 19, 2018 at 7:50:30 AM UTC-4, Thomas Müller wrote:
>
> Hi Ugo
>
> Am Freitag, 30. März 2018 17:27:28 UTC+2 schrieb Ugo Bellavance:
>>
>> Hi,
>>
>> I'm using the puppetlabs-postgresql module and it works very well, but I 
>> want to make it work with a non-standard version of postgresql (from Red 
>> Hat Software Collections) because I would like to use Postgresql 9.6 on 
>> RHEL 7.  Almost everything is working, but I get errors from some commands 
>> that cannot find a shared object.  This is caused by the fact that Software 
>> Collections package use non-standard paths for their files.  For example, 
>> postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
>> /usr/bin/.  Here's the kind of errors I get:
>>
>> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
>> libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
>> such file or directory
>>
>>
>> I've used the pl-postgresql module successfully this way:
>
>
> https://gist.github.com/vinzent/448fa47032a6f050fb4c501cc741ccad#file-puppetdb-postgresql-9-5-example-pp
>

Hi,

That looks great, but is that in the puppetdb module or in the postgresql 
module? 

Thanks,

-- 
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/2932b0eb-ab4d-432d-ae91-1f0fb3e8d86a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Environment variable setting while using a module

2018-04-19 Thread Thomas Mueller


On 04/19/2018 02:21 PM, Ugo Bellavance wrote:
>
>
> On Thursday, April 19, 2018 at 7:50:30 AM UTC-4, Thomas Müller wrote:
>
> Hi Ugo
>
> Am Freitag, 30. März 2018 17:27:28 UTC+2 schrieb Ugo Bellavance:
>
> Hi,
>
> I'm using the puppetlabs-postgresql module and it works very
> well, but I want to make it work with a non-standard version
> of postgresql (from Red Hat Software Collections) because I
> would like to use Postgresql 9.6 on RHEL 7.  Almost everything
> is working, but I get errors from some commands that cannot
> find a shared object.  This is caused by the fact that
> Software Collections package use non-standard paths for their
> files.  For example, postgresql binaries are in
> opt/rh/rh-postgresql96/root/usr/bin/ than /usr/bin/.  Here's
> the kind of errors I get:
>
> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading
> shared libraries: libpq.so.rh-postgresql96-5: cannot open
> shared object file: No such file or directory
>
>
> I've used the pl-postgresql module successfully this way:
>
> 
> https://gist.github.com/vinzent/448fa47032a6f050fb4c501cc741ccad#file-puppetdb-postgresql-9-5-example-pp
> 
> 
>
>
> Hi,
>
> That looks great, but is that in the puppetdb module or in the
> postgresql module? 
>

I was configuring postgresql SCL for use with the puppetdb module.

the important part  you is the postgresql::globals class that defines
all necessary pathes that the postgresql SCL uses.

- Thomas

-- 
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/610d006e-1b7a-6f1f-4435-6ab9bcb4a300%40chaschperli.ch.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-04-19 Thread Thomas Müller
Hi Ugo

Am Freitag, 30. März 2018 17:27:28 UTC+2 schrieb Ugo Bellavance:
>
> Hi,
>
> I'm using the puppetlabs-postgresql module and it works very well, but I 
> want to make it work with a non-standard version of postgresql (from Red 
> Hat Software Collections) because I would like to use Postgresql 9.6 on 
> RHEL 7.  Almost everything is working, but I get errors from some commands 
> that cannot find a shared object.  This is caused by the fact that Software 
> Collections package use non-standard paths for their files.  For example, 
> postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
> /usr/bin/.  Here's the kind of errors I get:
>
> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
> libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
> such file or directory
>
>
> I've used the pl-postgresql module successfully this way:

https://gist.github.com/vinzent/448fa47032a6f050fb4c501cc741ccad#file-puppetdb-postgresql-9-5-example-pp

The patch is already included in forge releases.

- Thomas 

-- 
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/f8b78088-431b-47f2-b735-65a0acbd1995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-04-06 Thread Ugo Bellavance


On Monday, April 2, 2018 at 10:21:15 AM UTC-4, jcbollinger wrote:
>
> It looks like that's probably the *intended* solution, so by all means go 
> with it.  In a more general sense, however, LD_LIBRARY_PATH is not a tool 
> for use in a stable configuration.  It is for one-offs, and possibly for 
> for-purpose wrapper scripts.  It is usually a better solution, at least on 
> RedHat-family systems, to add the needed paths to the dynamic linker by 
> dropping an appropriate file in /etc/ld.so.conf.d and running ldconfig.  
> And it turns out that it's very easy to persuade Puppet to help you with 
> that.
>

I see.  I discovered that another trick would be to install the *syspaths 
packages, which put shell scripts in the usual locations of the binaries.  
These shell scripts contain the scl_source enable command, plus an exec to 
the real location of the binary. I haven't tested it yet though.

Thanks,

-- 
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/f8d7db13-94fe-4cde-976a-b31ec336ecc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-04-02 Thread jcbollinger


On Friday, March 30, 2018 at 10:32:10 AM UTC-5, Ugo Bellavance wrote:
>
> I think I found a viable solution: 
>
> $ cat /etc/profile.d/enablerh-postgresql96.sh 
> #!/bin/bash
> source scl_source enable rh-postgresql96
>


It looks like that's probably the *intended* solution, so by all means go 
with it.  In a more general sense, however, LD_LIBRARY_PATH is not a tool 
for use in a stable configuration.  It is for one-offs, and possibly for 
for-purpose wrapper scripts.  It is usually a better solution, at least on 
RedHat-family systems, to add the needed paths to the dynamic linker by 
dropping an appropriate file in /etc/ld.so.conf.d and running ldconfig.  
And it turns out that it's very easy to persuade Puppet to help you with 
that.


John

-- 
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/cdc9479c-47d6-4897-8970-c6b3f57c2961%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-03-30 Thread Ugo Bellavance
I think I found a viable solution: 

$ cat /etc/profile.d/enablerh-postgresql96.sh 
#!/bin/bash
source scl_source enable rh-postgresql96


On Friday, March 30, 2018 at 11:27:28 AM UTC-4, Ugo Bellavance wrote:
>
> Hi,
>
> I'm using the puppetlabs-postgresql module and it works very well, but I 
> want to make it work with a non-standard version of postgresql (from Red 
> Hat Software Collections) because I would like to use Postgresql 9.6 on 
> RHEL 7.  Almost everything is working, but I get errors from some commands 
> that cannot find a shared object.  This is caused by the fact that Software 
> Collections package use non-standard paths for their files.  For example, 
> postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
> /usr/bin/.  Here's the kind of errors I get:
>
> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
> libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
> such file or directory
>
> The modules allows for setting a path for the binaries, but not for the 
> libraries, so it finds the binary, but I would need to set 
> the LD_LIBRARY_PATH.  Since puppet cannot use bash built-in commands, I 
> tried using /bin/bash -c 'export LD_LIBRARY_PATH= but it doesn't work. I 
> guess it a shell of its own and the export doesn't propagate to the 
> original environment.
>
> Does anyone has an idea of what I can do before I ask the maintainers of 
> the module?
>
> Thanks,
>
> Ugo
>
>

-- 
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/76d893b3-558a-4eff-81f6-52476d98d02f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.