puppet

How to deal with code duplication in puppet modules?

一个人想着一个人 提交于 2019-12-06 22:26:57
I have implemented two puppet modules to setup and configure two components - A & B. The directory structure of the modules folder looks like below: modules modulea manifests init.pp install.pp config.pp service.pp templates 1.properties.erb (This one is also needed by moduleb) 2.properties.erb (This one is also needed by moduleb) moduleb manifests init.pp install.pp config.pp service.pp templates 1.properties.erb (same as in modulea) 2.properties.erb (same as in modulea) 3.properties.erb 4.properties.erb 5.properties.erb The code in install.pp and service.pp is identical in both the modules.

Duplicate declaration of same resource defined in separate classes

半城伤御伤魂 提交于 2019-12-06 20:26:25
问题 I have a class definition which requires the build-essential package: class erlang($version = '17.3') { package { "build-essential": ensure => installed } ... } Another class in a different module also requires the build-essential package: class icu { package { "build-essential": ensure => installed } ... } However, when I try to perform puppet apply, the error I receive is: Error: Duplicate declaration: Package[build-essential] is already declared in file /vagrant/modules/erlang/manifests

Puppet apache + passenger模式扩展

走远了吗. 提交于 2019-12-06 19:11:43
puppet使用SSL(https)协议来进行通讯,默认情况下,puppet server端使用基于Ruby的WEBRick HTTP服务器。由于WEBRick HTTP服务器在处理agent端的性能方面并不是很强劲,因此需要扩展puppet,搭建Apache或者其他web服务器来处理客户的https请求。 Passenger是一个将Ruby程序嵌入执行的apache的一个模块,它可以让你运行Rails,即Rack应用内的一个Web服务器.能够自动增减集群进程的数量.能提高性能并增加Master和agent之间的并发连接数量。 工作原理如下: 安装好apache和passenger,然后配置apache处理puppet agent的SSL验证请求,最后将apache连接到puppet master.在处理SSL验证请求时,apache会验证puppet agent的证书是否由puppet CA签发,apache 会先验证请求.如果授权通过,则调用master.同时,apache会提供给puppet agent一个证书用于验证服务器的真实性,再将SSL证书存放在适当的位置.打开passenger模块并为puppet master服务创建一个虚拟主机来配置apache. 下面来配置一番: 1.安装apache等相关组件 yum install httpd httpd-devel mod

How do you add items to .dockerignore?

橙三吉。 提交于 2019-12-06 16:36:37
问题 I'm not able to find many examples of what a .dockerignore file should look like. Using puppet to install a few packages on a docker container causes the image to explode from 600MB to 3GB. I'm trying to use a .dockerignore file to keep the size to a minumum $ cat Dockerfile FROM centos:centos6 #Work around selinux problem on cent images RUN yum install -y --enablerepo=centosplus libselinux-devel RUN yum install -y wget git tar openssh-server; yum -y clean all Add Puppetfile / RUN librarian

Could not retrieve facts from inventory service: SSL_connect returned=1 errno=0 state=SSLv3

让人想犯罪 __ 提交于 2019-12-06 13:23:01
I can see following error in puppet Enterprise Console:: Could not retrieve facts from inventory service: SSL_connect returned=1 errno=0 state=SSLv3 read server session ticket A: sslv3 alert certificate revoked Also I followed following steps:: I ran puppet agent -t on Windows puppet Enterprise client. I ran puppet cert list and sign client certificate from master. Again I ran puppet agent -t but I am getting following error on console :: Warning: Unable to fetch my node definition, but the agent run will continue: Warning: SSLconnect returned=1 errno=0 state=SSLv3 read server certificate B: c

using awk sed to parse update puppet file

可紊 提交于 2019-12-06 12:33:43
I have a puppet file with a number of lines of code that has a section that looks like this: $defaultrepo=myrepo $defaultbranch=mybranch gitmod::pullstuff {'othergitcode': gitcommit => "b54123be540adrwer3b65872384e0101c5f94c926b81", gitorg => "${defaultrepo}", branch => "${defaultbranch}", } gitmod::pullstuff {'mygitcode': gitcommit => "b54123be540adrfer3b65872384e0101c5f94c926b81", gitorg => 'awesomerepo', branch => "master", } It can have any number of blocks that will look similar to the two blocks of code listed above. I am looking for a way to parse the file and pull out the values as

Iterate over a deeply nested hiera hash in puppet manifest

☆樱花仙子☆ 提交于 2019-12-06 04:11:54
问题 I'm working on building a structure for my webservers. I have my setup in hiera, but I can't seem to get puppet to give back the correct types. In common.yaml vhosts: hostname: sitename: app_url: value app_type: value I have multiple sites per vhost and multiple vhosts. In my manifest I'm going to be creating the folder structure and other setup tasks, but for for now I can't even get it to iterate over the sites. Current manifest: define application($app_name, $app_url) { notice("App Type: $

Puppet installing packages, but these do not seem to work

半城伤御伤魂 提交于 2019-12-06 02:01:13
I have the following puppet file. It seems to have installed everything without errors, but commands such as yo or bower dont seem to work. Any idea why? class yeoman { Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] } $yeomanPackages = ["git", "rubygems", "libjpeg-turbo-progs", "optipng", "phantomjs", "python-software-properties" ] package { $yeomanPackages: ensure => "installed", require => Exec['apt-get update'], } exec { "apt-get update": command => "/usr/bin/apt-get update" } package { 'compass': ensure => latest, provider => 'gem', require => Package["rubygems"], }

Hosting rails on ec2

放肆的年华 提交于 2019-12-06 01:47:37
问题 I want to deploy a rails onto amazon ec2. I've had a look at poolparty and ec2onrails but neither seem to be maintained anymore. What are people using to do this? Is it all homebrewed puppet and capistrano or is there a project that will get me going? 回答1: I can recommend two projects: If you have a single Rails app, take a look at Rubber. It's a gem that can provision EC2 instances for you, install software and deploy your app. It's based on Capistrano. There are recipes for the most common

How to package files with a Vagrant box?

爱⌒轻易说出口 提交于 2019-12-06 01:29:49
问题 So I created a Vagrant box with the following command: vagrant package --base box_name_here --vagrantfile Vagrantfile --include manifests/ manifests/ is a directory with a puppet manifest and some subdirectories with some files used during the provisioning process. Puppet is called in the Vagrantfile like so: config.vm.provision :puppet do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "web-dev.pp" end When I explore the packaged .box archive Vagrant creates, I see the