[Puppet Users] managing users and grants with recent puppetlabs-mysql

2019-01-22 Thread Tim Mooney



All-

I'm using the open source Puppet 5.x platform, with puppetserver 5.3.6
and puppet-agent 5.5.8 on mostly RHEL 6 and 7 (and soon 8, I suppose).

We're long-time users of puppetlabs-mysql, right now we're on the current
latest (7.0.0).

When we started with puppetlabs-mysql, we wrote our database management
puppet classes to use puppetlabs-mysql's mysql_database, mysql_user and
mysql_grant resources directly.  Most of our code still does this.

Recent versions of puppetlabs-mysql have marked those resources as
@api private, though.

There is now a mysql::db define that is part of the public API and
kind of combines all three, but AFAICT it only allows managing one user
for the defined database.  Additional users or complicated grants seem
to be beyond that define.

I guess I'm confused about what the new recommended way is to manage users
and grants with puppetlabs-mysql?

I've searched these forums and the web, and other than an outdated and
now incorrect hit on StackOverflow, I'm not finding information on what
should replace *public* use of mysql_user and mysql_grant.

Thanks,

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure  701-231-1076 (Voice)
Room 242-J6, Quentin Burdick Building  701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
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/alpine.SOC.2.20.1901221818570.1183%40dogbert.cc.ndsu.NoDak.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] relationships, ordering, and defined types

2019-01-22 Thread Matt Zagrabelny
On Tue, Jan 22, 2019 at 4:22 PM Ben Ford  wrote:

> Caps all segments in a defined type name:
>
> before => Bar::Baz['qux'],
>
>
>
Huzzah!

Thanks Ben!

-m

-- 
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/CAOLfK3U-L7%2BjSqMn3iZJ3aUJk%3Dbqr2jjc%2BXXnAJRoKQymJmWYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] relationships, ordering, and defined types

2019-01-22 Thread Ben Ford
Caps all segments in a defined type name:

before => Bar::Baz['qux'],


On Tue, Jan 22, 2019 at 2:20 PM Matt Zagrabelny  wrote:

> Greetings!
>
> I'm running puppet 5.5 on Debian Buster.
>
> This exists:
>
> define bar::baz() {
> file { "/tmp/$name": }
> }
>
> ...somewhere else...
>
> bar::baz { 'qux': }
>
> file { '/tmp/foo':
> before => Bar::baz['qux'],
> }
>
> But when the catalog gets compiled I get an error:
>
> Evaluation Error: Error while evaluating a Resource Statement, Illegal
> class reference
>
> Is it possible to use a defined type with a "before" (or any other
> relationship metaparameter) ?
>
> Thanks!
>
> -m
>
> --
> 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/CAOLfK3V7E47VzhjNSznYTC_UuH%3DK44GsgLuH9y4vnTFy70i5QA%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/CACkW_L6iaXfFhz8%3D4QK2YM0iMufJb8NaicOTvYVGg5LY1%2BhK5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] relationships, ordering, and defined types

2019-01-22 Thread Matt Zagrabelny
Greetings!

I'm running puppet 5.5 on Debian Buster.

This exists:

define bar::baz() {
file { "/tmp/$name": }
}

...somewhere else...

bar::baz { 'qux': }

file { '/tmp/foo':
before => Bar::baz['qux'],
}

But when the catalog gets compiled I get an error:

Evaluation Error: Error while evaluating a Resource Statement, Illegal
class reference

Is it possible to use a defined type with a "before" (or any other
relationship metaparameter) ?

Thanks!

-m

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


[Puppet Users] Re: Use resource only if a tag is given at the command line

2019-01-22 Thread jcbollinger


On Friday, January 18, 2019 at 7:08:21 AM UTC-6, Karsten Heymann wrote:
>
> Hi puppet users,
>
> is there an easy way to enable a resource only if a certain tag is given? 
> Something like "refreshOnly", but for tags? I'm aware of --skip_tags, but 
> that would require us to specify that on every normal run where the 
> resource is not wanted. 
>
>
No, not as such.  The CLI provides for using tags to limit the resources 
applied to a subset of those in the node's catalog, but this does cannot 
cause resources to be included in the catalog that otherwise would not be.  
That does not really fit with the Puppet architecture, for tags are a 
property of *declared* classes and resources.  Or you can look at it as 
tags being class and resource metadata belonging to the catalog in which 
they appear (as opposed to being inherent in the classes and resources 
themselves).  As such, you can manipulate a catalog based on tags once it 
is built, but you cannot use them to cause the catalog to be built 
differently in the first place.  You especially cannot use them to cause a 
resource to be included that ordinarily would not be, because resources 
only have tags on the context of a catalog to which they already have been 
added.

John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cd852bde-324f-41cf-bb26-2b31f661033d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: A GUI tool for Hiera

2019-01-22 Thread desertkun
 

> However, it parses a produced output from puppet-strings 
> 


Excuse me with spam, I actually meant puppet-parser 

 instead.

Regards.


On Tuesday, January 22, 2019 at 3:02:15 PM UTC+2, desertkun wrote:
>
> Fill free to steal it. 
>
> I could try to cut off the AST parser to an external repository so you 
> would be able to mess around with it. For example, it misses a lot of 
> builtin functions 
> 
>   
> at the moment. However, it parses a produced output from puppet-strings 
> 
>  so 
> good luck with that, you'd have to run some ruby with js.
>
>
> On Tuesday, January 22, 2019 at 3:06:34 AM UTC+2, glenn...@puppet.com 
> wrote:
>>
>> This is VERY VERY interesting...
>>
>> I'm one of the people you maintains the VSCode Puppet extension, and 
>> there seems to be some nice cross over here. (I see you develop using 
>> VSCode so hopefully you're aware of it :-) )
>>
>> In particular offering a GUI experience to modifying Hiera data, combined 
>> with the work we've done in undestanding control repos and puppet manifests.
>>
>> Also, it looks like you made a Puppet AST parser in Javascript which is 
>> awesome.  One of my goals would be to create a "NodeJS only" puppet 
>> extension (Cut down version from the full extension) so it could be used by 
>> products like coder.com and one of things I'm missing is a tokeniser/ast 
>> for Puppet language
>>
>> I'll be poking around the codebase for a while and see where we can 
>> integrate this!
>>
>> Thanks,
>> Glenn.
>>
>>
>>
>> On Wednesday, January 9, 2019 at 1:57:50 AM UTC+8, desertkun wrote:
>>>
>>> Hello, everyone.
>>>
>>> I have made a small useful open source project for Puppet/Hiera, so I 
>>> hope you can excuse me a bit of advertisement of it for greater good.
>>>
>>> https://github.com/desertkun/hiera-editor
>>>
>>> Basically it takes editing Hiera configurations to a new level. 
>>> It parses modules with puppet-strings to extract class information like 
>>> field names, types and doc strings, and retrieves default values of class 
>>> fields 
>>> by doing best-effort compilation (with puppet-parser) of Puppet AST on 
>>> your machine. So no more typos and less of "commit-deploy-check" cycles.
>>>
>>>
>>>
>>> The goal of the project is to help manage servers with Puppet to those 
>>> who far away from the back-end, including Puppet itself, 
>>> like "I need to deploy nglinx but I have installed debian for the first 
>>> time". So if you have a project that complex that requires Puppet to deploy 
>>> it, having some
>>> tool to introduce Puppet to end users of your project might improve the 
>>> learning curve.
>>>
>>> Would really appreciate any input on the idea, including concerns like 
>>> "there's no need for this" as I just have made the project public and still 
>>> not sure if I should continue.
>>>
>>> Regards.
>>>
>>

-- 
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/18cbeac9-d5bf-4290-8e8b-a03cc786e102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: A GUI tool for Hiera

2019-01-22 Thread desertkun
Fill free to steal it. 

I could try to cut off the AST parser to an external repository so you 
would be able to mess around with it. For example, it misses a lot of 
builtin functions 

  
at the moment. However, it parses a produced output from puppet-strings 

 so 
good luck with that, you'd have to run some ruby with js.


On Tuesday, January 22, 2019 at 3:06:34 AM UTC+2, glenn...@puppet.com wrote:
>
> This is VERY VERY interesting...
>
> I'm one of the people you maintains the VSCode Puppet extension, and there 
> seems to be some nice cross over here. (I see you develop using VSCode so 
> hopefully you're aware of it :-) )
>
> In particular offering a GUI experience to modifying Hiera data, combined 
> with the work we've done in undestanding control repos and puppet manifests.
>
> Also, it looks like you made a Puppet AST parser in Javascript which is 
> awesome.  One of my goals would be to create a "NodeJS only" puppet 
> extension (Cut down version from the full extension) so it could be used by 
> products like coder.com and one of things I'm missing is a tokeniser/ast 
> for Puppet language
>
> I'll be poking around the codebase for a while and see where we can 
> integrate this!
>
> Thanks,
> Glenn.
>
>
>
> On Wednesday, January 9, 2019 at 1:57:50 AM UTC+8, desertkun wrote:
>>
>> Hello, everyone.
>>
>> I have made a small useful open source project for Puppet/Hiera, so I 
>> hope you can excuse me a bit of advertisement of it for greater good.
>>
>> https://github.com/desertkun/hiera-editor
>>
>> Basically it takes editing Hiera configurations to a new level. 
>> It parses modules with puppet-strings to extract class information like 
>> field names, types and doc strings, and retrieves default values of class 
>> fields 
>> by doing best-effort compilation (with puppet-parser) of Puppet AST on 
>> your machine. So no more typos and less of "commit-deploy-check" cycles.
>>
>>
>>
>> The goal of the project is to help manage servers with Puppet to those 
>> who far away from the back-end, including Puppet itself, 
>> like "I need to deploy nglinx but I have installed debian for the first 
>> time". So if you have a project that complex that requires Puppet to deploy 
>> it, having some
>> tool to introduce Puppet to end users of your project might improve the 
>> learning curve.
>>
>> Would really appreciate any input on the idea, including concerns like 
>> "there's no need for this" as I just have made the project public and still 
>> not sure if I should continue.
>>
>> Regards.
>>
>

-- 
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/cd0a11b1-41cf-4d79-956d-bd02bdf3498c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.