Re: [Puppet Users] puppet enterprise code manager issue

2016-05-12 Thread Rob Nelson
A hack might be to have a proxy in the network. I'm sure you could use
squid to transparent proxy for the master only and let everything else go
direct, or redirect port 80 from the master to a proxy semi-transparently
(no agent config but requires some packet inspection and retorting of
traffic).

On Thursday, May 12, 2016, Alex Dreyer  wrote:

> On Thursday, May 12, 2016 at 11:01:49 AM UTC-7, Robert Chen wrote:
>>
>> my environment needs http_proxy, https_proxy for modules. probably code
>> manager issue is an proxy issue
>>
>>
>> #  puppet-code deploy  lab -l debug --wait
>>
>> 2016-05-12 13:39:48.388674 DEBUG puppetlabs.puppet-code - Loaded global
>> configuration from /etc/puppetlabs/client-tools/puppet-code.conf
>>
>> 2016-05-12 13:39:48.39 DEBUG puppetlabs.puppet-code - Loaded user
>> configuration from /root/.puppetlabs/client-tools/puppet-code.conf
>>
>> Deploying environment: lab
>>
>> 2016-05-12 13:39:48.388961 INFO  puppetlabs.puppet-access - Finding token
>> at path /root/.puppetlabs/token
>>
>> 2016-05-12 13:39:48.390796 DEBUG puppetlabs.puppet-code - puppet-code
>> version is 0.1.0 (commit 9caf577c432f50830341215aab29dc490909981e)
>>
>> 2016-05-12 13:39:48.390879 DEBUG leatherman.curl:223 - requesting
>> https://aaa.bbb:8170/code-manager/v1/deploys
>> .
>>
>> 2016-05-12 13:39:48.395317 DEBUG leatherman.curl:463 - Trying
>> 10.254.12.72...
>>
>> 2016-05-12 13:39:48.398554 DEBUG leatherman.curl:463 - Connected to
>> gateway.bbb(10.254.12.72) port 8000 (#0)
>>
>> 2016-05-12 13:39:48.398610 DEBUG leatherman.curl:463 - Establish HTTP
>> proxy tunnel to lvappi00356.bbb:8170
>>
>> 2016-05-12 13:39:48.415798 DEBUG leatherman.curl:463 - Received HTTP code
>> 504 from proxy after CONNECT
>>
>> 2016-05-12 13:39:48.415885 DEBUG leatherman.curl:463 - Closing connection
>> 0
>>
>> Unhandled exception: Failure when receiving data from the peer
>>
>>
>>
>>
>>
>> I saw something under code-staging but no modules there:
>>
>> [root@lvappi00356 lab]# pwd
>>
>> /etc/puppetlabs/code-staging/environments/lab
>>
>> [root@lvappi00356 lab]# ls -l
>>
>> total 12
>>
>> drwxr-xr-x. 2 pe-puppet pe-puppet   37 May 12 12:01 manifests
>>
>> -rw-r--r--. 1 pe-puppet pe-puppet  218 May 12 12:01 metadata.json
>>
>> -rw-r--r--. 1 pe-puppet pe-puppet 1172 May 12 13:23 Puppetfile
>>
>> -rw-r--r--. 1 pe-puppet pe-puppet 1589 May 12 12:01 README.md
>>
>> drwxr-xr-x. 2 pe-puppet pe-puppet   20 May 12 12:01 tests
>>
>>
>>
>>
>>
>> I can git clone the modules:
>>
>>
>>
>> [root@lvappi00356 /]# git clone
>> https://github.com/puppetlabs/puppetlabs-dsc.git
>>
>> Cloning into 'puppetlabs-dsc'...
>>
>> remote: Counting objects: 13452, done.
>>
>> remote: Compressing objects: 100% (13/13), done.
>>
>> remote: Total 13452 (delta 1), reused 0 (delta 0), pack-reused 13438
>>
>> Receiving objects: 100% (13452/13452), 11.53 MiB | 3.84 MiB/s, done.
>>
>> Resolving deltas: 100% (8767/8767), done.
>>
>
> The puppet code command connects to code-manager in puppet-server over
> https. It looks like your proxy is getting in the way of that. Can you
> disable the proxy configuration in the shell you're running puppet code
> from? You may get better messages that way. You can also try tailing
>  '/var/log/puppetlabs/puppetserver/puppetserver.log' while you're deploying.
>
> Unfortunately, http proxies for git repos won't be supported until the
> next release of Puppet Enterprise. You could try mirroring modules
> internally or installing them from puppet forge which code-manager can use
> proxies to connect to in all releases. Otherwise you'll have to wait for
> the next Puppet Enterprise release to use code-manager.
>
> --
> 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/54b7c064-9dc5-49e0-8a55-6c2f191667dc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Rob Nelson
rnels...@gmail.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/CAC76iT-20YX0PUP_7rF4w03PicRbh0kR2-c3W9ZwzafExf_nkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] environmentpath in manifest

2016-05-12 Thread Daniele Palumbo
Il giorno 12/mag/2016, alle ore 10:19, Martin Alfke  ha 
scritto:
> You might want to access the Puppet settings:
> 
> Puppet.initialize_settings unless Puppet[:confdir]
> 
> and then check for the environmentpath setting.


Hi Martin,

Thank you very much for your hint.

But I am not able to understand how to write it.
How can I interlock between this ruby code and the manifest?

Sorry if this is a FAQ question :)
Do you have some link or example to understand how this should work?

Thank you very much,
Daniele

-- 
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/0329312A-9935-4B1F-A2CF-19E0E4D484BB%40retaggio.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet enterprise code manager issue

2016-05-12 Thread Alex Dreyer
On Thursday, May 12, 2016 at 11:01:49 AM UTC-7, Robert Chen wrote:
>
> my environment needs http_proxy, https_proxy for modules. probably code 
> manager issue is an proxy issue 
>
>
> #  puppet-code deploy  lab -l debug --wait
>
> 2016-05-12 13:39:48.388674 DEBUG puppetlabs.puppet-code - Loaded global 
> configuration from /etc/puppetlabs/client-tools/puppet-code.conf
>
> 2016-05-12 13:39:48.39 DEBUG puppetlabs.puppet-code - Loaded user 
> configuration from /root/.puppetlabs/client-tools/puppet-code.conf
>
> Deploying environment: lab
>
> 2016-05-12 13:39:48.388961 INFO  puppetlabs.puppet-access - Finding token 
> at path /root/.puppetlabs/token
>
> 2016-05-12 13:39:48.390796 DEBUG puppetlabs.puppet-code - puppet-code 
> version is 0.1.0 (commit 9caf577c432f50830341215aab29dc490909981e)
>
> 2016-05-12 13:39:48.390879 DEBUG leatherman.curl:223 - requesting 
> https://aaa.bbb:8170/code-manager/v1/deploys 
> .
>
> 2016-05-12 13:39:48.395317 DEBUG leatherman.curl:463 - Trying 
> 10.254.12.72...
>
> 2016-05-12 13:39:48.398554 DEBUG leatherman.curl:463 - Connected to 
> gateway.bbb(10.254.12.72) port 8000 (#0)
>
> 2016-05-12 13:39:48.398610 DEBUG leatherman.curl:463 - Establish HTTP 
> proxy tunnel to lvappi00356.bbb:8170
>
> 2016-05-12 13:39:48.415798 DEBUG leatherman.curl:463 - Received HTTP code 
> 504 from proxy after CONNECT
>
> 2016-05-12 13:39:48.415885 DEBUG leatherman.curl:463 - Closing connection 0
>
> Unhandled exception: Failure when receiving data from the peer
>
>
>
>
>
> I saw something under code-staging but no modules there:
>
> [root@lvappi00356 lab]# pwd
>
> /etc/puppetlabs/code-staging/environments/lab
>
> [root@lvappi00356 lab]# ls -l
>
> total 12
>
> drwxr-xr-x. 2 pe-puppet pe-puppet   37 May 12 12:01 manifests
>
> -rw-r--r--. 1 pe-puppet pe-puppet  218 May 12 12:01 metadata.json
>
> -rw-r--r--. 1 pe-puppet pe-puppet 1172 May 12 13:23 Puppetfile
>
> -rw-r--r--. 1 pe-puppet pe-puppet 1589 May 12 12:01 README.md
>
> drwxr-xr-x. 2 pe-puppet pe-puppet   20 May 12 12:01 tests
>
>  
>
>  
>
> I can git clone the modules:
>
>  
>
> [root@lvappi00356 /]# git clone 
> https://github.com/puppetlabs/puppetlabs-dsc.git
>
> Cloning into 'puppetlabs-dsc'...
>
> remote: Counting objects: 13452, done.
>
> remote: Compressing objects: 100% (13/13), done.
>
> remote: Total 13452 (delta 1), reused 0 (delta 0), pack-reused 13438
>
> Receiving objects: 100% (13452/13452), 11.53 MiB | 3.84 MiB/s, done.
>
> Resolving deltas: 100% (8767/8767), done.
>

The puppet code command connects to code-manager in puppet-server over 
https. It looks like your proxy is getting in the way of that. Can you 
disable the proxy configuration in the shell you're running puppet code 
from? You may get better messages that way. You can also try tailing 
 '/var/log/puppetlabs/puppetserver/puppetserver.log' while you're deploying.

Unfortunately, http proxies for git repos won't be supported until the next 
release of Puppet Enterprise. You could try mirroring modules internally or 
installing them from puppet forge which code-manager can use proxies to 
connect to in all releases. Otherwise you'll have to wait for the next 
Puppet Enterprise release to use code-manager. 

-- 
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/54b7c064-9dc5-49e0-8a55-6c2f191667dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet enterprise code manager issue

2016-05-12 Thread Robert Chen


my environment needs http_proxy, https_proxy for modules. probably code 
manager issue is an proxy issue 


#  puppet-code deploy  lab -l debug --wait

2016-05-12 13:39:48.388674 DEBUG puppetlabs.puppet-code - Loaded global 
configuration from /etc/puppetlabs/client-tools/puppet-code.conf

2016-05-12 13:39:48.39 DEBUG puppetlabs.puppet-code - Loaded user 
configuration from /root/.puppetlabs/client-tools/puppet-code.conf

Deploying environment: lab

2016-05-12 13:39:48.388961 INFO  puppetlabs.puppet-access - Finding token 
at path /root/.puppetlabs/token

2016-05-12 13:39:48.390796 DEBUG puppetlabs.puppet-code - puppet-code 
version is 0.1.0 (commit 9caf577c432f50830341215aab29dc490909981e)

2016-05-12 13:39:48.390879 DEBUG leatherman.curl:223 - requesting 
https://aaa.bbb:8170/code-manager/v1/deploys 
.

2016-05-12 13:39:48.395317 DEBUG leatherman.curl:463 - Trying 
10.254.12.72...

2016-05-12 13:39:48.398554 DEBUG leatherman.curl:463 - Connected to 
gateway.bbb(10.254.12.72) port 8000 (#0)

2016-05-12 13:39:48.398610 DEBUG leatherman.curl:463 - Establish HTTP proxy 
tunnel to lvappi00356.bbb:8170

2016-05-12 13:39:48.415798 DEBUG leatherman.curl:463 - Received HTTP code 
504 from proxy after CONNECT

2016-05-12 13:39:48.415885 DEBUG leatherman.curl:463 - Closing connection 0

Unhandled exception: Failure when receiving data from the peer





I saw something under code-staging but no modules there:

[root@lvappi00356 lab]# pwd

/etc/puppetlabs/code-staging/environments/lab

[root@lvappi00356 lab]# ls -l

total 12

drwxr-xr-x. 2 pe-puppet pe-puppet   37 May 12 12:01 manifests

-rw-r--r--. 1 pe-puppet pe-puppet  218 May 12 12:01 metadata.json

-rw-r--r--. 1 pe-puppet pe-puppet 1172 May 12 13:23 Puppetfile

-rw-r--r--. 1 pe-puppet pe-puppet 1589 May 12 12:01 README.md

drwxr-xr-x. 2 pe-puppet pe-puppet   20 May 12 12:01 tests

 

 

I can git clone the modules:

 

[root@lvappi00356 /]# git clone 
https://github.com/puppetlabs/puppetlabs-dsc.git

Cloning into 'puppetlabs-dsc'...

remote: Counting objects: 13452, done.

remote: Compressing objects: 100% (13/13), done.

remote: Total 13452 (delta 1), reused 0 (delta 0), pack-reused 13438

Receiving objects: 100% (13452/13452), 11.53 MiB | 3.84 MiB/s, done.

Resolving deltas: 100% (8767/8767), done.

-- 
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/c43eda8d-35c3-412a-8652-19f2221b4617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet | Install windows package with a speific sessionID

2016-05-12 Thread Harish Kothuri
Hi,

I have a requirement to install a windows package in session *other than* 
0.  I am aware that, puppet agent runs as a windows service and they can 
run only in session 0. 

Is there any way in puppet and mco to install the packages in specific 
sessions?

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/9478da98-ede8-402f-8a49-b35c630694a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Need help using puppet mount resource with username and password

2016-05-12 Thread spinbad23
 I have have using the puppet documentation for the mount resource and 
hiera sections mainly.
My goal is to mount a cifs share on centos7 system, using credentials. I am 
using puppet apply locally, I was successful in using hiera to store my 
user_name and password, So I have learned I am able to pull data from the 
.yaml file no problem.

My problem runs into how to use the mount resource to include username and 
password inside the mount resource.
I have tried username => $username, and same for password, but it complains 
that username can't be used as parameter.

Now the options parameter has potential to use a credentials variable or 
file, is that my only option?

Any guidance or help would be much appreciated.

Thank you

-- 
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/38cd26d3-1bdb-4df1-a9c6-1ac60eb7ae7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] fixtures from Puppetfile in puppetlabs_spec_helper

2016-05-12 Thread Rob Nelson
That's unfortunately a complex task, though it doesn't look it immediately.
How are you defining things in your Puppetfile? Are you pulling from git's
master, a git tag or branch, or from the forge? Do you want your fixtures
to be using HEAD or the specific version in your Puppetfile? If the latter,
how can it correlate between forge versions and git branch/tags? I think
that complexity has held up anyone from writing a full featured rake task
to keep fixtures up to date, at least anything that I've seen advertised
publicly.

There are some tools to update the Puppetfile, though -
https://github.com/puppetlabs/r10k/blob/master/doc/updating-your-puppetfile.mkd.
I wrote the last one, generate-puppetfile, which can create a very naive
.fixtures.yml for you, assuming you want to test against HEAD. If you want
to do specific versions, you'll have to do something else. PRs accepted :)


Rob Nelson
rnels...@gmail.com

On Thu, May 12, 2016 at 7:39 AM, Rudy Gevaert 
wrote:

> Hi,
>
> Does anyone know a way to integrate rspec-puppet and more
> specific puppetlabs_spec_helper to get its fixtures from a Puppetfile?
>
> It's a PITA to each time update the fixtures file if you update your
> Puppetfile in your control repo. (Our context is that roles and profiles
> are located in our puppet control repo and we want to check against the
> versions of the modules defined in the Puppetfile)
>
> By default we don't run deploy modules with r10k on our local machine.
>
> 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/b8b49a24-e238-49e1-8571-0995ebf921c9%40googlegroups.com
> 
> .
> 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/CAC76iT9CfhAAxjai2%3Dz71Es7XdG-n2TO6daApwW%2B-SvMozJEuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] can we make solaris zone as puppet agent!?

2016-05-12 Thread e . rajashekar
I dont want to install agent on global zone and access my non global zones 
using "zone" resource. 
i want to make my non-global zone itself as a puppet agent! 

is it possible?


-
Raj

-- 
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/2cf66f14-c4e7-4a51-9182-4bbb34e71c1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] use_srv_records doesn't work

2016-05-12 Thread sinux shen
hi there,

I am in the middle of setting multiple master with single CA, if I 
statically set:
ca_server = 
server = 
in puppet.conf, it works well,

but to make if more smart, I use srv settings, here is my conf:
[main]
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
use_srv_records = true
srv_domain = mydomain.example.com

[agent]
listen   = true
pluginsync   = true
report   = true
ignoreschedules  = true
daemon   = false
classfile= $vardir/classes.txt

I found that when agent run, it didn't query SRV record like 
_x-puppet-ca._tcp for getting CA Server, instead, it assume that "puppet" 
is the CA server and trying to talk to it, but in our environment, we don't 
use "puppet" as the CA server's hostname,  it does tried to resovle 
_x-puppet._tcp and _x-puppet-fileserver._tcp though, can anyone please take 
a look or give me some hint please.

BTW, even I specifically set ca_server in the "main" part together with 
use_srv_records, it still doesn't work

Thanks
Sinux

-- 
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/b77d4e14-f536-4f53-9b8e-db83a61212ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] possibility for autosign (or disable certificate control) for any host within one environment

2016-05-12 Thread Mr Dandy
Is it possible to configure the Puppetmaster for special environment that 
does not chase hostname/certificates, without signing and it was publicly 
available?

My case: I've have some manifests and modules which i want to use on any 
workstation in my office. Because all workstation have different names and 
they may be the same (or change) - for this environment is necessary to 
switch off any control over certificates, it is a public environment that can 
benefit anyone without any action from puppet server ( puppet sign ... )


-- 
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/6849f2aa-eeae-4925-94ce-939c77d47785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] fixtures from Puppetfile in puppetlabs_spec_helper

2016-05-12 Thread Rudy Gevaert
Hi,

Does anyone know a way to integrate rspec-puppet and more 
specific puppetlabs_spec_helper to get its fixtures from a Puppetfile?

It's a PITA to each time update the fixtures file if you update your 
Puppetfile in your control repo. (Our context is that roles and profiles 
are located in our puppet control repo and we want to check against the 
versions of the modules defined in the Puppetfile)

By default we don't run deploy modules with r10k on our local machine.

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/b8b49a24-e238-49e1-8571-0995ebf921c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Problem with snmpd service in new ubuntu 16.04

2016-05-12 Thread Jon Skarpeteig
Same problem with AutoFS

On Thursday, May 5, 2016 at 8:51:41 AM UTC+2, amateo wrote:
>
> Hello, 
>
> I'm testing my puppet code in the new ubuntu 16.04. 
>
> I'm using razorsedge/snmp module from the forge to manage snmpd. 
> In 
> this module, it manages snmpd service with: 
>
>service { 'snmpd': 
>  ensure => $service_ensure_real, 
>  name   => $service_name, 
>  enable => $service_enable_real, 
>  hasstatus  => $service_hasstatus, 
>  hasrestart => $service_hasrestart, 
>  require=> [ Package['snmpd'], File['var-net-snmp'], ], 
>} 
>
> In concrete, in my config, $service_enable_real has the value of 
> true. 
>
> The problem I'm having is that every run shows the message: 
>
> Notice: /Stage[main]/Snmp/Service[snmpd]/enable: enable changed 'false' 
> to 'true' 
>
> Running puppet in debug mode shows: 
>
> Debug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} 
> ${Package} ${Version}\n'' 
> Debug: Executing: '/bin/systemctl is-active snmpd' 
> Debug: Executing: '/bin/systemctl show snmpd --property LoadState 
> --property UnitFileState --no-pager' 
> Debug: Executing: '/bin/systemctl unmask snmpd' 
> Debug: Executing: '/bin/systemctl enable snmpd' 
> Notice: /Stage[main]/Snmp/Service[snmpd]/enable: enable changed 'false' 
> to 'true' 
> Debug: /Stage[main]/Snmp/Service[snmpd]: The container Class[Snmp] will 
> propagate my refresh event 
> Debug: Class[Snmp]: The container Stage[main] will propagate my refresh 
> event 
>
> I have manually run each systemctl command and all of them returns 
> error code 0. The displayed output is: 
>
> root@ubuntu-16-04:~# /bin/systemctl is-active snmpd 
> active 
> root@ubuntu-16-04:~# /bin/systemctl show snmpd --property LoadState 
> --property UnitFileState --no-pager 
> LoadState=loaded 
> UnitFileState=bad 
> root@ubuntu-16-04:~# /bin/systemctl unmask snmpd 
> root@ubuntu-16-04:~# /bin/systemctl enable snmpd 
> snmpd.service is not a native service, redirecting to systemd-sysv-install 
> Executing /lib/systemd/systemd-sysv-install enable snmpd 
>
> Any help? Thank you. 
>  
> -- 
> Angel L. Mateo Martínez 
> Sección de Telemática 
> Área de Tecnologías de la Información 
> y las Comunicaciones Aplicadas (ATICA) 
> http://www.um.es/atica 
> Tfo: 868887590 
> Fax: 86337 
>

-- 
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/c9e052cd-29cc-4125-b02a-06140db31a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] environmentpath in manifest

2016-05-12 Thread Martin Alfke
Hi Daniele,

On 08 May 2016, at 23:36, Daniele Palumbo  wrote:

> Hi,
> 
> i need to check if a file exists on the puppet master.
> 
> No big deal:
> http://stackoverflow.com/questions/18784329/how-to-test-for-existence-of-a-file-on-the-puppet-master
> 
> So i made:
> --
> cat ./modules/braveconf/lib/puppet/parser/functions/file_exists.rb
> require"puppet"
>  module Puppet::Parser::Functions
>newfunction(:file_exists, :type => :rvalue) do |args|
>if File.exists?(args[0])
>  return 1
>else
>  return 0
>end
>  end
> end
> --
> 
> Now, my problem is about path.
> 
> Since i have environmentpath, as seen is
> puppet config print  environmentpath --section master --environment 
> development
> /etc/puppetlabs/code/environments
> 
> I would like to use, in the manifest:
> --
> if ( file_exists 
> ("${::environmentpath}/${::environment}/modules/module/files/configfile-${::hostname}")
>  == 1 ) {
> --
> 
> But ${::environmentpath} is empty.

You might want to access the Puppet settings:

Puppet.initialize_settings unless Puppet[:confdir]

and then check for the environmentpath setting.


> 
> How can i manage this topic, avoiding to hardcode 
> /etc/puppetlabs/code/environments in the code?
> Is there a way to get variable from puppet master config?
> 
> Thanks,
> Daniele
> 
> 
> -- 
> 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/6429762B-377B-4B9D-B8B4-526859465283%40retaggio.net.
> 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/97001652-424C-4CD5-AF9B-02CA8EFF2317%40gmail.com.
For more options, visit https://groups.google.com/d/optout.