GithubHelp home page GithubHelp logo

example42 / psick Goto Github PK

View Code? Open in Web Editor NEW
657.0 44.0 185.0 2.41 MB

Puppet Systems Infrastructure Construction Kit: The control-repo

Home Page: http://www.example42.com

License: Apache License 2.0

Ruby 15.44% Shell 55.21% Puppet 1.40% HTML 3.93% JavaScript 1.48% CSS 12.76% PowerShell 3.44% Batchfile 0.08% HCL 6.26%
puppet vagrant-environments control-systems control-repo puppet-tasks infrastructure fabric-tasks hiera-eyaml profile docker puppet-control

psick's Introduction

Gitpod ready-to-code

PSICK

Puppet Systems Infrastructure Construction Kit

Build Status Codacy Badge

Your infrastructure control repository.

From this repository you can build your IT infrastructure and manage it via Puppet.

PSICK is a Puppet control-repo with support for different tools to manage systems provisioning:

  • A modern, opinionated, general purpose, full featured, reusable, customisable control-repo
  • Support for multiple ways to test local Puppet code (unit, integration, acceptance tests on multiple targets)
  • Support for different CI solutions (Gitlab, GitHub, CD4PE...)
  • Usable in every Puppet setup, based on Puppet Enterprise, Open Source, with or without Foreman

This control repo, among the other third party modules, uses the companion psick module which provides:

  • A robust interface for Hiera driven nodes classification
  • Ready to use profiles for common system baselines
  • Support for application specific psick profiles, via the psick_profile
  • Easy integration with common third party component modules

Sample Hiera data for the PSICK control-repo is available via the psick-hieradata module.

Setup of a new control-repo

Download this repository:

git clone https://github.com/example42/psick
cd psick
./psick create

The psick command currently it just allows you to create a new control-repo and populate it either with a bare minimal skeleton, or with the full PSICK contents. In the future it will provide the possibility to pick single components (integrations, profiles...), see how they diff compared to your own control-repo and eventually update them on your local control-repo.

Once you have created your own control-repo, you can start to work with it. If you have chosen to copy the full PSICK contents in your control repo, you can run the following commands from your own control-repo directory, otherwise run them from the PSICK directory.

This applies to all the scripts and paths referenced in the docs, just be aware that some of the scripts in bin/ and other integrations might not work correctly in a not full PSICK setup.

Setup of a Puppet environment

This control-repo requires Puppet 4 or later, if it's not already installed, you can install it with this cross OS Puppet 4 install script (it uses the official Puppet repos):

sudo bin/puppet_install.sh # Only if you don't have Puppet 4 installed

Before starting to use it, you have to populate the modules/ directory of the control-repo.

You need to do this both on your development workstation, and on your Puppet server (after having placed your control-repo into the /etc/puppetlabs/code/environments/ directory).

To install the prerequequisite gems (hiera-eyaml, deep_merge, r10k) and populate the external modules directory via r10k, you can run:

bin/puppet_setup.sh        # Only if you don't have the prerequisites gems

If you have already r10k and the prerequisite gems, just run:

r10k puppetfile install -v

If you also want to install the recommended (Vagrant, Docker) tools that can be used with the repo, run:

bin/setup.sh               # Only if you want to install Vagrant and Docker

The script, installs and runs r10k and then uses Puppet to install the other software.

Notes:

  • You will always be asked to confirm or skip each step.

  • The script will use sudo for the operations that need root privileges.

  • Scripts are mostly tested on Mac and Linux environments. On Mac some packages installations don't work.

  • You can safely interrupt the scripts with CTRL+C at any time

  • For unattended setups (typically in CI pipelines) you can skip confirmation requests passing the argument auto:

      bin/puppet_setup.sh auto
      bin/setup.sh auto
    

Directory structure

PSICK has the common set of files and directories of a Puppet control-repo:

  • environment.conf - The Puppet environment configuration file
  • manifests/ - Directory with the main manifests. Here we have just site.pp
  • Puppetfile - File that defines the external modules to add via r10k
  • modules/ - Directory where modules defined in Puppetfile are placed (it's .gitignored)
  • hiera.yaml - Hiera 5 environment configuration file. An equivalent Hiera 3 file is hiera3.yaml (was linked to /etc/puppetlabs/puppet/hiera.yaml)
  • hieradata/ - This directory (or one called data) is usually used to store Hiera data, when is decided to keep Hiera data inside the control-repo. Since version 0.9.3 PSICK's default datadir is loaded from a module in modules/hieradata/data.

Some extra directories are added in PSICK for integrations and tools:

  • bin/ - Directory containing tools and scripts for various Puppet related operations
  • docs/ - Directory with extra docs
  • site/ - An additional modules directory, with local profiles and tools.
  • docker/ - Files used for building Docker images for multiple OS
  • vagrant/ - Various Vagrant environments where is possible to test local Puppet code
  • .gitlab-ci.yaml - (Sample) GitLab Continuous Integration pipeline for code testing and deployment

Compatibility

PSICK compatible with every modern enough Puppet setup:

  • Puppet OSS 4.9 or later.
  • Puppet Enterprise 2017.1.0 or later

Documentation

PSICK is full of more or less hidden stuff, which ease a lot Puppet code development, testing and deployment. Here is where you can find more info:

General Puppet documentation:

About this control-repo:

  • Control-repo structure - A description of the control-repo structure and most important paths
  • Control-repo logic - An overview of the design choices and the logic of this control repo.
  • Prerequisites - A more detailed view of the prerequisites needed to fully use the control-repo
  • Noop Mode - An overview on how to manage noop and no-noop with PSICK
  • Vagrant Integration - How to use Vagrant to test the control-repo during development
  • Docker Integration - How to use Docker to test Puppet code and to build images based on the existing Puppet code

Managing changes:

  • Git tasks - An overview on how to use Git
  • Change Process - A step by step guide on how to manage changes in Puppet code

psick's People

Contributors

alvagante avatar fduranti avatar jjpryor avatar karolisc avatar logicminds avatar pmuller avatar rgevaert avatar rndmh3ro avatar rwaffen avatar snesbittsea avatar thekoma avatar ttres avatar tuxmea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psick's Issues

apache: multiple virtualhosts issue

Hi,

When I define multiple virtualhosts, I get this error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Apache::Dotconf[00-NameVirtualHost] is already defined in file /etc/puppet/modules/apache/manifests/virtualhost.pp at line 76; cannot redefine at /etc/puppet/modules/apache/manifests/virtualhost.pp:76 on node

I think this is because of the

require apache::params

in the virtualhosts module.

How can this be fixed?

Thanks,
Ger.

All modules have stopped working

With the latest Ubuntu/trusty64 box all example42 modules fail with errors similar to the following:

default: Wrapped exception:
==> default: Received incomplete information - no value provided for parameter my_class

This is true on APT, PHP and Apache (the 3 I am using) and for seemingly all default params on these modules

tomcat:instance doesn't work

Hi,

When I try to create a tomcat instance; it fails.

Node config:
---------------%<---------------
include tomcat
tomcat::instance { "test":
httpport => '8080',
controlport => '8005',
ajpport => '8009',
}
---------------%<---------------

Error:
---------------%<---------------

puppetd -t

info: Caching catalog for client.domain.nl
err: Could not run Puppet configuration client: Parameter mode failed: File modes can only be numbers, not ""
---------------%<---------------

I haven't got a clue where it fails exactly, didn't find anything useful in debugging.
I've tried supplying values for the filemodes (incase the default values weren't assigned properly)

Server&Client are running RHEL6, with the epel puppet packages (0.25.5)

Your help is very much appreciated...

Regards,
Ger

Puppetfile is missing "puppetlabs/apt"

To install docker using bin/setup.sh the apt module by puppetlabs (or drop-in replacement) is required.
Puppetfile however does not state it in "production" and so the module is never installed - docker fails to install.

Virtualhosts on apache

Hi,

I found that there were 3 small issues using virtualhosts on apache:

  1. The documentroot directory was not created
  2. The documentroot-path was not set correctly in the vhost configfile.
  3. ServerAliases were not implemented.

Patch for #1 & 2:
---------------%<----------------
index 289bae4..a278a02 100644
--- a/apache/manifests/virtualhost.pp
+++ b/apache/manifests/virtualhost.pp
@@ -8,9 +8,9 @@

Usage:

With standard template:

With custom template (create it in MODULEPATH/apache/templates/virtualhost/)

define apache::virtualhost ( $templatefile='virtualhost.conf.erb' , $documentroot='' , $enable=true , $filename='', $aliases='') {

@@ -29,7 +29,7 @@ define apache::virtualhost ( $templatefile='virtualhost.conf.erb' , $documentroo
$documentroot_real = $documentroot
}
else {

  •    $documentroot_real = "${name}"
    
  •    $documentroot_real = "${apache::params::documentroot}/${name}"
    

    }

    file { "ApacheVirtualHost_$name":
    @@ -78,4 +78,10 @@ define apache::virtualhost ( $templatefile='virtualhost.conf.erb' , $documentroo
    default: { }
    }

  • file { "$documentroot_real":

  •    owner   => "${apache::params::configfile_owner}",
    
  •    group   => "${apache::params::configfile_group}",
    
  •    mode    => '775',
    
  •    ensure  => directory,
    
  • }
    }
    ---------------%<----------------

Patch for #3:
---------------%<----------------
index 74665c3..3d7bd17 100644
--- a/apache/templates/virtualhost/virtualhost.conf.erb
+++ b/apache/templates/virtualhost/virtualhost.conf.erb
@@ -4,6 +4,9 @@
ServerAdmin webmaster@<%= name %>
DocumentRoot <%= documentroot_real %>
ServerName <%= name %>
+<% for i in aliases: %>

  • ServerAlias <%= i %>
    +<% end %>
    ErrorLog logs/<%= name %>-error_log
    CustomLog logs/<%= name %>-access_log common
---------------%<----------------

Regards,
Ger.

apt module missing with vagrant

Trying to bring up a master with guides like this or that fails due to:

Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::apt for ubuntu-xenial at /home/ubuntu/src/git/psick/environments/production/modules/postgresql/manifests/repo/apt_postgresql_org.pp:3:3 on node ubuntu-xenial

I note issue #86 mentions the same thing, and it was closed because @alvagante said: "there should no need of puppetlabs-apt". But apparently there is. My environment is pretty familiar, just following the guides linked.

ostest fails on invalid (expired) GPG key for apt.puppetlabs.com

Ostest fail as follows:

ubuntu1604.ostest.psick.io:
Error: /Stage[main]/Puppet::Profile::Agent/Tp::Install[puppet-agent]/Tp::Repo[puppet-agent]/Exec[tp_apt_update]: Failed to call refresh: /usr/bin/apt-get -qq update returned 100 instead of one of [0]

running /usr/bin/apt-get -qq update results in:

ubuntu@ubuntu1604:~$ sudo /usr/bin/apt-get -qq update

W: http://apt.puppetlabs.com/dists/stable/Release.gpg: Signature by key 47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30 uses weak digest algorithm (SHA1)
W: GPG error: http://apt.puppetlabs.com stable Release: The following signatures were invalid: KEYEXPIRED 1483574797
W: The repository 'http://apt.puppetlabs.com stable Release' is not signed.
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/partial/apt.puppetlabs.com_dists_stable_Release
E: Failed to fetch http://apt.puppetlabs.com/dists/stable/PC1/binary-amd64/Packages 404 Not Found [IP: 192.155.89.90 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.`

MoudleSync/Gemfile Question

I'm starting to work on acceptance tests for the profile module and the Gem file in site/profile is marked as derived from puppetlabs-ntp. Looking at the ntp module I see that I discovered that the Gem file structure is based on ModuleSync which does not appear to be implemented in psick. Should ModuleSync be implemented or should I pull the ModuleSync specific bits out?

Thx,

-steve

Split the Bind module into it's own repo as a git submodule

I'm not sure if there was a good reason for keeping it as a part of your puppet-modules repo, but I would like to see the Bind module in its own Example42 repo for it to be easily used by others. Let me know if there is anything I can do to help.

Error using tomcat module on RHEL6

err: Could not retrieve catalog from remote server: Error 400 on SERVER: No matching value for selector param '' at /etc/puppet/environments/development/modules/tomcat/manifests/params.pp:22 on node srvhw130.kao.sbwinfra.nl

In the params file, the $lsbmajdistrelease is checked. This is empty on my RHEL6 server, so it fails with the error above.

I've added a default, so that it works.

Regards,
Ger.

diff --git a/tomcat/manifests/params.pp b/tomcat/manifests/params.pp
index 8d04043..2cf81ec 100644
--- a/tomcat/manifests/params.pp
+++ b/tomcat/manifests/params.pp
@@ -19,6 +19,7 @@ class tomcat::params {
/(CentOS|RedHat)/ => $lsbmajdistrelease ? {
5 => "tomcat5",
6 => "tomcat6",

  •     default => "tomcat6",
     },
     default => "tomcat",
    
    }

puppetserver_gem failing on FOSS master

Hi, I get the following errors. Note the weird two spaces between the words "file" and "does". If I run bin/papply.sh again, everything works.

==> default: Debug: Puppet::Type::Package::ProviderPuppetserver_gem: file  does not exist
==> default: Debug: Puppet::Type::Package::ProviderPuppetserver_gem: file  does not exist
==> default: Debug: Puppet::Type::Package::ProviderPuppetserver_gem: file  does not exist
==> default: Error: /Package[puppetserver_r10k]: Provider puppetserver_gem is not functional on this host
==> default: Error: /Package[puppetserver_deep_merge]: Provider puppetserver_gem is not functional on this host
==> default: Error: /Package[puppetserver_hiera-eyaml]: Provider puppetserver_gem is not functional on this host

I have noticed that if I move puppetserver/lib/puppet/provider/package/puppetserver_gem.rb out of the way, it seems to work first time, but I'm not sure if I'm breaking something else by doing that. Any clues?

Add Operating System to the RedHat family?

Could we add OracleLinux to the list of operatingsystem values for the RHEL variants?

Where the package name for the RHEL variants and the default differs, I get yum errors when applying the modules.

In all other ways except the Kernel, Oracle Linux seems to be identical to the RHEL/CentOS tree.

Thanks!

Could not parse for environment production: Syntax error at ',

[root@localhost modules]# puppet apply postfix/manifests/postfixadmin.pp
Could not parse for environment production: Syntax error at ',
        extracted_dir       => '; expected '}' at /etc/puppetlabs/puppet/example42modules/postfix/manifests/postfixadmin.pp:35 on node puppetmaster.localdomain

Here's a fix:

diff --git a/postfix/manifests/postfixadmin.pp b/postfix/manifests/postfixadmin.pp
index bf27f07..11e2f57 100644
--- a/postfix/manifests/postfixadmin.pp
+++ b/postfix/manifests/postfixadmin.pp
@@ -31,7 +31,7 @@ class postfix::postfixadmin {
     }

     netinstall { postfixadmin:
-        url                 => "{postfix::params::postfixadmin_url}"",
+        url                 => "${postfix::params::postfixadmin_url}",
         extracted_dir       => "${postfix::params::postfixadmin_dirname}",
         postextract_command => "ln -s ${postfix::params::postfixadmin_dirname} ../postfixadmin",
         destination_dir     => "${apache::params::documentroot}",

Unit tests for profile module are failing

At least two problems here.

  1. Common.yaml does not contain an entry for profile::base::linux::limits_class

  2. profile::hosts::file fails to compile with an undefined valued for variable ipaddress => Evaluation Error: Error while evaluating a Function Call, Class[Profile::Hosts::File]: parameter 'ipaddress' expects a String value, got Undef at /home/FUZZBUTT/snesbitt/projects/puppet/control-repo/psick/site/profile/spec/fixtures/modules/profile/manifests/base/linux.pp:110:5 on node loki.samdom.aussieswithtails.fuzzbutt

Also, in the profile common.yaml is there any reason not to sort the entries within a section. That is, within the profile::base::linux section, have the variables in sort order. Picky yes, but it can help on the debugging. I'll be glad to do it as part of my general work

-steve

Setting memory usage for FOSS Puppet master

I note that by default, /etc/default/puppetserver contains:
JAVA_ARGS="-Xms2g -Xmx2g -XX:MaxPermSize=256m"

But 2GB is quite big for... Well, a lightly-used server. :)

It would be great if psick provided a way to reduce the memory usage. Any chance of that happening?

munin service name incompatible with nagios check_procs

In Ubuntu 12.04 munin is executed as (as seen by check_proc plugin):

Ss       0 27456     1  51836  9720  0.0    18:27:15 /usr/sbin/munin /usr/sbin/munin-node

Where the servicename is munin-node, such that the check_procs nrpe check will fail in nagios.

apt puppetlabs

debug: /Stage[main]/Apt::Repo::Puppetlabs/Apt::Repository[puppetlabs]/Exec[aptkey_add_4BD6EC30]: Executing check 'apt-key list | grep -q 4BD6EC30'
debug: Executing 'apt-key list | grep -q 4BD6EC30'
debug: /Stage[main]/Apt::Repo::Puppetlabs/Apt::Repository[puppetlabs]/Exec[aptkey_add_4BD6EC30]: Changing returns
debug: /Stage[main]/Apt::Repo::Puppetlabs/Apt::Repository[puppetlabs]/Exec[aptkey_add_4BD6EC30]: 1 change(s)
debug: /Stage[main]/Apt::Repo::Puppetlabs/Apt::Repository[puppetlabs]/Exec[aptkey_add_4BD6EC30]: Executing 'gpg --recv-key 4BD6EC30 ; gpg -a --export | apt-key add -'
debug: Executing 'gpg --recv-key 4BD6EC30 ; gpg -a --export | apt-key add -'
err: /Stage[main]/Apt::Repo::Puppetlabs/Apt::Repository[puppetlabs]/Exec[aptkey_add_4BD6EC30]/returns: change from notrun to 0 failed: gpg --recv-key 4BD6EC30 ; gpg -a --export | apt-key add - returned 2 instead of one of [0] at /etc/puppet/modules/apt/manifests/repository.pp:58

Could not find resource type apache::virtualhost::custom

Hi

I think this is a bug, but am not certain.

Error:
---------------%<---------------
[root@svr100 ~]# puppetd --test
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find resource type apache::virtualhost::custom at /etc/puppet/modules/apache/manifests/virtualhost.pp:88 on node svr100.domain.nl
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
---------------%<---------------

config ('borrowed' from example)
---------------%<---------------
node 'svr100.domain.nl' inherits devel {
$role = "drupal"
include apache
apache::virtualhost { "wwwl.domain.com": templatefile => "virtualhost.conf.erb" }
}
---------------%<---------------

This is where it fails:
---------------%<---------------
# This define manage different roles and projects
apache::virtualhost::custom { "$name":
templatefile => $templatefile,
documentroot => $documentroot,
enable => $enable,
filename => $filename,
aliases => $aliases,
}
---------------%<---------------

Any help is very much appreciated!

Regards,
Ger.

no path for mysql-binary

the mysql-module doesn't work for me, because it needs the path set.

is there a way to set the path globally?

err: Could not run Puppet configuration client: 'mysql < /root/mysqlquery-root-ftpusers.sql' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/modules-example42/mysql/manifests/query.pp:26

profile::network and profile::hostname conflict on RHEL

on an RHEL system, profile::network and profile::hostname are both trying to declare file /etc/sysconfig/network.

Also note that the RHEL documentation says that the HOSTNAME entry in /etc/sysconfig/network is supposed to be the fqdn; hostname.pp does that correctly, but network.pp sets it to just the first component of fqdn.

from network.pp:

 if $::osfamily == 'RedHat' and $network_template != '' {
   file { '/etc/sysconfig/network':
       ensure  => 'present',
       content => template($network_template),
     }

from hostname.pp:

     if $update_network_entry {
          case $::osfamily {
            'RedHat': {
              file { '/etc/sysconfig/network':
                ensure  => present,
                content => "NETWORKING=yes\nNETWORKING_IPV6=no\nHOSTNAME=${calc_fqdn}\n",
                notify  => Exec['apply_hostname'],
              }
            }
            default: {}
          }
        }

global $monitor_tool variable takes presedence over class parameters

Attempting to disable nagios check for ntp nextgen module:

$monitor_tool = ["nagios", "monit", "munin", "puppi"]

class {
    'ntp' :
        server => ['pool.ntp.org'],
        puppi => true,
        monitor => true,
        monitor_tool => ["monit", "munin", "puppi"],
}

Here Nagios is still enabled for ntp

params_lookup and puppet 3

When using these modules on Puppet ver 3 I get these errors:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: custom functions must be called with a single array that contains the arguments. For example, function_example([1]) instead of function_example(1) at /etc/puppet/modules/resolver/manifests/init.pp:148 on node puppetclient

FreeBSD support for /bin/puppet_install.sh

BSD is currently "not supported" by the install script.

TL;DR: if you want FreeBSD support in a single script for all operating systems it must be made sh-compatibile, at least for the FreeBSD code path, or require a FreeBSD system where someone or something pre-installed bash. You will also have to live with facter2 at least for some time or compile relevant packages from the port collections (on every node, or just on one node and distribute your own binary packages).

Here are some relevant info:

An sh-compatibile unattended Puppet OpenSource installation on FreeBSD using its package system (with Facter2) boils down to this (the bootstrap and update phases are required if it is a fresh install where pkg has not been used before):

#!/usr/bin/env sh
export ASSUME_ALWAYS_YES=YES
pkg bootstrap
pkg update
pkg install puppet4

This will install the agent and the master (configured to run in mongrel) with the appropriate rc scripts to start them at boot (disabled by default).

We are using a variant of that script to set up production FreeBSD-11-RELEASE systems and as far as I can tell they integrate without problems with a Puppet Collections 1 server running on linux, but we are also considering switching to building it through ports to get the newer facter3.

Remote setup fails

I wonder if I'm missing a step in the remote node setup process.

I've created a copy of the control-repo on my local dev machine. I then use the Fabric scripts to install Puppet on a remote machine (Ubuntu 16.04) with:

fab puppet.install -H example.com

This successfully installs puppet. However, when I then try to setup the repo on the remote node, with:

fab puppet.remote_setup -H example.com

I get an error:
### Installing external modules via r10k ###
ERROR -> No such file or directory @ rb_sysopen - /var/Puppetfile

I believe that that's because there is no Puppetfile at /etc/puppetlabs/code/environments/production

I thought maybe I needed to run deploy_controlrepo first. However when I try:

fab puppet.deploy_controlrepo -H

I get this error:

fatal: destination path '/etc/puppetlabs/code/environments/production' already exists and is not an empty directory.

Essentially the install process seems to be creating a production environment, that the scripts don't seem to expect. Obviously I could manually address all of this, I just wanted to see if I'm missing an intended step. Should the fab scripts be able to deal with this? Thanks for any guidance.

Root requirements for setup (revisited)

I maybe missing something or misunderstanding the workflow for psick. If so I apologize and would welcome enlightenment !

As I feared, I did run into an apparent issue in my development environment evidently caused by needing to run too much of the psick setup process as root.

Scenario:

  • A development environment on my local development machine owned by a local user account.
  • Environment configured to use rvm in order to isolate development from system ruby configuration => most commands in development area are run using bundler.
  • A need (or at least I think so) to run r10k puppetfile install in order to update existing module dependencies (new dependencies, new versions, remove obsolete)

Issues:

  • bundle exec r10k puppetfile install fails because r10k gem not found. That's because psick setup installed it at the system level (or so I believe).
  • After adding r10k to my Gemfile and performing a bundle install, bundle exec r10k puppetfile install fails to update most modules because of Permission Denied errors. It turns out that the currently installed modules are owned by root and I am running the command as my local development user. Again I suspect that the root ownership is the result of the psick setup process which was run as root.

In my opinion, a local development environment that requires root access for normal development activities and that depends on packages installed at the system level is not a good thing. :-)

Am I missing some aspect of Psick workflow that would address these concerns? Can/should Psick setup be refactored to limit what needs to be installed at the system level and to support a rvm environment?

Hope I'm not barking up the wrong tree.

-steve

environment.conf empty string

with the environment.conf config_version, I always get an empty string:

Info: Applying configuration version ''

config_version = '/usr/bin/git --git-dir /etc/puppetlabs/code/environments/$environment/.git log --pretty=format:"%h - %an, %ad : %s" -1'

This does work on the command line as expected.

Request: parent directory for Apache

Hi,

I've got several domains with more than one site on it.

On my disk, I keep them ordered like this:

/var/www/domain.com/site1
/var/www/domain.com/site2
/var/www/domain.com/site3

When I make virtualhosts with the virtualhosts manifest, it doesn't create the documentroot directory because the parent doesn't exist.

I've added this to virtualhost.rb to try and fix it:

---------------%<---------------
# creating/managing docroot parent directory
$documentroot_1up = $documentroot_real.chomp(separator='/').rpartition("/")
file { "$documentroot_1up":
owner => "${apache::params::configfile_owner}",
group => "${apache::params::configfile_group}",
mode => '775',
ensure => directory,
}
---------------%<---------------

... but I cannot mix ruby code in.

I've also found this page:
http://www.puppetlabs.com/blog/ruby-dsl/

It looks promising, but I have RedHat servers that use Puppet 0.25.5 from EPEL. I even tried making it work on Ubuntu (which does have Puppet 2.6), but I haven't got a clue where the different parts fit in.

If the apache-module could also check if the parent-directory exist then that would be great, pointers on how to get the parent directory from a string would also be very much appreciated...

Thanks,
Ger.

mysql::grant

in grant.pp
exec {} needs path => ["/usr/bin", "/usr/sbin"]

otherwise i am getting error and user is not created in mysql as expected

stdlib42::netinstall (using rsync) does not work on CentOS 6.2

Test scenario: When installing jenkins from source (as .war file), the .war file is not copied to /webapps

Module 'jenkins' is using stdlib42::netinstall to copy the .war file to /webapps. In our case, netinstall internally uses rsync for copying the file.

As far as I can tell, on CentOS 6.2, rsync requires a second parameter (the destination directory). Since it is missing, rsync will silently not copy the file.

exec {
"Extract $source_filename":
command => "mkdir -p $destination_dir && cd $destination_dir && $real_extract_command $work_dir/$source_filename",
}

sysstat module

I have created a basic sysstat module based on the standard42 template and thought you might want to include it here.

It doesn't do anything special, just manages the package and service and includes a basic template, and has been tested so far only on Ubuntu servers, but is working without issue there. I plan to add a few enhancements to it over the next day or two.

https://github.com/bmcclure/puppet-sysstat

Error during initialization phase

puppet -v /etc/puppet/manifests/toasters/puppet/init.pp

err: //puppet::server::mysql/Mysql::Grant[puppet_server_grants_SRVHW193.kao.sbwinfra.nl]/Exec[mysqlgrant-puppet-$(puppet::params::db_name}]/returns: change from notrun to 0 failed: mysql < /root/mysqlgrant-puppet-$(puppet::params::db_name}.sql returned 1 instead of one of [0] at /etc/puppet/modules/mysql/manifests/grant.pp:26

Fix -> Typo in:
modules/puppet/manifests/server/mysql.pp

This:
mysql_db => "$(puppet::params::db_name}",
should be:
mysql_db => "${puppet::params::db_name}",

(It occurs twice, same typo)

Regards,
Ger

$debug = yes doesnt work

Hi,

I've got $debug = "yes" defined in my basenode.

When run, I get this error on the client:
---------------%<---------------
err: Could not run Puppet configuration client: Could not find dependency File[puppet_debug_variables] for File[puppet_debug_variables_apache] at /etc/puppet/modules/apache/manifests/debug.pp:23
---------------%<---------------

Thanks again!

Ger.

Could not find scope for inherited customized class with $my_project_onmodule = "yes"

I tried to use customized class with $my_project_onmodule = "yes" and while inheriting postfix, so my class definition was "class myproject::postfix inherits postfix". Result was "Could not find scope for myproject::postfix at /etc/puppet/example42modules/postfix/manifests/init.pp:59 on node localhost.localdomain".

OS: Centos 5.5 64bit, puppet 2.6.5, ruby 1.8.6 (2007-09-24 patchlevel 111)

explore usage of overcommit

I have used overcommit in other projects to control my hook integration. Whats great is that you can just drop support into the repo with a .overcommit.yaml file.

I think this is better than telling them what hooks to setup by providing a universal file for everyone to use.

https://github.com/brigade/overcommit/

tools::user::managed Unknown variable: 'real_gid' with default parameter values

Given a hiera definition as follows:
profile::users::static::managed_users:
test_user:
comment: 'test_user'

and an attempt to include profile::users::static

tools::user::managed will fail to compile with an unknown variable: real_gid.

Problem is the if test on uid at line 194. If uid = 'absent' then no value for real_gid is ever set and boom.

Probably should contain an else clause that set real_gid to undef

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.