Pregunta

I'm investigating Puppet as our future deployment and provisioning tool in our shop, but now I'm stuck at how to make a clever Continuous Integration/Delivery tool chain with deployment through Puppet.

In any of our environments (dev, test, qa, demo, prod) we have a range of components. We need to be able to deploy each component separately and possibly even concurrently.

I'd like a way to initiate (through script) a deploy of a single component package (=Puppet module) and gather the output and success status of that. Simply waiting for a scheduled agent pull, or doing a 'puppet agent --test' on each node on the environment isn't good enough, because it may pick up other pending changes (I don't know if another component is also in the process of being deployed).

In my tool chain I would like the deployment output and status from component A and component B to be recorded separately and not mixed up.

So my question is: Can I use puppet to deploy one single named package (module) at a time?

And if not, where did I take a wrong turn when I drove down this path?

I realise a master-less Puppet set-up with modules and manifests replicated to each node perhaps could do it, but IMHO a master-less Puppet set-up kind of defeats the purpose of Puppet.

PS: I think what I'm trying to achieve is called 'Directed Orchestration' in Damon Edwards' very enlightening video at Integrating DevOps tools into a Service Delivery Platform (at timestamp around 22:30).

¿Fue útil?

Solución 3

a master-less Puppet set-up kind of defeats the purpose of Puppet.

Only if you discount

  1. The rich DSL puppet has to offer
  2. So many peer reviewed community modules

Otherwise, something like this gives you remote directed orchestration.

#update manifests etc (version control is the source of truth)
ssh user@host git pull
#run puppet
ssh user@host sudo puppet-apply

Otros consejos

  • So my question is: Can I use puppet to deploy one single named package (module) at a time?

Yes, you can, via puppet apply. First you need to create a moduledir and a module that will contain your manifests. e.g. :

  /scratch/user/puppet/local/  # This is your modulepath for local deployment

  # Following contains the manifests for a module name "localmod"
  /scratch/user/puppet/local/localmod/manifests/init.pp 

  # example content of init.pp
  class localmod {
    notify{"I am in in local module....":}
  }

On that local machine you can test this module via puppet apply :

 puppet apply -v --modulepath=/scratch/user/puppet/local -e "include localmod"
 echo $? # Get the exit status of the above command

I watched the video at the point your video. There are two types of automation you can do.

Application build/deploy automation, which can be achieved via maven/ant (Build) and ant/capistrano/chrome/bash/msdeploy (Deploy) or as termed on that slide "Installer".

System/Infrastructure automation can be achieved via Chef/Puppet/CFEngine.

This question seems to be ... "How do I do applications build using puppet (implied as a system automation tool)"

So quite simply, oval tool in round hole. (I didn't say square)

At my company, we use Jenkins and the Build Pipeline Integration plugin to build massive multi component projects. As an example, a Java app will use ant in a build job, the next chained job will be a "deploy to dev" job which uses Capistrano to deploy the application, then the next job in the chain is "Configure Dev" which calls Chef to update the system configurations in the DEV environment. Chef is used to configure the application. Each of these jobs can be set to run automatically and sequentially.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top