[Puppet Users] Install Ruby gem with native extensions into Linux/Windows agents

2019-10-07 Thread Dirk Heinrichs
Hi everyone,

one of our internal modules contains a custom type/provider which needs an 
additional Ruby gem to function properly. For pure Ruby gems, I usually solve 
this by adding the following snippet, for example in 
mymodule/lib/puppet-x/common.rb:

begin
  gem 'somegem'
rescue Gem::LoadError
  Gem.install('somegem')
  gem 'somegem'
end

which will happily install "somegem" on the agents during the plugin sync 
phase, regardless of OS.

The problem now is that I want to enhance the provider's functionality, for 
which I'd need another gem, which this time includes "native extensions" (some 
C code). This might work on some Linux agents, which coincidentally have the 
needed tools installed (gcc, make, ...), but will fail on those which don't 
have these tools and most likely on Windows as well.

So how do people here solve this problem?

Thanks...

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com
Website: www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
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/22a8751933c12cb6b229c8622c8362d52cb6953d.camel%40opentext.com.


[Puppet Users] Puppetforge Selinux Module Not Working

2019-10-07 Thread Dan Crisp
Hello all,

I've download the selinux module from Puppet forge:

 puppet module list
/etc/puppetlabs/code/environments/production/modules
└── fixnetix-base (v0.1.0)
/etc/puppetlabs/code/modules
├── *puppetlabs-selinux_core (v1.0.2)*
└── puppetlabs-stdlib (v6.1.0)
/opt/puppetlabs/puppet/modules (no modules installed)


# ll /etc/puppetlabs/code/modules
total 16
drwxr-xr-x.  4 root root 4096 Oct  3 15:38 ./
drwxr-xr-x.  4 root root 4096 Oct  4 12:29 ../
drwxr-xr-x.  6 root root 4096 Aug 14 07:55 selinux/
drwxr-xr-x. 10 root root 4096 Sep 26 16:17 stdlib/

I created a manifest like so:

# cat 
/etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
class base::selinux {

class { selinux:
  mode => 'permissive',
  type => 'targeted',
  }

}


Perms etc. all look good:

# ll /etc/puppetlabs/code/environments/production/modules
total 16
drwxr-xr-x.  4 root root 4096 Oct  4 11:48 ./
drwxr-xr-x.  5 root root 4096 Sep 27 10:40 ../
drwxr-xr-x. 10 root root 4096 Oct  4 11:48 base/


# ll 
/etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
-rw-r--r--. 1 root root 242 Oct  7 13:47 
/etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp

However, the agent is failing:

# puppet agent --no-daemonize --verbose --onetime
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
Server Error: Evaluation Error: Error while evaluating a Resource 
Statement, Could not find declared class selinux (file: 
/etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp, 
line: 9, column: 5) on node lhcadvdeveye05.com
Info: Using cached catalog from environment 'production'
Info: Applying configuration version '1570455621'
Notice: Applied catalog in 1.22 seconds

Any help here would be appreciated.

Thanks,
Dan.


-- 
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/cb7dd9d8-d0ac-41ba-bfa8-d3316259bc2d%40googlegroups.com.


Re: [Puppet Users] Puppetforge Selinux Module Not Working

2019-10-07 Thread Becca Robinson
I do not see examples of that use case in the docs.
Please review https://forge.puppet.com/puppetlabs/selinux_core 
 to validate your code 
against examples.

-- 
Becca Robinson


> On Oct 7, 2019, at 6:58 AM, Dan Crisp  wrote:
> 
> Hello all,
> 
> I've download the selinux module from Puppet forge:
> 
>  puppet module list
> /etc/puppetlabs/code/environments/production/modules
> └── fixnetix-base (v0.1.0)
> /etc/puppetlabs/code/modules
> ├── puppetlabs-selinux_core (v1.0.2)
> └── puppetlabs-stdlib (v6.1.0)
> /opt/puppetlabs/puppet/modules (no modules installed)
> 
> 
> # ll /etc/puppetlabs/code/modules
> total 16
> drwxr-xr-x.  4 root root 4096 Oct  3 15:38 ./
> drwxr-xr-x.  4 root root 4096 Oct  4 12:29 ../
> drwxr-xr-x.  6 root root 4096 Aug 14 07:55 selinux/
> drwxr-xr-x. 10 root root 4096 Sep 26 16:17 stdlib/
> 
> I created a manifest like so:
> 
> # cat 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
> class base::selinux {
> 
> class { selinux:
>   mode => 'permissive',
>   type => 'targeted',
>   }
> 
> }
> 
> 
> Perms etc. all look good:
> 
> # ll /etc/puppetlabs/code/environments/production/modules
> total 16
> drwxr-xr-x.  4 root root 4096 Oct  4 11:48 ./
> drwxr-xr-x.  5 root root 4096 Sep 27 10:40 ../
> drwxr-xr-x. 10 root root 4096 Oct  4 11:48 base/
> 
> 
> # ll 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
> -rw-r--r--. 1 root root 242 Oct  7 13:47 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
> 
> However, the agent is failing:
> 
> # puppet agent --no-daemonize --verbose --onetime
> Info: Using configured environment 'production'
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Retrieving locales
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource Statement, 
> Could not find declared class selinux (file: 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp,
>  line: 9, column: 5) on node lhcadvdeveye05.com
> Info: Using cached catalog from environment 'production'
> Info: Applying configuration version '1570455621'
> Notice: Applied catalog in 1.22 seconds
> 
> Any help here would be appreciated.
> 
> Thanks,
> Dan.
> 
> 
> 
> -- 
> 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/cb7dd9d8-d0ac-41ba-bfa8-d3316259bc2d%40googlegroups.com
>  
> .

-- 
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/D6C2FB9F-9EDA-47B5-B269-35CFC5DDFD59%40puppet.com.


Re: [Puppet Users] Puppetforge Selinux Module Not Working

2019-10-07 Thread Dan Crisp
Hello Becca,

Thanks for the reply.

Refer here to what I'm attempting to achieve:

https://forge.puppet.com/puppet/selinux

At this point, I simply want to put Selinux into the permissive state.  I'm 
not yet in the position to start managing Selinux content etc. via the link 
you provided.

Thanks,
Dan.



On Monday, October 7, 2019 at 8:43:33 PM UTC+1, Becca Robinson wrote:
>
> I do not see examples of that use case in the docs.
> Please review https://forge.puppet.com/puppetlabs/selinux_core to 
> validate your code against examples.
>
> -- 
> *Becca Robinson*
>
>
> On Oct 7, 2019, at 6:58 AM, Dan Crisp > 
> wrote:
>
> Hello all,
>
> I've download the selinux module from Puppet forge:
>
>  puppet module list
> /etc/puppetlabs/code/environments/production/modules
> └── fixnetix-base (v0.1.0)
> /etc/puppetlabs/code/modules
> ├── *puppetlabs-selinux_core (v1.0.2)*
> └── puppetlabs-stdlib (v6.1.0)
> /opt/puppetlabs/puppet/modules (no modules installed)
>
>
> # ll /etc/puppetlabs/code/modules
> total 16
> drwxr-xr-x.  4 root root 4096 Oct  3 15:38 ./
> drwxr-xr-x.  4 root root 4096 Oct  4 12:29 ../
> drwxr-xr-x.  6 root root 4096 Aug 14 07:55 selinux/
> drwxr-xr-x. 10 root root 4096 Sep 26 16:17 stdlib/
>
> I created a manifest like so:
>
> # cat 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
> class base::selinux {
>
> class { selinux:
>   mode => 'permissive',
>   type => 'targeted',
>   }
>
> }
>
>
> Perms etc. all look good:
>
> # ll /etc/puppetlabs/code/environments/production/modules
> total 16
> drwxr-xr-x.  4 root root 4096 Oct  4 11:48 ./
> drwxr-xr-x.  5 root root 4096 Sep 27 10:40 ../
> drwxr-xr-x. 10 root root 4096 Oct  4 11:48 base/
>
>
> # ll 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
> -rw-r--r--. 1 root root 242 Oct  7 13:47 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
>
> However, the agent is failing:
>
> # puppet agent --no-daemonize --verbose --onetime
> Info: Using configured environment 'production'
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Retrieving locales
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource 
> Statement, Could not find declared class selinux (file: 
> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp,
>  
> line: 9, column: 5) on node lhcadvdeveye05.com
> Info: Using cached catalog from environment 'production'
> Info: Applying configuration version '1570455621'
> Notice: Applied catalog in 1.22 seconds
>
> Any help here would be appreciated.
>
> Thanks,
> Dan.
>
>
>
> -- 
> 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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/cb7dd9d8-d0ac-41ba-bfa8-d3316259bc2d%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/fb0c6772-b643-4306-85bc-2ebbb17fe238%40googlegroups.com.


Re: [Puppet Users] Puppetforge Selinux Module Not Working

2019-10-07 Thread 'Dan White' via Puppet Users
That  example is found here:
https://forge.puppet.com/puppet/selinux#usage

I think you need puppet-selinux 

—-
"Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us."
Bill Waterson (Calvin & Hobbes)

> On Oct 7, 2019, at 3:43 PM, Becca Robinson  
> wrote:
> 
> 
> I do not see examples of that use case in the docs.
> Please review https://forge.puppet.com/puppetlabs/selinux_core to validate 
> your code against examples.
> 
> -- 
> Becca Robinson
> 
> 
>> On Oct 7, 2019, at 6:58 AM, Dan Crisp  wrote:
>> 
>> Hello all,
>> 
>> I've download the selinux module from Puppet forge:
>> 
>>  puppet module list
>> /etc/puppetlabs/code/environments/production/modules
>> └── fixnetix-base (v0.1.0)
>> /etc/puppetlabs/code/modules
>> ├── puppetlabs-selinux_core (v1.0.2)
>> └── puppetlabs-stdlib (v6.1.0)
>> /opt/puppetlabs/puppet/modules (no modules installed)
>> 
>> 
>> # ll /etc/puppetlabs/code/modules
>> total 16
>> drwxr-xr-x.  4 root root 4096 Oct  3 15:38 ./
>> drwxr-xr-x.  4 root root 4096 Oct  4 12:29 ../
>> drwxr-xr-x.  6 root root 4096 Aug 14 07:55 selinux/
>> drwxr-xr-x. 10 root root 4096 Sep 26 16:17 stdlib/
>> 
>> I created a manifest like so:
>> 
>> # cat 
>> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
>> class base::selinux {
>> 
>> class { selinux:
>>   mode => 'permissive',
>>   type => 'targeted',
>>   }
>> 
>> }
>> 
>> 
>> Perms etc. all look good:
>> 
>> # ll /etc/puppetlabs/code/environments/production/modules
>> total 16
>> drwxr-xr-x.  4 root root 4096 Oct  4 11:48 ./
>> drwxr-xr-x.  5 root root 4096 Sep 27 10:40 ../
>> drwxr-xr-x. 10 root root 4096 Oct  4 11:48 base/
>> 
>> 
>> # ll 
>> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
>> -rw-r--r--. 1 root root 242 Oct  7 13:47 
>> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp
>> 
>> However, the agent is failing:
>> 
>> # puppet agent --no-daemonize --verbose --onetime
>> Info: Using configured environment 'production'
>> Info: Retrieving pluginfacts
>> Info: Retrieving plugin
>> Info: Retrieving locales
>> Info: Loading facts
>> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
>> Server Error: Evaluation Error: Error while evaluating a Resource Statement, 
>> Could not find declared class selinux (file: 
>> /etc/puppetlabs/code/environments/production/modules/base/manifests/selinux.pp,
>>  line: 9, column: 5) on node lhcadvdeveye05.com
>> Info: Using cached catalog from environment 'production'
>> Info: Applying configuration version '1570455621'
>> Notice: Applied catalog in 1.22 seconds
>> 
>> Any help here would be appreciated.
>> 
>> Thanks,
>> Dan.
>> 
>> 
>> 
>> -- 
>> 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/cb7dd9d8-d0ac-41ba-bfa8-d3316259bc2d%40googlegroups.com.
> 
> -- 
> 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/D6C2FB9F-9EDA-47B5-B269-35CFC5DDFD59%40puppet.com.

-- 
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/A2102A3D-D98F-4D96-8D10-96B75C3EC95B%40icloud.com.


Re: [Puppet Users] Puppetforge Selinux Module Not Working

2019-10-07 Thread Rebecca Robinson
Yeah you are referring to the instructions of one module while trying to
use another.

puppetlabs/selinux_core != puppet/selinux



>
>

-- 
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/CALx3xP3mMeVkL5-sf2z%3DBGKdZJxHsSSTNeBSuDCXwGxxL%2BW3qw%40mail.gmail.com.