Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Systems Provisioning
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 32 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Douglas Garstang  
View profile  
 More options Sep 16 2012, 2:22 am
From: Douglas Garstang <doug.garst...@gmail.com>
Date: Sat, 15 Sep 2012 23:21:58 -0700
Local: Sun, Sep 16 2012 2:21 am
Subject: Systems Provisioning
I'm wondering what people are doing systems provisioning with, ie the
process that gets puppet installed onto a system, running for the
first time, and also the handling of certificate signing and so forth.
I don't see this topic discussed much.

The mc-provision tools at
https://github.com/ripienaar/mcollective-server-provisioner don't seem
to be actively developed anymore, or at least I wasn't able to find
enough documentation to be able to effectively make use of it.

Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James A. Peltier  
View profile  
 More options Sep 16 2012, 4:55 am
From: "James A. Peltier" <jpelt...@sfu.ca>
Date: Sun, 16 Sep 2012 01:55:43 -0700 (PDT)
Local: Sun, Sep 16 2012 4:55 am
Subject: Re: [Puppet Users] Systems Provisioning


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dick Davies  
View profile  
 More options Sep 16 2012, 5:32 am
From: Dick Davies <rasput...@hellooperator.net>
Date: Sun, 16 Sep 2012 10:31:54 +0100
Local: Sun, Sep 16 2012 5:31 am
Subject: Re: [Puppet Users] Systems Provisioning
We use Cobbler for our Centos/RHEL kickstarts (around 150+ nodes, mainly VMs)
and a very simple .ks that adds puppetd. on first boot it starts up
and we manually
sign the CSR on the puppet master.

Historically, we didn't want tight integration between provisioning and CM as we
were new to both and if one turned out to be a lemon we didn't want to have to
abandon both.

We only provision a few nodes a day max. so that works ok. Lately I've been
thinking of replacing Cobbler with The Foreman, which has better
Puppet integration.
(our team are happy with editing nodes.pp and Hiera and have never
really needed anything
like advanced storeconfig etc. but we build a lot of servers for
external teams and being
able to expose config options etc. is the real driver for Foreman).

On 16 September 2012 07:21, Douglas Garstang <doug.garst...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dom  
View profile  
 More options Sep 16 2012, 11:10 am
From: Dom <domenick.petre...@gmail.com>
Date: Sun, 16 Sep 2012 08:10:14 -0700 (PDT)
Local: Sun, Sep 16 2012 11:10 am
Subject: Re: Systems Provisioning

We're doing a simple combination of PXE boot, kickstart, and internal
repos, which then hands off to puppet.  We also use some rvc for vmware
provisioning, which is mostly what happens in our environment.

Not many people appear to be talking about razor<https://github.com/puppetlabs/Razor/wiki>.
 That, plus puppetdb, seems to offer a way to better handle bare metal
provisioning and inventory.  Since we're getting into hadoop for a couple
projects which will use a collection of bare metal, it looks compelling,
but we haven't used it yet.

-Domenick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Sep 16 2012, 5:25 pm
From: Jakov Sosic <jso...@srce.hr>
Date: Sun, 16 Sep 2012 23:25:34 +0200
Local: Sun, Sep 16 2012 5:25 pm
Subject: Re: [Puppet Users] Systems Provisioning
On 09/16/2012 11:31 AM, Dick Davies wrote:

> We use Cobbler for our Centos/RHEL kickstarts (around 150+ nodes, mainly VMs)
> and a very simple .ks that adds puppetd. on first boot it starts up
> and we manually sign the CSR on the puppet master.

+1

except that we allow autosigning from certain subnets.

> Historically, we didn't want tight integration between provisioning and CM as we
> were new to both and if one turned out to be a lemon we didn't want to have to
> abandon both.

We started with both together at the same time :)

> We only provision a few nodes a day max. so that works ok. Lately I've been
> thinking of replacing Cobbler with The Foreman, which has better
> Puppet integration.

What does foreman provide better than cobbler?

--
Jakov Sosic
www.srce.unizg.hr


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keiran Sweet  
View profile  
 More options Sep 17 2012, 9:25 am
From: Keiran Sweet <kei...@gmail.com>
Date: Mon, 17 Sep 2012 06:25:22 -0700 (PDT)
Local: Mon, Sep 17 2012 9:25 am
Subject: Re: Systems Provisioning

Hi There,
I manage a relatively large RHEL environment, we handle provisioning as
follows:

- PXE + Kickstart to bootstrap and install the base OS + Puppet client onto
the platform, be it VMWare or bare metal
- Kickstart post scripts put a basic puppet configuration file in place on
the host, and a number of the values for things such as environment and
puppetmaster come from Foreman's Macro's, this allows values in the ENC to
flow into the kickstart files before your first puppet run.

We then run in the %post section of the kickstart file the following:
- A Puppet run that bootstraps the puppet client using tags ie,  --tags
puppet::client
- A full puppet run via puppet agent -tov which applys the SOE to the
platform

That provides on first boot a fully configured RHEL server that includes
all our additional software and customisations in about 3-5 minutes (not
including POST)

In regards to certs, we have a relatively open autosign.conf on our build
networks, so we can provision servers , physical or virtual quite quickly
by just hitting F12 for a network boot. I am sure there are some
cleaner/more secure things we can do provisioning wise, however these have
been slightly hindered by the RHN Satellite server i've been slowly pulling
out of the environment at the same time, as it had the potential to break
things if i wasnt careful.

ENC wise, I can't recommend Foreman enough, version 1.x is just brilliant,
you can see the macros it can provide here:  
http://theforeman.org/projects/foreman/wiki/TemplateWriting

Hope this helps,

K


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Poston  
View profile  
 More options Sep 17 2012, 4:37 pm
From: Glenn Poston <gposton1...@gmail.com>
Date: Mon, 17 Sep 2012 13:37:03 -0700 (PDT)
Local: Mon, Sep 17 2012 4:37 pm
Subject: Re: Systems Provisioning

Similar setup here:  pxe boot, etc.  but we keep a pxe booted sparse base image available to clone.  And use a script to to do the clone so that we can provision more quickly (saves us the pxe boot time).  The script also interacts with puppet dashboard to set the machine role.  We can provision a new machine in less than 4 minutes.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Douglas Garstang  
View profile  
 More options Sep 17 2012, 2:16 pm
From: Douglas Garstang <doug.garst...@gmail.com>
Date: Mon, 17 Sep 2012 11:16:02 -0700
Local: Mon, Sep 17 2012 2:16 pm
Subject: Re: [Puppet Users] Re: Systems Provisioning
I probably should have been clearer with my question. I was more
interested in how people are managing certificates? Even if you use
autosign, you still need to clean certificates manually.

Doug.

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cell: +1-805-340-5627


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Bigum  
View profile  
 More options Sep 18 2012, 8:01 am
From: Luke Bigum <Luke.Bi...@lmax.com>
Date: Tue, 18 Sep 2012 13:01:38 +0100
Local: Tues, Sep 18 2012 8:01 am
Subject: Re: [Puppet Users] Re: Systems Provisioning
If you want the least amount of headache at the cost of security, here
is a sanitised extract from my kickstarts:

#LB: attempt to revoke and delete the certificate for this hostname, this should stop us having
#to manually clean off every cert.
curl -k -X PUT -H "Content-Type: text/pson" --data '{"desired_state":"revoked"}' https://puppet:8140/production/certificate_status/$HOSTNAME
curl -k -X DELETE -H "Accept: pson" https://puppet:8140/production/certificate_status/$HOSTNAME
#LB: run Puppet, our hostname should be set correctly by now
puppet agent --test --pluginsync --report --environment testing

You will need this in auth.conf on your master:

#allow hosts to delete their own certificates
#path /certificate_status/([^/]+)$
path ~ /certificate_status/([^/]+)$
auth any
allow $1

Hope that helps,

-Luke

On 17/09/12 19:16, Douglas Garstang wrote:

--
Luke Bigum
Senior Systems Engineer

Information Systems
Ph: +44 (0) 20 3192 2520
luke.bi...@lmax.com | http://www.lmax.com
LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN

FX and CFDs are leveraged products that can result in losses exceeding
your deposit.  They are not suitable for everyone so please ensure you
fully understand the risks involved.  The information in this email is not
directed at residents of the United States of America or any other
jurisdiction where trading in CFDs and/or FX is restricted or prohibited
by local laws or regulations.

The information in this email and any attachment is confidential and is
intended only for the named recipient(s). The email may not be disclosed
or used by any person other than the addressee, nor may it be copied in
any way. If you are not the intended recipient please notify the sender
immediately and delete any copies of this message. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is
strictly forbidden.

LMAX operates a multilateral trading facility.  Authorised and regulated
by the Financial Services Authority (firm registration number 509778) and
is registered in England and Wales (number 06505809).
Our registered address is Yellow Building, 1A Nicholas Road, London, W11
4AN.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Bukowinski  
View profile  
 More options Sep 18 2012, 9:11 am
From: Peter Bukowinski <pmb...@gmail.com>
Date: Tue, 18 Sep 2012 09:11:38 -0400
Local: Tues, Sep 18 2012 9:11 am
Subject: Re: [Puppet Users] Re: Systems Provisioning
On Sep 17, 2012, at 2:16 PM, Douglas Garstang wrote:

> I probably should have been clearer with my question. I was more
> interested in how people are managing certificates? Even if you use
> autosign, you still need to clean certificates manually.

> Doug.

Doug,

We autosign certs for hosts in our datacenter (based on the subdomain wildcard *.domain.org) and manually sign certs for desktops. All our datacenterhosts are set to try network booting first, so it's easy to redeploy any of them at any time. I wrote a re/deployment script that automates all the necessary deployment steps for linux hosts in our datacenter:

  1. It lists the available PXE configs and links the
     host's address to the one you select.
  2. It reboots the host using ipmi.
  3. It schedules the removal of the PXE link (so the
     host doesn't stay in a permanent install cycle.)
  4. It cleans the host's existing puppet cert.

I have this script up on github, if you want to see how I'm doing it. It pushes the limits of bash sanity, but it works well.

https://github.com/pmbuko/misc-scripts/blob/master/deployserv.sh

--
Peter Bukowinski


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
R.I.Pienaar  
View profile  
 More options Sep 18 2012, 11:13 am
From: "R.I.Pienaar" <r...@devco.net>
Date: Tue, 18 Sep 2012 16:13:46 +0100 (BST)
Local: Tues, Sep 18 2012 11:13 am
Subject: Re: [Puppet Users] Re: Systems Provisioning

----- Original Message -----
> From: "Douglas Garstang" <doug.garst...@gmail.com>
> To: puppet-users@googlegroups.com
> Sent: Monday, September 17, 2012 7:16:02 PM
> Subject: Re: [Puppet Users] Re: Systems Provisioning

> I probably should have been clearer with my question. I was more
> interested in how people are managing certificates? Even if you use
> autosign, you still need to clean certificates manually.

so maybe the question is what would your desired behavior be?
what happens with certificates really is a site specific question
influenced by policy, deployment, frequency of rebuilds, acceptable
time taken to do rebuilds etc.

As you've seen from the mco provisioner you've been playing with
its reasonably feasible to implement any behavior you might like
with a bit of code.  If you were to note a n step process that
you want machines to go through on first boot then translating
that into a agent + something to drive the agent really isn't
that hard.

The mco provisioner captures what I needed at the time and also
fed back a bunch of requirements into the mcollective development
which would make re-writing it a lot easier today. It's no doubt
too complex for your needs or not a good fit - though it does
allow you to customize exactly what it does in 2 ways:

- you can provide your own agent that implements different logic
  for each action.  The actions are effectively named API end points
  but you can decide what the logic is in each case.  You did not
  like the bootstrap environment, no biggie, just rewrite that
  action to do what you want

- you can enable and disable any of the steps to meet your needs
  so sticking with the bootstrap thing as an example only, you
  can configure it to just skip that step entirely.  stages and
  chaining did not exist when this provisioner was written so it
  had a complicated extra step to achieve the same.

This worked fine, I had a single provisioner running provisioning
both physical machines and cloud instances - complete with different
logic in the cloud from that in the datacenter by just deploying
different agents leaving the provisioner to just call the agent
in the desired order.  My setup was quite complex as I had many
masters in many locations and had to make a lot of decisions upfront
before I could even know what master would be responsible for a
specific node.

I can think of many other ways to approach this problem though.

The question about what to do with certs is purely site specific,
its clear from the answers in this thread that for many auto signing
is acceptable, others disagree.  You have to decide what your desired
behavior is based on local policy etc and you're almost certainly
going to have to write some code to match up puppet, kickstart and
all the other moving parts with that.

Puppet, MCollective and other tools just exist to make it easier for
you to reach your goals with a little bit of glue in between - be it
ENCs, scripts, cronjobs or a more complex ever present observer like
the mco provisioner.  It's all just building blocks that u need to
combine into a whole.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dick Davies  
View profile  
 More options Sep 19 2012, 5:37 am
From: Dick Davies <rasput...@hellooperator.net>
Date: Wed, 19 Sep 2012 10:37:01 +0100
Local: Wed, Sep 19 2012 5:37 am
Subject: Re: [Puppet Users] Systems Provisioning
On 16 September 2012 22:25, Jakov Sosic <jso...@srce.hr> wrote:

> On 09/16/2012 11:31 AM, Dick Davies wrote:
>> We only provision a few nodes a day max. so that works ok. Lately I've
>> been
>> thinking of replacing Cobbler with The Foreman, which has better
>> Puppet integration.

> What does foreman provide better than cobbler?

Don't know it that well yet, but the bits that are appealing to me are
the dashboard
functionality (for puppet reporting) and the 'Smart Proxy'  concept to
drive external
services as part of provisioning. That takes care of the puppet
signing issue but in
our case we have bespoke system that runs our DHCP/DNS servers.

Cobbler can manage BIND/isc-dhpcd, but we have to click through an external
webapp to reserve the IP and FQDN up front. A small REST app in front of that
looks like it should be able to allow automation with a Foreman setup.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick  
View profile  
 More options Sep 19 2012, 7:59 am
From: Nick <oinksoc...@letterboxes.org>
Date: Wed, 19 Sep 2012 12:59:05 +0100
Local: Wed, Sep 19 2012 7:59 am
Subject: Re: [Puppet Users] Systems Provisioning
Hi,

A have a question related to this thread. I'd like to ask, is the Foreman smart
proxy amenable to being configured using Puppet, to the extent of being able to
define the systems that are PXE booted within Puppet?  Or is there some other
existing means of configuring PXE booted systems from Puppet?

Cheers,

N


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Poston  
View profile  
 More options Sep 19 2012, 5:55 pm
From: Glenn Poston <gposton1...@gmail.com>
Date: Wed, 19 Sep 2012 14:55:58 -0700 (PDT)
Local: Wed, Sep 19 2012 5:55 pm
Subject: Re: [Puppet Users] Re: Systems Provisioning

We have one script that is called to bootstrap and provision new VMs.  There's another one for destroying.  These scripts are also responsible for logging into the puppet master (via ssh), polling for the cert to be created (puppet cert list) and then issuing the sign/clean commands.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 13 2012, 8:53 am
From: Jakov Sosic <jso...@srce.hr>
Date: Sat, 13 Oct 2012 14:52:42 +0200
Local: Sat, Oct 13 2012 8:52 am
Subject: Re: [Puppet Users] Systems Provisioning
On 09/19/2012 01:59 PM, Nick wrote:

> Hi,

> A have a question related to this thread. I'd like to ask, is the Foreman smart
> proxy amenable to being configured using Puppet, to the extent of being able to
> define the systems that are PXE booted within Puppet?  Or is there some other
> existing means of configuring PXE booted systems from Puppet?

> Cheers,

I don't know about foreman, but I have written cobbler puppet module
with 4 custom types (distro, profile, repo, system), so we manage
cobbler entirely through puppet. It's more readable and easier to edit
properties. For example, this is how a typical system looks like:

   cobblersystem { 'typical-node':
     ensure    => present,
     profile   => 'CentOS-6.3-x86_64',
     interface => { 'eth0' => { mac => '00:AA:BB:CC:DD:EE', ip_address
=> '192.168.1.99', subnet => '255.255.255.0', static => '1' }, },
     netboot   => false,
     gateway   => '192.168.1.1',
     require   => Service[$cobbler::service_name],
   }

--
Jakov Sosic
www.srce.unizg.hr


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan White  
View profile  
 More options Oct 13 2012, 11:55 am
From: Dan White <y...@comcast.net>
Date: Sat, 13 Oct 2012 11:55:56 -0400
Local: Sat, Oct 13 2012 11:55 am
Subject: Re: [Puppet Users] Systems Provisioning
Is this module posted somewhere public ?
Looks interesting enough to try out.

On Oct 13, 2012, at 8:52 AM, Jakov Sosic wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 13 2012, 4:50 pm
From: Jakov Sosic <jso...@srce.hr>
Date: Sat, 13 Oct 2012 22:50:05 +0200
Local: Sat, Oct 13 2012 4:50 pm
Subject: Re: [Puppet Users] Systems Provisioning
On 10/13/2012 05:55 PM, Dan White wrote:

> Is this module posted somewhere public ?
> Looks interesting enough to try out.

It's not posted yet but it will be soon. I'm currently rewriting some
providers from CLI cobbler to XMLRPC calls, and I'm not yet fully
satisfied with integration with puppetlabs/apache module. I had to
modify apache module to make it work...

Also I have some minor issues, like first run adds system without
interfaces to cobbler, and subsequent run add interfaces. So you have to
run it twice to properly add the system.

Maybe someone can point out is there a way to fix this, because I've
implemented interfaces as property and not param, so provider has
separate methods for checking/modifying current state, and I don't quite
get it why it doesn't run seamlessly in the first run

Also, I don't have documentation ready yet :)

Although if you want I can send you current snapshot and help with
ongoing issues that occur. And ofcourse you don't have to use the whole
module, you can use just custom types if you wish.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Schulte  
View profile  
 More options Oct 13 2012, 5:14 pm
From: Stefan Schulte <stefan.schu...@taunusstein.net>
Date: Sat, 13 Oct 2012 23:17:16 +0200
Local: Sat, Oct 13 2012 5:17 pm
Subject: Re: [Puppet Users] Systems Provisioning

If puppet has to sync ensure it will not sync any other property. That
means if your type defines "ensurable" or you have defined an ensure
property manually and your system is not yet present, your create method
is called and puppet expects the create method to create your system with
interfaces.

Otherwise you will see the described behaviour:

1) First run: Puppet finds out ensure is out of sync (is absent, should
be present) and calls create
2) Second run: Puppet finds out interfaces is out of sync and and calls
interfaces= (or whatever method you have defined for that)

(see lib/puppet/transaction/resource_harness.rb#perform_changes)

-Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 13 2012, 5:53 pm
From: Jakov Sosic <jso...@srce.hr>
Date: Sat, 13 Oct 2012 23:52:49 +0200
Local: Sat, Oct 13 2012 5:52 pm
Subject: Re: [Puppet Users] Systems Provisioning
On 10/13/2012 11:17 PM, Stefan Schulte wrote:

> If puppet has to sync ensure it will not sync any other property. That
> means if your type defines "ensurable" or you have defined an ensure
> property manually and your system is not yet present, your create method
> is called and puppet expects the create method to create your system with
> interfaces.

My understanding of the problem was along those lines too. Now I have
confirmation...

> Otherwise you will see the described behaviour:

> 1) First run: Puppet finds out ensure is out of sync (is absent, should
> be present) and calls create
> 2) Second run: Puppet finds out interfaces is out of sync and and calls
> interfaces= (or whatever method you have defined for that)

I am already detecting in my create method if 'system' is added to
'cobbler' (if it's present on the machine agent is running on), and if
it is, I choose to edit it rather then to try to create it again.

So, can I just call method "interface=", if I detect I have to create
the 'system', or is there any way to solve this issue?

Problem is that cobbler is used for provisioning (PXE+installation), so
when you add new 'system' to cobbler, you are going to try to install
the machine immediately afterwards (in 99% of cases), so two puppet runs
in this case really stand in the way of usability of the whole idea of
puppetizing Cobbler setup. So I would love to circumvent it somehow if
possible.

Thank you


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Schulte  
View profile  
 More options Oct 14 2012, 8:59 am
From: Stefan Schulte <stefan.schu...@taunusstein.net>
Date: Sun, 14 Oct 2012 15:01:44 +0200
Local: Sun, Oct 14 2012 9:01 am
Subject: Re: [Puppet Users] Systems Provisioning

If you use "ensurable", puppet will expect the provider to have an
exists? method and if that returns true your create method will not be
called so you do not have to check the existance in the create method
again.

> So, can I just call method "interface=", if I detect I have to create
> the 'system', or is there any way to solve this issue?

If adding interfaces to a new host is exactly the same as changing
interfaces of an already existing host you can call

    interface = resource[:interface] if resoure[:interface]

Is your provider dealing with files or does it execute commands? When
dealing with files I find it is often easier to do all the work in the
flush method (which is only called if it is implemented by the provider)
and the other set methods are only updating the @property_hash hash.

So if you want to share your provider code I am always interested ;-)

-Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 14 2012, 10:20 am
From: Jakov Sosic <jso...@srce.hr>
Date: Sun, 14 Oct 2012 16:20:09 +0200
Local: Sun, Oct 14 2012 10:20 am
Subject: Re: [Puppet Users] Systems Provisioning
On 10/14/2012 03:01 PM, Stefan Schulte wrote:

> If you use "ensurable", puppet will expect the provider to have an
> exists? method and if that returns true your create method will not be
> called so you do not have to check the existance in the create method
> again.

But then I would have to change all params to properties and add
appropriate methods to provider, but that would both slow it down and
complicate it more... I don't know if it's worth it just for the sake of
log message stating "property changed from A to B" instead of
"cobblersystem created" on every param change.

> If adding interfaces to a new host is exactly the same as changing
> interfaces of an already existing host you can call

>      interface = resource[:interface] if resoure[:interface]

I'll try that.

> Is your provider dealing with files or does it execute commands? When
> dealing with files I find it is often easier to do all the work in the
> flush method (which is only called if it is implemented by the provider)
> and the other set methods are only updating the @property_hash hash.

> So if you want to share your provider code I am always interested ;-)

Offcourse, I have nothing to hide. Here's the current code:

http://pastebin.com/f7GFU2qp

--
Jakov Sosic
www.srce.unizg.hr


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 14 2012, 12:58 pm
From: Jakov Sosic <jso...@srce.hr>
Date: Sun, 14 Oct 2012 18:57:47 +0200
Local: Sun, Oct 14 2012 12:57 pm
Subject: Re: [Puppet Users] Systems Provisioning
On 10/14/2012 04:20 PM, Jakov Sosic wrote:

First of all I renamed "interface" to "interfaces", and then I've found
solution for adding the property in first run, here is what code looks like:

         # add interfaces
         unless self.interfaces == @resource.should(:interfaces)
             self.interfaces = @resource.should(:interfaces)
         end

It's documented here:
http://projects.puppetlabs.com/projects/puppet/wiki/Development_Compl...

I forgot about documentation :)

So I guess I could be rewriting all of my params to properties now, hm...

--
Jakov Sosic
www.srce.unizg.hr


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Schulte  
View profile  
 More options Oct 15 2012, 3:10 am
From: Stefan Schulte <stefan.schu...@taunusstein.net>
Date: Mon, 15 Oct 2012 09:13:28 +0200
Local: Mon, Oct 15 2012 3:13 am
Subject: Re: [Puppet Users] Systems Provisioning

On Sun, Oct 14, 2012 at 04:20:09PM +0200, Jakov Sosic wrote:
> On 10/14/2012 03:01 PM, Stefan Schulte wrote:
> > If you use "ensurable", puppet will expect the provider to have an
> > exists? method and if that returns true your create method will not be
> > called so you do not have to check the existance in the create method
> > again.

> But then I would have to change all params to properties and add
> appropriate methods to provider, but that would both slow it down and
> complicate it more... I don't know if it's worth it just for the sake of
> log message stating "property changed from A to B" instead of
> "cobblersystem created" on every param change.

Is it possible to run a command to get all the desired information about
every systems at once? This way you can implement a prefetch pattern.
Basically you create provider instances for each system at once and
write the current values in the @property_hash hash. Then your get methods
just return the cached value which scales pretty well.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jakov Sosic  
View profile  
 More options Oct 15 2012, 7:09 am
From: Jakov Sosic <jso...@srce.hr>
Date: Mon, 15 Oct 2012 13:09:09 +0200
Local: Mon, Oct 15 2012 7:09 am
Subject: Re: [Puppet Users] Systems Provisioning
On 10/15/2012 09:13 AM, Stefan Schulte wrote:

> Is it possible to run a command to get all the desired information about
> every systems at once? This way you can implement a prefetch pattern.
> Basically you create provider instances for each system at once and
> write the current values in the @property_hash hash. Then your get methods
> just return the cached value which scales pretty well.

Yes it is possible to get all systems at once. It's what the XMLRPC call
does:

   xmlrpcresult = cobblerserver.call("get_systems")

I already do that, but I select only one system, examine the hash, and
if I notice differences from current puppet settings, approach to
running CLI commands editing that system.

Your idea would require top to bottom rewrite of provider, and I don't
have currently time for it... also, what are the benefits?

Currently I am planning to change params to properties (every param that
is not needed for creation of system can be managed as property - it's
more native way as I figured it out now).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Schulte  
View profile  
 More options Oct 15 2012, 1:20 pm
From: Stefan Schulte <stefan.schu...@taunusstein.net>
Date: Mon, 15 Oct 2012 19:23:10 +0200
Local: Mon, Oct 15 2012 1:23 pm
Subject: Re: [Puppet Users] Systems Provisioning

The fact that your exists? method does not really answer the question if
a resource is present or absent is a bit strange. And inside the create
method you are basically reimplementing properties with parameters. If
something has to be checked for correctness it should be a property.
Otherwise it is a parameter. Like the service resource: enable is a
property because it can be out of sync. hasstatus is a parameter because
it cannot be out of sync but only changes the behaviour of the provider

Your main concern against properties if I got you correctly was about
speed because puppet would run one query for each property. One way around
that is to implement a query method that will query all properties at once
and store them in a hash (@property_hash). Every get-method now check
if @property_hash[:some_property] does already exist and return that
value if it does or run the query method that would populate the
@property_hash hash.

Another speed improvement is to implement an `instances` and `prefetch`
method. That has the benefit that puppet does "react" on such methods
if they are implemented:

* you are able to run "puppet resource cobblersystem" on the command
  line to get the current configuration of all systems (that depends on
  an instances classmethod)
* you can use the resources type to purge unmanaged systems

    resources { 'cobblersystem':
      purge => true
    }
* the prefetch method is automatically called by puppet if implemented
  to create provider instances
* your get methods become trivial

-Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 32   Newer >
« Back to Discussions « Newer topic     Older topic »