Re: [Puppet Users] Could not find class defined for specific environment when running puppet agent

2017-02-22 Thread Carthik Sharma
Hi,



On Wed, Feb 22, 2017 at 8:22 AM, Jamals  wrote:
> Hi all,
>
> I have a curious problem that I'd appreciate help/guidance on.
>
> We are running puppetserver 2.6.0 (puppetmaster.domain.ca) with cobbler
> 2.6.11 as our ENC. All our servers/nodes are centos 7.3
>
> On the puppet client (node.domain.ca) when running the puppet agent we
> receive the following output/error:
>
> [r...@node.domain.ca ~]#
> Redirecting to /bin/systemctl stop  puppet.service
> Info: Caching certificate for node.domain.ca
> Info: Caching certificate_revocation_list for ca
> Info: Caching certificate for node.domain.ca
> Info: Using configured environment 'ops'
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER:
> Server Error: Could not find class users::opsusers for node.domain.ca on
> node node.domain.ca
> Info: Using cached catalog from environment 'ops'
> Info: Applying configuration version '1487721491'
> Notice: /Stage[main]/Puppet::Agent/Service[puppet]/ensure: ensure changed
> 'stopped' to 'running'
> Info: /Stage[main]/Puppet::Agent/Service[puppet]: Unscheduling refresh on
> Service[puppet]
> Error:
> /Stage[main]/Main/Selinux::Audit2allow[zabbix_bug]/File[/etc/selinux/local/zabbix_bug/messages]:
> Could not evaluate: Could not retrieve information from environment ops
> source(s) puppet:///modules/node2.domain.ca/messages.zabbix
> Notice: /Stage[main]/Main/Selinux::Audit2allow[zabbix_bug]/Exec[semodule -r
> localzabbix_bug; rm -f localzabbix_bug.*; audit2allow -M localzabbix_bug -i
> messages && semodule -i localzabbix_bug.pp]: Dependency
> File[/etc/selinux/local/zabbix/messages] has failures: true
> Warning: /Stage[main]/Main/Selinux::Audit2allow[zabbix_bug]/Exec[semodule -r
> localzabbix_bug; rm -f localzabbix_bug.*; audit2allow -M localzabbix_bug -i
> messages && semodule -i localzabbix_bug.pp]: Skipping because of failed
> dependencies
> Notice: /Stage[main]/Legato/File[/nsr/tmp/sec/nsr_shutdown.pid]/seluser:
> seluser changed 'unconfined_u' to 'system_u'
> Notice: /Stage[main]/Legato/File[/nsr/tmp/sec/services]/seluser: seluser
> changed 'unconfined_u' to 'system_u'
> Notice: /Stage[main]/Tools/Exec[check_presence]/returns: executed
> successfully
> Info: Stage[main]: Unscheduling all events on Stage[main]
> Notice: Applied catalog in 48.03 seconds
>
>
> The problem is that despite the agent claiming to retrieve the catalog for
> the `ops` environment it throws two errors where its not able to find class
> /retrieve information.
> The strange part is that the class `users::opsuser` is only defined under
> the ops/classes directory for that environment.
> The second error is thrown by module `selinux::audit2allow` module and
> claims that the environment `ops` can not find source
> puppet:///modules/node2.domain.ca/messages.zabbix  BUT this path is ONLY
> defined in the production environment's site.pp.
>
> The site.pp for the environment 'ops' has the following source defined for
> this message file for the selinux::audit2allow module:
> puppet:///modules/selinux/messages.zabbix
>
> This says to me that the agent is relying on some default `production`
> environment values but it is not clear to me how/where this is happening.
>
> Here's a snippet of the tree output for the /etc/puppetlabs/code directory
> on puppetmaster with key files shown listed:
> [root@puppetmaster /etc/puppetlabs/]# tree -L 6 code
> code
> ├── environments
> │   ├── ops
> │   │   ├── classes
> │   │   │   └── node.domain.ca
> │   │   │   ├── files
> │   │   │   └── manifests
> │   │   │   └── init.pp
> │   │   ├── environment.conf
> │   │   ├── hieradata
> │   │   ├── manifests
> │   │   │   └── site.pp
> │   │   ├── modules
> │   │   │   ├── selinux
> │   │   │   │   ├── files
> │   │   │   │   │   └── messages.zabbix
> │   │   │   │   ├── manifests
> │   │   │   │   │   ├── audit2allow.pp
> │   │   │   │   │   └── init.pp
> │   │   │   ├── users
> │   │   │   │   ├── files
> │   │   │   │   ├── manifests
> │   │   │   │   │   ├── init.pp
> │   │   │   │   │   └── opsusers.pp
> │   │   │   └── zabbix
> │   ├── node.rb
> │   └── production
> │   ├── classes
> │   │   ├── node2.domain.ca
> │   │   │   ├── files
> │   │   │   │   └── messages.zabbix
> │   │   │   └── manifests
> │   │   │   └── init.pp
> │   ├── environment.conf
> │   ├── hieradata
> │   ├── manifests
> │   │   └── site.pp
> │   ├── modules
> │   │   ├── selinux
> │   │   │   ├── files
> │   │   │   │   └── messages.zabbix
> │   │   │   ├── manifests
> │   │   │   │   └── audit2allow.pp
> │   │   ├── users
> │   │   │   ├── files
> │   │   │   └──  manifests
> │   │   └── zabbix
> ├── hiera.yaml
> └── modules
>
> The 'ops' environment.conf file has these 2 lines defined:
> modulepath = ./modules:./classes:$basemodulepath
> manifest = ./manifests
>
> The `production` envir

Re: [Puppet Users] 2016.4.2 puppet enterprise

2017-01-09 Thread Carthik Sharma
Hi Ryan,

On Mon, Jan 9, 2017 at 9:40 AM, Ryan Vande  wrote:

> I went to take the test last week, they had questions about live
> management. To be honest the testing center monitors were so small all of
> the content would not fit on the page, I spent so much time resizing
> windows, I ran out of time to finish the test.
>

Could you please email certifcat...@puppet.com with the details of where
you took the test? Sorry to hear you had a poor experience.


>
> I seen what the test is composed of and went right home and started
> writing notes on topics I need to study up on before taking it again (Which
> I will refuse to take if I cant get a bigger monitor, its 2017 ! give me a
> monitor that fits all the content ! ).
>
> One of those topics was live management that I need to freshen up on. Not
> a big deal, I will go read 3.8 documents on live management.
>

Here's the list of topics you are expected to know:
https://puppet.com/support-services/certification/professional-overview

Live Management isn't one of the topics the latest test addresses, although
it was in previous (older, retired) versions of the test.

I would really appreciate it if you could please email
certificat...@puppet.com so we can learn more.

Thanks!
Carthik.

Manager, Training and Education
Puppet Inc.

-- 
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/CAOzFSfGVT4bDQBevqHxsWysfp_%3DT1QDYj8PewyOyLwbvW0JeHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Help with training VM - agent setup

2016-05-11 Thread Carthik Sharma
Hi Alex,



On Mon, May 9, 2016 at 11:20 PM, Alex Samad  wrote:

> Hi
>
> I have been working through the training vm. ran into a lot of issue with
> the agent_setup.
>

That sounds like the learning VM. Please email the team at
learnin...@puppet.com for help.

Thanks,
Carthik.

-- 
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/CAOzFSfEmkVoYcTOnVMyt-qwrmmi6_u-%2BacL7onYekHkX-bO6eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] look up hiera hash's subkey within yaml

2016-03-22 Thread Carthik Sharma
This might help:
https://docs.puppetlabs.com/hiera/3.1/variables.html#interpolating-hash-or-array-elements

Thanks.

On Tue, Mar 22, 2016 at 2:14 PM, Brett Swift  wrote:

> This is a bit nutty, but hopefully there's a way to do this.
>
> So far I have only been able to get the parent hash, not the nested one.
>
> The reason I don't want to do this in a manifest,  is because I'd like to
> use pieces of this hash within hiera itself.
>
> This gist is what I'm trying to do:
> https://gist.github.com/brettswift/560af53d379e0d86730c
>
> pasted here:
> group_allocation:
> devcoreoeml030.matrix.sjrb.ad: smokestack
> devcorebrml030.matrix.sjrb.ad: smokestack
> devcoreesbl030.matrix.sjrb.ad: smokestack
> devcoreoeml091.matrix.sjrb.ad: the091
> devcorebrml091.matrix.sjrb.ad: the091
> devcoreesbl091.matrix.sjrb.ad: the091
> devcorepptl003.matrix.sjrb.ad: dev_master
> tstcorepptl003.matrix.sjrb.ad: tst_master
> devcorepptl918.matrix.sjrb.ad: brett_sandbox
> devcorepptl919.matrix.sjrb.ad: brett_sandbox
> groups:
> core030:
> data:
> tag: smokestack
> owner: bcornies
> the091:
> data:
> tag: brettstack
> owner: bswift
> brett_sandbox:
> data:
> tag: brett
> owner: bswift
> my_group_name: "%{hiera('group_allocation')}.%{::fqdn}"
> my_group: "%{hiera('groups[%{hiera('my_group_name')}]')}"
> #my_tag: ...
>
>
> My goal is to find access to the tag, owner, etc.   This is a bit nutty as
> it's kind of relational data in hieradata, but we're hoping we can do this.
>
> Right now the two lookups at the bottom do not work.   I can get the top
> level lookup, but beyond that - it's not working.  Has someone done this? I
> can only seem to find examples to compare with this being done in a
> manifest file, not in a yaml file.
>
> --
> 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/0695140c-1d59-4708-9e35-f6020bcf3345%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/CAOzFSfFw2CmHaY1CT%3D6oJ%3DqmV3ZTD9FoYG2AZnBRuH6CHYooTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Please Confirm: Puppet Directory Environments can not be named "master" ?

2016-03-22 Thread Carthik Sharma
To answer the question in the subject, you're correct, as documented here
for Puppet 3.8

https://docs.puppetlabs.com/puppet/3.8/reference/environments_classic.html#allowed-names



On Tue, Mar 22, 2016 at 1:41 AM, 'Robert Heinzmann' via Puppet Users <
puppet-users@googlegroups.com> wrote:

> Hello,
>
> I'm using PuppetServer 1.1.3 and want to use directory environments (I can
> not update to puppet 4 because of
> http://projects.theforeman.org/issues/8447, Foreman is used for reporting
> and facts only (CMDB like)).
>
> The main puppet repo has 2 branches:
>
>- master (production)
>- development (test&dev)
>
> I use r10k to manage the environments under /etc/puppet/environments
>
> --- o<
> :sources:
>   example:
> basedir: /etc/puppet/environments
> prefix: false
> remote: 
> --- o<
>
> The following master setup has worked for both "master" and "development"
>
>  o<  
> # file /etc/puppet/puppet.conf
> [master]
>
> # insecure not via server_facts ...
> environment = ...
> # PuppetDB Enabled
> storeconfigs = true
> storeconfigs_backend = ...
> reports = ...
>
> # Hiera Config File
> hiera_config = ...
> default_manifest =
> /etc/puppet/environments/$environment/manifests/site.pp
> manifestdir = /etc/puppet/environments/$environment/manifests
> manifest = /etc/puppet/environments/$environment/manifests/site.pp
> modulepath =
> /etc/puppet/modules:/etc/puppet/environments/$environment/modules:/etc/puppet/environments/$environment/forge:/etc/puppet/environments/$environment/3rdparty
> # ENC Enabled
> node_terminus = exec
> external_nodes = ...
> ## see
> https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#serverfacts-variable
> trusted_server_facts = true
> trusted_node_data = true
> ## Make sure master uses another directory so master can be agent of
> someone else
> ssldir = ...
> certname = ...
> server = ...
>
> ## Add extra DNS Names
> dns_alt_names = ...
>  o<  
>
> Now I want to switch to directory environments changed configuration as
> follows:
>
> Puppet master config is as follows:
>
>  o<  
> # file /etc/puppet/puppet.conf
> [master]
>
> environment = ...
> # PuppetDB Enabled
> storeconfigs = true
> storeconfigs_backend = ...
> reports = ...
>
> # Hiera Config File
> hiera_config = ...
> ## Directory Environments enabled
> default_manifest = /etc/puppet/manifests/site.pp
> environmentpath = /etc/puppet/environments
> environment_timeout = 0
> basemodulepath = /etc/puppet/modules
> disable_per_environment_manifest = false
> # ENC Enabled
> node_terminus = exec
> external_nodes = ...
> ## see
> https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#serverfacts-variable
> trusted_server_facts = true
> trusted_node_data = true
> ## Make sure master uses another directory so master can be agent of
> someone else
> ssldir = ...
> certname = ...
> server = ...
>
> ## Add extra DNS Names
> dns_alt_names = ...
>  o<  
>
> The environment.conf is
>
>  o<  
> # file /etc/puppet/environments/master/environment.conf and
> # file /etc/puppet/environments/development/environment.conf
> ## See
> https://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html
>
> # The module path
> modulepath = ./modules/:./forge/:./3rdparty/:$basemodulepath
>
> # Manifest
> manifest = manifests/site.pp
>
> # current or future (3.8 only)
> # parser = current
>
> ## Path to custom script
> # config_version=
>
> ## Timeout for cache
> environment_timeout = unlimited
>  o<  
>
> This setup works for environment "development" but not "master".
>
>
>> *agent shell# puppet agent --onetime --test --environment master => Fail
>> with 404Error: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Could not find class my_webserver for webserver-test1 on node
>> webserver-test1*
>
>
> *agent shell# puppet agent --onetime --test --environment development =>
>> OK*
>
>
> If I do "mv /etc/puppet/environments/master
> /etc/puppet/environments/mytest123" and restart the puppetserver mytest123
> environment works
>
> *agent shell# puppet agent --onetime --test --environment mytest123 => OK*
>
>
> If I do "mv /etc/puppet/environments/mytest123
> /etc/puppet/environments/master" and restart the puppetserver master
> environment FAILES again
>
>
>> *agent shell# puppet agent --onetime --test --environment master => Fail
>> with 404Error: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Could not find class my_webserver for webserver-test1 on node
>> webserver-test1*
>
>
> So it is not the repo content but the name of the environment causing the
> problem I guess.
>
> Has someone seen this issue yet ??
>
> Using "prefix: true" on r10k should fix the issue and gene

Re: [Puppet Users] Is there a solid EOL date for the Puppet 3.8 release family?

2016-03-15 Thread Carthik Sharma
HI Trevor,

For PE, this page might help:
https://puppetlabs.com/misc/puppet-enterprise-lifecycle
For the agent, the EOL depends on the end of official support for the
platform itself, see:
https://docs.puppetlabs.com/guides/platforms.html#puppet-agent-and-operating-system-support-life-cycles

I am sure someone will correct me if that is wrong.

Thanks,
Carthik.

On Wed, Mar 9, 2016 at 12:15 PM, Trevor Vaughan 
wrote:

> I've had a few questions and I realized that I didn't actually know.
>
> Thanks,
>
> Trevor
>
> --
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
>
> -- This account not approved for unencrypted proprietary information --
>
> --
> 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/CANs%2BFoWbfYDC5hjWwqRtkKQFsWi5A5Qrn%3DheHgkuRwMPN7ZQsA%40mail.gmail.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/CAOzFSfFMRdpvGewkwagB%3DWTSF2YOOqpn%3DA4q6BworVn0_2j3LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] tidy - remove all files matching a pattern, except the most recently modified file

2016-03-15 Thread Carthik Sharma
Is the most-recently-modified file a resource managed by puppet? If so, you
can use tidy with recurse, and tidy will not clean up the managed file.


On Tue, Mar 15, 2016 at 4:01 AM, Tony Gaetani 
wrote:

> I would like to have a tidy resource that deletes all files recursively
> from directories matching a pattern, except for the most recently modified
> file.
>
>
> Something like this:
>
>
> tidy {
>   'clean up files except most recently modified one':
> path => '/path/to/files',
> recurse => true,
> rmdirs => true,
> age => '1h',
> matches => 'some-pattern',
> unless => '{bash script returning most recently modified file name}',
>   ;
> }
>
>
> I understand that this is really stretching the scope of what tidy is for.
> That is why I have decided to just use an exec with a long line of bash
> that does what I want. However, this long and complicated line of bash code
> is not ideal for me because it is hard to understand and maintain, it's
> just kind of ugly:
>
>
> # 1 - find all directories matching a pattern, print the most recently
> modified time and path
> # 2 - sort by most recently modified
> # 3 - remove the timestamp
> # 4 - remove the last item
> # 5 - rm -rf all of the paths
> find /path/to/files -maxdepth 1 -type d -name 'some*pattern' -printf '%T+
> %p\n' | sort | cut -d' ' -f2 | head -n -1 | xargs rm -rf
>
>
> Even if tidy is not an option, does anyone else have any better ideas than
> my exec?
>
> Thanks in advance
> -Tony
>
> --
> 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/3962a82f-536a-49ef-ad57-ddd872d4ba6f%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/CAOzFSfFCbzkWmvczd%2B-AGLN9z%3Dbw3brkZW1puZtGR2_zkNVDww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Quick start guide problem

2016-03-10 Thread Carthik Sharma
Hi Gerard,

The registry module does not have a registry class by virtue of not having
an `init.pp` file. The quick start guide would need to be updated, and the
docs team is aware of this.

Thanks,
Carthik.

On Thu, Mar 10, 2016 at 4:29 AM, Gerard Forcada  wrote:

> Following Quick start documents on centos 7 clean install, everything
> seems fine, and the module installs OK, but the class definitions cannot be
> updated, web button doesn't work.
>
> So, i cannot find the registry class at the web interface.
>
> Web: Class definitions updated 2 days ago
>
> Console:# puppet module install puppetlabs-registry
> Notice: Preparing to install into
> /etc/puppetlabs/code/environments/production/modules ...
> Notice: Module puppetlabs-registry 1.1.3 is already installed.
>
> What shall i do?
>
> 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/65792c60-af63-40d0-8b46-fdb16e2f79a2%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/CAOzFSfG1%3D1SwBPdEjg5wcjzgUZAoxm%2BQ3JYuKZMNWcVATtX7zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] helloworld

2016-01-20 Thread Carthik Sharma
helloword versus helloworld (missing l) :)

On Wed, Jan 20, 2016 at 8:46 AM, Alex M 
wrote:

> Hi, i have Puppet 3.7.2 on Debian 8.2 x64. I added host Windows Server
> 2012 R2 into Puppet. Now i would like to do test manifest (Forder c:/test/
> : present on WS)
>
> #cat /etc/puppet/modules/helloword/manifests/init.pp
> class helloworld {
> file { 'c:/test/hello.txt':
> content => "Hello World!",
> }
> }
>
>
> # ll /etc/puppet/modules/helloword/manifests/init.pp
> -rw-r--r-- 1 root root 81 Jan 20 17:12 /etc/puppet/modules/helloword/
> manifests/init.pp
>
>
> 
> i run *puppet agent --test* on WS 2012 R2 and receive an error:
>
> C:\>puppet agent --test
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not find class helloworld for test1.domain.company.com on node test1
> .domain.company.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> how i can fix it?
>
> if i disable this manifest:
>
> C:\>puppet agent --test
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Caching catalog for test1.domain.company.com
> Info: Applying configuration version '1453308350'
> Notice: Finished catalog run in 0.08 seconds
>
>
> 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/0c0d7f90-08ba-45c8-94a3-06abdb8afb7e%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/CAOzFSfHM%3DzgmBGoVywfe8qjr5x7wkxxdU2GX%3DoUkHywxzpXeFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet

2015-02-25 Thread Carthik Sharma
This would be a good guide to start with:
https://docs.puppetlabs.com/guides/install_puppet/install_el.html

On Thu, Feb 19, 2015 at 5:03 PM, Chetan Singh 
wrote:

> Hi All,
>
> I am new to this product. Could anyone provide with some guide on how to
> build a puppet in my production environment. I also have a satellite server
> 6 in place.
>
> Thanks
> Chetan
>
> --
> 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/e5e1b61d-e355-41b9-8ad8-c0de9a5b5d5d%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/CAOzFSfE_hGYoRmPzeESceSVF0sQnrrvm-f%2BOAyHUrdSFEvQc%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How to check if file exists on client without using exec command?

2014-10-11 Thread Carthik Sharma
There isn't a built-in function, so I'd write a function, put it in
lib/puppet/parser/functions in your module, enable pluginsync in
puppet.conf (so the custom function get synced to the agents), and then use
the function in the manifest.

Something as simple as:

require"puppet"
module Puppet::Parser::Functions newfunction(:bueller, :type => :rvalue) do
|args|
  File.exists?(args[0])
end

might work. Improve as needed. Consult:
https://docs.puppetlabs.com/guides/custom_functions.html.

Thanks!

On Fri, Oct 10, 2014 at 12:37 PM, Juan Andres Ramirez  wrote:

> One way:
>
> $path
>
> onlyif => "powershell.exe -ExecutionPolicy ByPass -command \"if (Test-Path
> ${path}) { exit 1;}  else { exit 0; }\""
>
> if puppet get exit 0 this finish without any error, so the path exist.
>
> for more info go powershell console and run command get-help test-path
>
>
>
>
> On Friday, October 10, 2014 4:17:04 PM UTC-3, Stella wrote:
>>
>> Hi all,
>>
>> I am using Puppet 3.6.2. I am trying to write a puppet module, which will
>> replace a file with source template ONLY IF this file already exists. If
>> this file doesn't exist, don't do anything.
>>
>> I have got it to work with the "exec" command, but that requires to use
>> some command/script outside of Puppet.
>> I want to find out if Puppet has any built-in function to achieve this
>> purpose?
>> I tried with "replace", but "replace" will create the file if the file
>> doesn't exist. That's not I want.
>>
>> Here is the example "exec" code:
>>
>>   exec {'command when file exists':
>> command => "command to solve the problem",
>> user=> root,
>> onlyif  => "test -f /path/to/file",
>> path=> ['/usr/bin','/usr/sbin','/bin','/sbin'],
>> notify  => Notify['/path/to/file  found'],
>>   }
>>
>>   notify {'/path/to/file not found': }
>>
>>
>> Thanks a lot !
>>
>>  --
> 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/fba2459b-d6ac-48ec-a81b-83086a26245a%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/CAOzFSfHUGoWP153r2HTcznNiUeOh_AQRjPrrpQBPoHxqTcZ7ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.