Re: [Puppet Users] Re: Puppet Agent Hang when PuppetServer Crashes...

2018-02-20 Thread Josh Cooper
On Fri, Jan 5, 2018 at 12:31 PM, John Sellens  wrote:

> Hi Josh - thanks for the info.
>
> Can I make an assertion that having the default read timeout be unlimited
> is a mistake?  In practical terms, anything over 60 seconds means
> something is broken.
>

Timeouts are hard. How does the client know 60 seconds is long enough?
Compile times of ~1 min are not unthinkable. Maybe the server is under
heavy load? If the timeout is reached, what should the client do? Retry
(bad idea since it makes the situation worse)... Fail (bad idea if the
server was making progress)...


> Could I suggest (without having to go and update the bug because I'm a
> bad bad lazy person) that along with the watchdog you change the default
> timeout to, say, 5 minutes?  That's effectively infinite, but would
> likely keep things from getting stuck.
>

It's definitely possible for the connection to be lost between the time
that the server responds and when the agent would normally receive the
response. In this half-open scenario, the agent may wait indefinitely, so I
agree having a timeout "less than infinite" makes sense. I'm thinking it
should be strictly less than runinterval, otherwise you could have agent
runs stacking up, and contending for the agent lock.

(I wrote some tools back in the early puppet 3 days to run puppet the
> way I wanted, and of course I included a timeout on the total run time.
> There were some interesting failure modes back in the olden days.)
>

Yeah, "interesting" is one way to put it :) Puppet 2/3 conflated TCP
connect and read timeouts. And it required that the *entire* pluginsync
operation take less than Puppet[:configtimeout] minutes (defaulted to 2),
otherwise the agent would abort the pluginsync operation, even though it
could be making progress downloading individual files (see PUP-2885)!


> Thanks - cheers!
>
> John
>
>
>
> On Fri, 2018/01/05 11:53:12AM -0800, Josh Cooper  wrote:
> | In Puppet 4 we added settings for configuring http connect and read
> | timeouts independently[1]. Previously they were both controlled by the
> | configfiletimeout. The default read timeout is unlimited, so the hung
> agent
> | may be stuck in a socket read. You might want to strace the stuck agent
> to
> | see what it's up to.
> |
> | In our upcoming 4.10.x/5.3.x releases, we've added a watchdog to kill a
> | stuck run[2].
> |
> | Josh
> |
> | [1] https://tickets.puppetlabs.com/browse/PUP-3666
> | [2] https://tickets.puppetlabs.com/browse/PUP-7517
> |
> | --
> | Josh Cooper | Software Engineer
> | j...@puppet.com | @coopjn
> |
>



-- 
Josh Cooper | Software Engineer
j...@puppet.com | @coopjn

-- 
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/CA%2Bu97u%3DCns%2BekXDO1rqQ2TmO1A1kH1JCW0kMtNkViLAHJ8j_Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet 5 upgrade seems to have caused multiple 500 error on server with file resources (to Windows clients)

2018-02-20 Thread Josh Cooper
On Fri, Jan 26, 2018 at 8:28 AM, jmp242  wrote:

> Any idea when the puppet server 5.1.5 will be released as referenced in
> that bug report?
>

Puppetserver 5.1.5 was released January 31, and should resolve issues when
serving files whose paths contain URI special characters:
https://puppet.com/docs/puppetserver/5.2/release_notes.html#bug-fixes-1.


>
>
> On Tuesday, January 16, 2018 at 7:16:53 PM UTC-5, Josh Cooper wrote:
>>
>>
>>
>> On Tue, Jan 16, 2018 at 11:08 AM, jmp242  wrote:
>>
>>> We serve multiple file resources depending on configuration via puppet
>>> to Windows 7 and Windows 10 workstations using FLOSS puppet. This was
>>> working with puppet agent 1.10.4 on clients and with puppet server (and
>>> foreman fwiw) 4 on Scientific Linux 7.4. Since we upgraded puppet server to
>>> 5.latest we started having issues with deploying certain, random but
>>> consistent file resources that had worked on the earlier version. In the
>>> logs we see various Error 500 messages - but they all seem to be blank
>>> (i.e. no further info than: Failed to generate additional resources using
>>> 'eval_generate': Error 500 on SERVER: Server Error) or not googleable. The
>>> files are still there and permissions look the same to me on the server.
>>> The manifest code hasn't changed. What's weirder is it seems like some file
>>> resources served like this are working.
>>>
>>> This problem is most prevalent with files served as a defined type so I
>>> wonder if something happened around that?
>>> file { "DesignData-${title}":
>>> path=> "C:/VaultWorkspace/${title}/Vault/Design Data",
>>> source  => "puppet:///modules/inventor/Design Data",
>>> recurse => true,
>>> purge   => true,
>>> ensure  => present,
>>>   }
>>>
>>> Example defined type that's now failing with the above... We feed in an
>>> array of users and that's still being parsed correctly - logs show things
>>> like:
>>> //pc5102//Stage[main]/Inventor/Inventor::Designdata[username1]/File[DesignData-username1]
>>> :
>>> Failed to generate additional resources using 'eval_generate': Error 500
>>> on SERVER: Server Error
>>>
>>>
>>>
>> I think you're running into https://tickets.puppetlabs.com
>> /browse/SERVER-1954, which affects puppetserver 5.x and up. There was a
>> change in behavior in the bidi library we use, which breaks serving files
>> with URL special characters like spaces. So high likelihood of breaking
>> Windows agents.
>>
>>
>>> One other place that seems like a related file serving issue to me
>>> anyway is that I have an updated module to test (a forked reboot module)
>>> which I have deployed in my dev environment and code to use the new
>>> parameter, however when I try and apply the manifest I get errors - again
>>> 500 on server, this time that the new parameter doesn't exist. I'm
>>> wondering if this is also an issue with pluginsync or something like that
>>> so the client doesn't see the new module?
>>>
>>
>> That sounds like a lack of environment isolation issue on the compile
>> master. See https://puppet.com/docs/puppet/5.3/environment_isolation.html
>> .
>>
>>
>>>
>>> Any ideas as to what's gone wrong in the update?
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/puppet-users/175349a2-26e3-40e1-b8f7-03e50a302919%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Josh Cooper | Software Engineer
>> jo...@puppet.com | @coopjn
>>
> --
> 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/e86e0df2-3a55-4e0d-9bc3-8e3930198abd%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Josh Cooper | Software Engineer
j...@puppet.com | @coopjn

-- 
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/CA%2Bu97ukjaTTgrMqQKo6Ao-zhJfH%2BL7Wv1JRV5T4ys92ekpLd4A%40mail.gmail.com.
For more options, visit 

Re: [Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Christopher Wood
Taking a stab at this...

The puppet parser will always be the authoritative source for one's puppet code 
validation since that is what will be parsing the code via agent or server. It 
will introduce any number of bugs and inconsistencies and delay to have 
puppet-lint keep up with what puppet does anyway.

However!

You do not need to check this all manually every time you commit. There are 
tools which wrap these commands that you can set up to do this automatically.

You can use puppet-git hooks to have all these checks performed right before a 
git commit is applied. Even better, you can set this up on the server side so 
that people are incapable of pushing risible crud to your main git repository.

https://github.com/drwahl/puppet-git-hooks

Under the hood, PDK uses puppet and puppet-lint and gives you the chance to add 
specification testing. I have this set up in our gitlab instance to run "pdk 
validate" and "pdk test unit" on every module we've run through "pdk convert". 
(You can likely have this one in a pre-commit hook too, haven't done that 
here.) We had some training/implementation sort of workshops and people were 
able to get some very basic tests done in their first time using PDK which was 
pleasant.

https://puppet.com/docs/pdk/1.x/pdk_install.html


On Tue, Feb 20, 2018 at 10:51:07PM +0100, Albert Shih wrote:
>  20/02/2018 à 14:01:23+0100, Maria Elena a écrit
> > Hi Albert,
> > maybe cause puppet-lint checks only style (http://puppet-lint.com/).
> > Regards.
> 
> You're perfectly right. But in fact I'm not very good in english, so I will
> rephrase...
> 
> Can puppet-lint check also the syntax ? So we don't need to launch two
> thing
> 
>   puppet parser validate
> 
> and
> 
>   puppet-lint
> 
> that would be much easier.
> 
> Regards.
> 
> JAS
> 
> > Hi everyone,
> >
> > I'm wonder why puppet-lint don't show any syntax error.
> >
> > For example I just delete a "," at the end of a line and
> >
> > [root@io manifests]$ puppet-lint init.pp
> > [root@io manifests]$ puppet parser validate init.pp Error: Could not 
> > parse
> > for environment production: Syntax error at 'Boolean' (file: /home/jas/
> > Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3)
> > [root@io manifests]$
> >
> > puppet-lint seem to be a very powerfull tool. I don't understand why he
> > cannot complain when something very simple like a missing comma cannot 
> > be
> > detected.
> >
> --
> Albert SHIH
> xmpp: j...@obspm.fr
> Heure local/Local time:
> Tue Feb 20 22:49:11 CET 2018
> 
> -- 
> 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/20180220215107.GC1284%40io.chezmoi.fr.
> 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/20180220221751.txygrxov4g3ye56z%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Albert Shih
 20/02/2018 à 14:01:23+0100, Maria Elena a écrit
> Hi Albert,
> maybe cause puppet-lint checks only style (http://puppet-lint.com/).
> Regards.

You're perfectly right. But in fact I'm not very good in english, so I will
rephrase...

Can puppet-lint check also the syntax ? So we don't need to launch two
thing

  puppet parser validate

and

  puppet-lint

that would be much easier.

Regards.

JAS

> Hi everyone,
>
> I'm wonder why puppet-lint don't show any syntax error.
>
> For example I just delete a "," at the end of a line and
>
> [root@io manifests]$ puppet-lint init.pp
> [root@io manifests]$ puppet parser validate init.pp Error: Could not parse
> for environment production: Syntax error at 'Boolean' (file: /home/jas/
> Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3)
> [root@io manifests]$
>
> puppet-lint seem to be a very powerfull tool. I don't understand why he
> cannot complain when something very simple like a missing comma cannot be
> detected.
>
--
Albert SHIH
xmpp: j...@obspm.fr
Heure local/Local time:
Tue Feb 20 22:49:11 CET 2018

-- 
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/20180220215107.GC1284%40io.chezmoi.fr.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet5-nightly repos coming soon to nightlies.puppet.com!

2018-02-20 Thread Molly Waggett
Hey Puppet Users!

puppet5 nightlies are finally live at nightlies.puppet.com!

We've done our best to make this transition smooth, but if you run into
issues or have any questions, please let us know!

Thanks!


On Tue, Jan 2, 2018 at 11:25 AM, Molly Waggett 
wrote:

> Hello Puppet Users!
>
> We are excited to announce new and improved puppet5-nightly and
> puppet-nightly package repositories, which will be rolling out mid-January!
>
> The puppet5-nightly repo will always contain the latest dev builds from
> components of Puppet Platform 5 (puppet-agent, puppetserver, and puppetdb),
> while puppet-nightly will contain the latest dev builds for the latest
> Puppet Platform major version. In other words, puppet-nightly will contain
> Platform 6, 7, etc. builds when they are released, but puppet5-nightly will
> not go beyond Platform 5.
>
> Previously, nightlies were spread across apt.puppetlabs.com,
> yum.puppetlabs.com, and downloads.puppetlabs.com. With this change, we
> will consolidate all of the nightly builds in one place:
> nightlies.puppet.com. Builds that currently exist on nightlies.puppet.com
> will be replaced with these new nightly builds. If you have already
> downloaded nightly release packages, you will need to replace them with one
> pointing at the new location.
>
> In general, nightly builds will be purged after 30 days.
>
> If you have any questions, please let me know!
>
> Thanks!
>
> --
> *Molly Waggett*
> Assoc. Release Engineer
>



-- 
*Molly Waggett*
she/her/hers
Release Engineer @ 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/CAFOE68DPsOHv0Y%2BOFhofSLm2CWBT-HgsWwf2Y8rQZ%3Dg9%2BRkXrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] unit tests failing on augeas resources in defined type

2018-02-20 Thread Bill Sirinek

I am continuing to work on unit tests for modules using PDK, and am having 
issues with the augeas resources.
I added rspec-puppet-augeas to my Gemfile.local and pdk installed it, so 
that part is fine.

However, when I run the unit tests, the augeas resource fails. I tried this 
on both my laptop running OSX 10.12.6, and on a RHEL 7.3 host, both with 
the same PDK version (1.3.2) and rspec-puppet-augeas gem (0.4.0)

I am doing these tests as myself, and not as root. I get errors because 
something is trying to chown a file's owner to 0. My resource isn't 
managing the owner/group/permissions of the file.

*RHEL output:*

bsirinek@rhelhost $ pdk test unit
[✔] Preparing to run the unit tests.
[✖] Running unit tests.
  Evaluated 12 tests in 1.396288548 seconds: 1 failures, 0 pending.
[✔] Cleaning up after running unit tests.
failed: rspec: ./spec/defines/etc_system_solaris_kernel_parameter_spec.rb:24
: Got 2 failure(s) while initializing: File[/tmp/d20180220-14426-bbcvri]: 
change from 'absent' to 'directory' failed: Failed to set owner to '0': 
Operation not permitted @ chown_internal - /tmp/d20180220-14426-bbcvri; File
[/tmp/d20180220-14426-129ojbn/ssl]: change from 'absent' to 'directory' 
failed: Failed to set owner to '0': Operation not permitted @ 
chown_internal - /tmp/d20180220-14426-129ojbn/ssl
  etc_system::solaris_kernel_parameter Augeas[ip_squeue_enter] should run
  Failure/Error:
}
  }
  it "should run" do
is_expected.to compile
is_expected.to contain_etc_system__solaris_kernel_parameter(
'ip_squeue_enter').with('variable' => 'ip_squeue_enter', 'value' => '4', 
'operator' => '=', 'module' => 'ip')




*OSX output:*

macbook:etc_system bsirinek$ pdk test unit
[✔] Preparing to run the unit tests.
[✖] Running unit tests.
  Evaluated 12 tests in 2.153173 seconds: 1 failures, 0 pending.
[✔] Cleaning up after running unit tests.
failed: rspec: ./spec/defines/etc_system_solaris_kernel_parameter_spec.rb:24
: Got 2 failure(s) while initializing: File[/var/folders/vh/58bqgt717s1
_xvljwqs5cz8jf0n1fx/T/d20180220-31763-cbt2p1]: change from 'absent' to 
'directory' failed: Failed to set owner to '0': Operation not permitted @ 
chown_internal - /var/folders/vh/58bqgt717s1_xvljwqs5cz8jf0n1fx/T/d20180220-
31763-cbt2p1; File[/var/folders/vh/58bqgt717s1_xvljwqs5cz8jf0n1fx/T/
d20180220-31763-gjico7/ssl]: change from 'absent' to 'directory' failed: 
Failed to set owner to '0': Operation not permitted @ chown_internal - /var/
folders/vh/58bqgt717s1_xvljwqs5cz8jf0n1fx/T/d20180220-31763-gjico7/ssl
  etc_system::solaris_kernel_parameter Augeas[ip_squeue_enter] should run
  Failure/Error:
}
  }
  it "should run" do
is_expected.to compile





*Resource:*

define etc_system::solaris_kernel_parameter(
  $variable = $title,
  $module = false,
  $operator = '=',
  $value = 0
) {


  augeas { $variable:
incl=> '/etc/system',
lens=> 'Solaris_System.lns',
changes => [
  "rm set[./variable='${variable}']",
  "set set[./variable='${variable}']/variable \'${variable}\'",
  "ins module before set[./variable='${variable}']/variable",
  "set set[./variable='${variable}']/module \'${module}\'",
  "set set[./variable='${variable}']/operator \'${operator}\'",
  "set set[./variable='${variable}']/value \'${value}\'"
],
onlyif  => "get set[./variable='${variable}']/value != \"${value}\"",
  }
}


*spec/defines/etc_system_solaris_kernel_parameter_spec.rb:*

require 'spec_helper'


describe "etc_system::solaris_kernel_parameter" do
let(:title) { 'ip_squeue_enter' }
let(:params) {
  {
:value => '4',
:module => 'ip'
  }
}
  it "has an augeas resource" do
  should contain_augeas("ip_squeue_enter")
  end


  describe_augeas "ip_squeue_enter", :lens => 'Solaris_System', :target => 
'etc/system' do
let(:title) { 'ip_squeue_enter' }


let(:params) {
  {
:value => '4',
:module => 'ip'
  }
}
it "should run" do
  is_expected.to compile
  is_expected.to contain_etc_system__solaris_kernel_parameter(
'ip_squeue_enter').with('variable' => 'ip_squeue_enter', 'value' => '4', 
'operator' => '=', 'module' => 'ip')
  should execute.with_change
  aug_get("set[./variable='ip_squeue_enter']/value").should == "4"
  should execute.idempotently
end
  end
end



Any help is greatly appreciated!

Thanks

Bill



-- 
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/ae8bfe8a-3df4-462d-a1c6-2e5809c39911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Announce: Puppet Platform 5.4.0 is now available

2018-02-20 Thread Melissa Stone
Thank you for bringing this up, Chuck. We'll start investigating it now.

On Mon, Feb 19, 2018 at 12:00 PM Chuck  wrote:

> Breaking ticket: https://tickets.puppetlabs.com/browse/PUP-8223
>
> New ticket: https://tickets.puppetlabs.com/browse/PUP-8470
>
> Error: UID 900 already exists, use allowdupe to force user creation
> Error: /Stage[main]/Localusers::Identities/User[user1]/groups: change
> from  to 'group1,group2' failed: UID 900 already exists, use allowdupe to
> force user creation
>
>
> So far I have found two issues.
>
> 1) lusermod does not support -G
>
> # lusermod --help
> Usage: lusermod [OPTION...] user
>   -i, --interactive  prompt for all information
>   -c, --gecos=STRING GECOS information
>   -d, --directory=STRING home directory
>   -m, --movedirectorymove home directory contents
>   -s, --shell=STRING set shell for user
>   -u, --uid=NUM  set UID for user
>   -g, --gid=NUM  set primary GID for user
>   -l, --login=STRING change login name for user
>   -P, --plainpassword=STRING plaintext password for the user
>   -p, --password=STRING  pre-hashed password for the user
>   -L, --lock lock account
>   -U, --unlock   unlock account
>   --commonname=STRINGset common name for user
>   --givenname=STRING set given name for user
>   --surname=STRING   set surname for user
>   --roomnumber=STRINGset room number for user
>   --telephonenumber=STRING   set telephone number for user
>   --homephone=STRING set home telephone number for user
>
> Help options:
>   -?, --help Show this help message
>   --usageDisplay brief usage message
>
> 2) the new code will not "modify" the user's groups in /etc/group because
> the user already exists.
>
> --
> 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/6359c0b6-b47f-472c-a97f-9b14712d64fb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
*Melissa Stone*
software engineer
meli...@puppet.com | @melissaapiedra

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


Re: [Puppet Users] Puppet 5 tests of forked module gives errors

2018-02-20 Thread Henrik Lindberg

On 19/02/18 14:36, jmp242 wrote:
I've been on that page, but it doesn't really tell me what to do. I'm 
not using r10k, nor pe. I don't have a |.resource_types directory 
pro|bably because I can't get the isolation to do anything.


Probably. The .resource_types is created if needed by the command
if there are something to write.

Check that your environments are where you expect them to be and that 
they have the correct modulepath and that all modules are where they are 
supposed to be.
You could experiment with the setting for environmentpath (one or 
several directories that puppet will search for environment directories).


Best,
- henrik


On Monday, February 19, 2018 at 7:51:24 AM UTC-5, David Schmitt wrote:

Have a look at
https://puppet.com/docs/puppet/5.3/environment_isolation.html#generate-types


and the surrounding docs.

On Fri, Feb 16, 2018 at 8:42 PM jmp242  wrote:

So I originally conflated 2 different issues, and the one was
fixed with the bugfix referenced in my previous thread. So this
one is still happening.

I have an updated module to test (a forked reboot module) which
I have deployed in my dev environment and code to use the new
parameter, however when I try and apply the manifest I get
errors - again 500 on server, this time that the new parameter
doesn't exist. I'm wondering if this is also an issue with
pluginsync or something like that so the client doesn't see the
new module?

So it was suggested that I needed environment isolation per:
https://puppet.com/docs/puppet/5.3/environment_isolation.html


I tried it and got:
|
puppet generate types --environment production
Notice:Nocustom types were found.
|


|
puppet generate types --environment dev

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in`get!':
Could not find a directory environment named 'dev' anywhere in
the path: /etc/puppetlabs/code. Does the directory exist?
(Puppet::Environments::EnvironmentNotFound)
         from

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in
`push_application_context'
         from
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:346:in
`run'

from/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in`run'
         from

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in
`execute'
         from /opt/puppetlabs/puppet/bin/puppet:5:in `'
|

So:
|
ll /etc/puppetlabs/code
total 0
drwxr-xr-x 4root root 35Nov204:12environments
drwxr-xr-x 2root root 6Nov204:12modules
drwxr-xr-x 3root root 29Feb1615:33production
|

Now all our modules are in what used to be called directory
environments, as sub directories of environments.
|
ll /etc/puppetlabs/code/production/
total 0

ll /etc/puppetlabs/code/environments/
total 0
drwxr-xr-x 4root root 38Nov1515:43dev
drwxr-xr-x 6root root 93Dec2111:36production

|

So I'm pretty confused how to fix all of this.

-- 
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 .
To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/553bda68-7d45-447e-b4fd-890af7ce47df%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout
.

-- 
Cheers, David


https://twitter.com/dev_el_ops

--
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/fbe255a3-4830-4b1e-aeee-b4a32fc7c786%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Re: [Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Maria Elena
Hi Albert,
maybe cause puppet-lint checks only style (http://puppet-lint.com/).
Regards.
M.E.


On Tue, Feb 20, 2018 at 1:53 PM, Albert Shih  wrote:

> Hi everyone,
>
> I'm wonder why puppet-lint don't show any syntax error.
>
> For example I just delete a "," at the end of a line and
>
> [root@io manifests]$ puppet-lint init.pp
> [root@io manifests]$ puppet parser validate init.pp Error: Could not
> parse for environment production: Syntax error at 'Boolean' (file:
> /home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19,
> column: 3)
> [root@io manifests]$
>
> puppet-lint seem to be a very powerfull tool. I don't understand why he
> cannot complain when something very simple like a missing comma cannot be
> detected.
>
> Regards.
> --
> Albert SHIH
> Heure local/Local time:
> Tue Feb 20 13:49:31 CET 2018
>
> --
> 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/20180220125301.GJ5491%40io.chezmoi.fr.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
PGP Public key:
http://pgp.mit.edu:11371/pks/lookup?op=get=0x34977A00

-- 
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/CAJ%3DTY9eeyXJfg2Qg-i2a%2BBhuNBY0-%2BhGhtgtUePGAAinkfZHzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Albert Shih
Le 20/02/2018 à 14:00:04+0100, Martin Alfke a écrit
Hi,

>
> some lint checks are not available in lint core, but are within a lint plugin.
> In your case check: 
> https://github.com/voxpupuli/puppet-lint-trailing_comma-check.git
>
> Complete list can be found on voxpupuli: 
> https://voxpupuli.org/plugins/#puppet-lint

Thanks.

But well the comma was just a example. The point is puppet-lint are (IMHO)
very powerfull tool, why he cannot integrate the «puppet parser» feature ?
Like rubocop does for ruby ?

Regards.
--
Albert SHIH
xmpp: j...@obspm.fr
Heure local/Local time:
Tue Feb 20 14:11:38 CET 2018

-- 
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/20180220131313.GK5491%40io.chezmoi.fr.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Martin Alfke
Hi Albert,

some lint checks are not available in lint core, but are within a lint plugin.
In your case check: 
https://github.com/voxpupuli/puppet-lint-trailing_comma-check.git

Complete list can be found on voxpupuli: 
https://voxpupuli.org/plugins/#puppet-lint

Best,
Martin


> On 20. Feb 2018, at 13:53, Albert Shih  wrote:
> 
> Hi everyone,
> 
> I'm wonder why puppet-lint don't show any syntax error.
> 
> For example I just delete a "," at the end of a line and
> 
> [root@io manifests]$ puppet-lint init.pp
> [root@io manifests]$ puppet parser validate init.pp Error: Could not parse 
> for environment production: Syntax error at 'Boolean' (file: 
> /home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 
> 3)
> [root@io manifests]$
> 
> puppet-lint seem to be a very powerfull tool. I don't understand why he
> cannot complain when something very simple like a missing comma cannot be
> detected.
> 
> Regards.
> --
> Albert SHIH
> Heure local/Local time:
> Tue Feb 20 13:49:31 CET 2018
> 
> -- 
> 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/20180220125301.GJ5491%40io.chezmoi.fr.
> 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/3AFFFB60-C79E-4F02-9501-20EFD62CAE20%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet-lint & Syntax

2018-02-20 Thread Albert Shih
Hi everyone,

I'm wonder why puppet-lint don't show any syntax error.

For example I just delete a "," at the end of a line and

[root@io manifests]$ puppet-lint init.pp
[root@io manifests]$ puppet parser validate init.pp Error: Could not parse for 
environment production: Syntax error at 'Boolean' (file: 
/home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3)
[root@io manifests]$

puppet-lint seem to be a very powerfull tool. I don't understand why he
cannot complain when something very simple like a missing comma cannot be
detected.

Regards.
--
Albert SHIH
Heure local/Local time:
Tue Feb 20 13:49:31 CET 2018

-- 
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/20180220125301.GJ5491%40io.chezmoi.fr.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 5 tests of forked module gives errors

2018-02-20 Thread David Schmitt
Apologies, I linked you to the wrong section in that document. You need to
run puppet generate types --environment  for each of your
environments. For example, to generate metadata for your production
environment, run: puppet generate types --environment production. And you
need to run this every time you deploy new code to your master.

Cheers, David

On Mon, Feb 19, 2018 at 1:36 PM jmp242  wrote:

> I've been on that page, but it doesn't really tell me what to do. I'm not
> using r10k, nor pe. I don't have a .resource_types directory probably
> because I can't get the isolation to do anything.
> On Monday, February 19, 2018 at 7:51:24 AM UTC-5, David Schmitt wrote:
>
>> Have a look at
>> https://puppet.com/docs/puppet/5.3/environment_isolation.html#generate-types
>> and the surrounding docs.
>>
>> On Fri, Feb 16, 2018 at 8:42 PM jmp242  wrote:
>>
> So I originally conflated 2 different issues, and the one was fixed with
>>> the bugfix referenced in my previous thread. So this one is still happening.
>>>
>>> I have an updated module to test (a forked reboot module) which I have
>>> deployed in my dev environment and code to use the new parameter, however
>>> when I try and apply the manifest I get errors - again 500 on server, this
>>> time that the new parameter doesn't exist. I'm wondering if this is also an
>>> issue with pluginsync or something like that so the client doesn't see the
>>> new module?
>>>
>>> So it was suggested that I needed environment isolation per:
>>> https://puppet.com/docs/puppet/5.3/environment_isolation.html
>>>
>>> I tried it and got:
>>> puppet generate types --environment production
>>> Notice: No custom types were found.
>>>
>>>
>>> puppet generate types --environment dev
>>> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in 
>>> `get!':
>>> Could not find a directory environment named 'dev' anywhere in the path:
>>> /etc/puppetlabs/code. Does the directory exist?
>>> (Puppet::Environments::EnvironmentNotFound)
>>> from
>>> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in
>>> `push_application_context'
>>> from
>>> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:346:in
>>> `run'
>>> from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/
>>> command_line.rb:132:in `run'
>>> from
>>> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in
>>> `execute'
>>> from /opt/puppetlabs/puppet/bin/puppet:5:in `'
>>>
>>> So:
>>> ll /etc/puppetlabs/code
>>> total 0
>>> drwxr-xr-x 4 root root 35 Nov  2 04:12 environments
>>> drwxr-xr-x 2 root root  6 Nov  2 04:12 modules
>>> drwxr-xr-x 3 root root 29 Feb 16 15:33 production
>>>
>>> Now all our modules are in what used to be called directory
>>> environments, as sub directories of environments.
>>> ll /etc/puppetlabs/code/production/
>>> total 0
>>>
>>> ll /etc/puppetlabs/code/environments/
>>> total 0
>>> drwxr-xr-x 4 root root 38 Nov 15 15:43 dev
>>> drwxr-xr-x 6 root root 93 Dec 21 11:36 production
>>>
>>>
>>> So I'm pretty confused how to fix all of this.
>>>
>>> --
>>> 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.
>>
>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/553bda68-7d45-447e-b4fd-890af7ce47df%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> Cheers, David
>>
>> https://twitter.com/dev_el_ops
>>
> --
> 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/fbe255a3-4830-4b1e-aeee-b4a32fc7c786%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Cheers, David

https://twitter.com/dev_el_ops

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