Giter Club home page Giter Club logo

voxpupuli / puppet-r10k Goto Github PK

View Code? Open in Web Editor NEW
98.0 49.0 168.0 1.49 MB

Setup and configure r10k for use with git based environments in puppet

Home Page: https://forge.puppet.com/puppet/r10k

License: Apache License 2.0

Ruby 67.76% Shell 1.60% Puppet 30.64%
linux-puppet-module puppet hacktoberfest archlinux-puppet-module centos-puppet-module gentoo-puppet-module oraclelinux-puppet-module redhat-puppet-module scientific-puppet-module ubuntu-puppet-module

puppet-r10k's Introduction

r10k Configuration Module

Puppet Forge Build Status Github Tag Gitter Puppet Forge Downloads Puppet Forge Endorsement

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with r10k
  4. Webhook Support
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Support
  8. Development - Guide for contributing to the module
  9. Running tests

Overview

This module was built to install and configure r10k. It has a base class to configure r10k to synchronize dynamic environments. It also has a series of lateral scripts and tools that assist in general workflow, that will be separated into their own modules into the future.

Module Description

This module is meant to manage the installation and configuration of r10k using multiple installation methods on multiple platforms.

Setup

Please refer to the official r10k docs for specific configuration patterns.

Prefix Example

Instead of passing a single remote, you can pass a puppet hash as the sources parameter. This allows you to configure r10k with prefix support. This often used when multiple teams use separate repos, or if hiera and puppet are distributed across two repos.

class { 'r10k':
  sources => {
    'webteam' => {
      'remote'  => 'ssh://[email protected]/webteam/somerepo.git',
      'basedir' => "${::settings::codedir}/environments",
      'prefix'  => true,
    },
    'secteam' => {
      'remote'  => 'ssh://[email protected]/secteam/someotherrepo.git',
      'basedir' => '/some/other/basedir',
      'prefix'  => true,
    },
  },
}

What r10k affects

  • Installation of the r10k gem
  • Installation of ruby when not using an existing ruby stack i.e. when using puppet_gem
  • Management of the r10k.yaml in /etc
  • Installation and configuration of a sinatra app when using the webhook.

Version chart

Gem installation is pinned to a default version in this module, the following chart shows the gem installation tested with the respective module version. You can override this by passing the version parameter.

Module Version r10k Version
v4.0.0+ Latest Version
v3.0.x 1.5.1
v2.8.2 1.5.1
v2.7.x 1.5.1
v2.6.5 1.4.1
v2.5.4 1.4.0
v2.4.4 1.3.5
v2.3.1 1.3.4
v2.3.0 1.3.2
v2.2.8 1.3.1
v2.2.x 1.1.0

Setup Requirements

r10k connects via ssh and does so silently in the background, this typically requires ssh keys to be deployed in advance of configuring r10k. This includes the known host ( public ) key of the respective git server, and the user running r10k's private key used to authenticate git/ssh during background runs. If you are going to use git repos to retrieve modules, you also need git installed.

Here is an example of deploying the git package and ssh keys needed for r10k to connect to a repo called puppet/control on a gitlab server. This is helpful when you need to automatically deploy new masters

package { 'git':
  ensure => installed,
}

#https://docs.puppetlabs.com/references/latest/type.html#sshkey
sshkey { 'your.internal.gitlab.server.com':
  ensure => present,
  type   => 'ssh-rsa',
  target => '/root/.ssh/known_hosts',
  key    => '...+dffsfHQ==',
}

# Resource git_webhook is provided by https://github.com/bjvrielink/abrader-gms/tree/fixup
git_deploy_key { 'add_deploy_key_to_puppet_control':
  ensure       => present,
  name         => $facts['networking']['fqdn'],
  path         => '/root/.ssh/id_dsa.pub',
  token        => hiera('gitlab_api_token'),
  project_name => 'puppet/control',
  server_url   => 'http://your.internal.gitlab.server.com',
  provider     => 'gitlab',
}

A simple example of creating an ssh private key would use an exec to call yes y | ssh-keygen -t dsa -C "r10k" -f /root/.ssh/id_dsa -q -N ''. The example above shows using git_deploy_key which would deploy that key to the remote git server via its api. This is often required in the programtic creation of compile masters.

Given r10k will likely be downloading your modules, often on the first server it's run on, you will have to puppet apply this module to bootstrap this configuration and allow for ongoing management from there.

Beginning with r10k

The simplest example of using it would be to declare a single remote that would be written to r10k.yaml.

class { 'r10k':
  remote => '[email protected]:someuser/puppet.git',
}

This will configure /etc/r10k.yaml and install the r10k gem after installing ruby using the puppetlabs/ruby module.

It also supports installation via multiple providers, such as installation in the puppet_enterprise ruby stack in versions less than 3.8

Installing into the Puppet Enterprise ruby stack in PE 2015.x

class { 'r10k':
  remote   => '[email protected]:someuser/puppet.git',
  provider => 'puppet_gem',
}

Note: It is recommended you migrate to using the pe_r10k module which is basically a clone of this modules features and file tickets for anything missing.

Using an internal gem server

Depending on implementation requirements, there are two ways to use alternate gem sources.

The gemrc approach

Create a global gemrc for Puppet Enterprise to add the local gem source. See http://projects.puppetlabs.com/issues/18053#note-12 for more information.

file { '/opt/puppet/etc':
  ensure => 'directory',
  owner  => 'root',
  group  => '0',
  mode   => '0755',
}

file { 'gemrc':
  ensure  => 'file',
  path    => '/opt/puppet/etc/gemrc',
  owner   => 'root',
  group   => '0',
  mode    => '0644',
  content => "---\nupdate_sources: true\n:sources:\n- http://your.internal.gem.server.com/rubygems/\n",
}

class { 'r10k':
  remote   => '[email protected]:someuser/puppet.git',
  provider => 'pe_gem',
  require  => File['gemrc'],
}

The parameter approach

Add gem_source to declaration.

class { 'r10k':
  remote      => '[email protected]:someuser/puppet.git',
  provider    => 'gem',
  gem_source  => 'https://some.alternate.source.com/',
}

Mcollective Support

alt tag

An mcollective agent is included in this module which can be used to do on demand synchronization. This mcollective application and agent can be installed on all masters using the following class Note: You must have mcollective already configured for this tool to work, Puppet Enterprise users will automatically have mcollective configured. This class does not restart the mcollective or pe-mcollective server on the nodes to which it is applied, so you may need to restart mcollective for it to see the newly installed r10k agent.

include r10k::mcollective

Using mco you can then trigger mcollective to call r10k using

mco r10k synchronize

You can sync an individual environment using:

mco r10k deploy <environment>

Note: This implies -p

You can sync an individual module using:

mco r10k deploy_module <module>

If you are required to run r10k as a specific user, you can do so by passing the user parameter:

mco r10k synchronize user=r10k

To obtain the output of running the shell command, run the agent like this:

mco rpc r10k synchronize -v

An example post-receive hook is included in the files directory. This hook can automatically cause code to synchronize on your servers at time of push in git. More modern git systems use webhooks, for those see below.

Passing proxy info through mco

The mcollective agent can be configured to supply r10k/git environment http_proxy, https_proxy variables via the following example

class { 'r10k::mcollective':
  http_proxy     => 'http://proxy.example.lan:3128',
  git_ssl_no_verify => 1,
}

Install mcollective support for post receive hooks

Install the mco command from the puppet enterprise installation directory i.e.

cd ~/puppet-enterprise-3.0.1-el-6-x86_64/packages/el-6-x86_64
sudo rpm -i pe-mcollective-client-2.2.4-2.pe.el6.noarch.rpm

Copy the peadmin mcollective configuration and private keys from the certificate authority (puppet master)

/var/lib/peadmin/.mcollective
/var/lib/peadmin/.mcollective.d/mcollective-public.pem
/var/lib/peadmin/.mcollective.d/peadmin-cacert.pem
/var/lib/peadmin/.mcollective.d/peadmin-cert.pem
/var/lib/peadmin/.mcollective.d/peadmin-private.pem
/var/lib/peadmin/.mcollective.d/peadmin-public.pem

Ensure you update the paths in ~/.mcollective when copying to new users whose name is not peadmin. Ideally mcollective will be used with more then just the peadmin user's certificate in the future. That said, if your git user does not have a home directory, you can rename .mcollective as /etc/client.cfg and copy the certs to somewhere that is readable by the respective user.

/home/gitolite/.mcollective
/home/gitolite/.mcollective.d/mcollective-public.pem
/home/gitolite/.mcollective.d/peadmin-cacert.pem
/home/gitolite/.mcollective.d/peadmin-cert.pem
/home/gitolite/.mcollective.d/peadmin-private.pem
/home/gitolite/.mcollective.d/peadmin-public.pem

Note: PE2 only requires the .mcollective file as the default auth was psk

Removing the mcollective agent

class { 'r10k::mcollective':
  ensure => false,
}

This will remove the mcollective agent/application and ddl files from disk. This likely would be if you are migrating to Code manager in Puppet Enterprise.

Webhook Support

alt tag For version control systems that use web driven post-receive processes you can use the example webhook included in this module. When the webhook receives the post-receive event, it will synchronize environments on your puppet masters. These settings are all configurable for your specific use case, as shown below in these configuration examples.

NOTE: MCollective and Bolt aren't currently supported with Webhook Go. This will be addressed in a future release of Webhook Go, but is an issue related to the complex nature of Bolt and MCollective/Choria commands that cause issues with the way Go executes shell commands.

Webhook Github Enterprise - Non Authenticated

This is an example of using the webhook without authentication. The git_webhook type will use the api token to add the webhook to the "control" repo that contains your puppetfile. This is typically useful when you want to automate the addition of the webhook to the repo.

# Instead of running via mco, run r10k directly
class {'r10k::webhook::config':
  use_mcollective => false,
}

class {'r10k::webhook':
  ensure         => true,
  server         => {
    protected => false,
  },
}

# Add webhook to control repository ( the repo where the Puppetfile lives )
#
# Resource git_webhook is provided by https://github.com/bjvrielink/abrader-gms/tree/fixup
git_webhook { 'web_post_receive_webhook' :
  ensure       => present,
  webhook_url  => 'http://master.of.masters:8088/payload',
  token        =>  hiera('github_api_token'),
  project_name => 'organization/control',
  server_url   => 'https://your.github.enterprise.com',
  provider     => 'github',
}


# Add webhook to module repo if we are tracking branch in Puppetfile i.e.
# mod 'module_name',
#  :git    => 'http://github.com/organization/puppet-module_name',
#  :branch => 'master'
# The module name is determined from the repo name , i.e. <puppet-><module_name>
# All characters with left and including any hyphen are removed i.e. <puppet->
#
# Resource git_webhook is provided by https://github.com/bjvrielink/abrader-gms/tree/fixup
git_webhook { 'web_post_receive_webhook_for_module' :
  ensure       => present,
  webhook_url  => 'http://master.of.masters:8088/module',
  token        =>  hiera('github_api_token'),
  project_name => 'organization/puppet-module_name',
  server_url   => 'https://your.github.enterprise.com',
  provider     => 'github',
}

Webhook Github Example - Authenticated

This is an example of using the webhook with authentication. The git_webhook type will use the api token to add the webhook to the "control" repo that contains your puppetfile. This is typically useful when you want to automate the addition of the webhook to the repo.

# Instead of running via mco, run r10k directly
class {'r10k::webhook::config':
  use_mcollective => false,
}

# External webhooks often need authentication and ssl and authentication
# Change the url below if this is changed

class {'r10k::webhook':
  ensure => true,
  server => {
      protected => true,
  },
  tls    => {
      enabled     => true,
      certificate => '/path/to/ssl/certificate',
      key         => '/path/to/ssl/key',
  },
}

# Add webhook to control repository ( the repo where the Puppetfile lives )
#
# Resource git_webhook is provided by https://github.com/bjvrielink/abrader-gms/tree/fixup
git_webhook { 'web_post_receive_webhook' :
  ensure             => present,
  webhook_url        => 'https://puppet:[email protected]:8088/payload',
  token              =>  hiera('github_api_token'),
  project_name       => 'organization/control',
  server_url         => 'https://api.github.com',
  disable_ssl_verify => true,
  provider           => 'github',
}

# Add webhook to module repo if we are tracking branch in Puppetfile i.e.
# mod 'module_name',
#  :git    => 'http://github.com/organization/puppet-module_name',
#  :branch => 'master'
# The module name is determined from the repo name , i.e. <puppet-><module_name>
# All characters with left and including any hyphen are removed i.e. <puppet->
#
# Resource git_webhook is provided by https://github.com/bjvrielink/abrader-gms/tree/fixup
git_webhook { 'web_post_receive_webhook_for_module' :
  ensure       => present,
  webhook_url  => 'https://puppet:[email protected]:8088/module',
  token        =>  hiera('github_api_token'),
  project_name => 'organization/puppet-module_name',
  server_url   => 'https://api.github.com',
  disable_ssl_verify => true,
  provider     => 'github',
}

Webhook Bitbucket Example

This is an example of using the webhook with Atlassian Bitbucket (former Stash). Requires the external hooks addon by https://marketplace.atlassian.com/plugins/com.ngs.stash.externalhooks.external-hooks/server/overview and a specific Bitbucket user/pass. Remember to place the stash_mco.rb on the bitbucket server an make it executable. Enable the webhook over the repository settings External Async Post Receive Hook:

  • Executable: e.g. /opt/atlassian/bitbucket-data/external-hooks/stash_mco.rb (see hook_exe)
  • Positional parameters: -t http://git.example.com:8088/payload
# Add deploy key
git_deploy_key { 'add_deploy_key_to_puppet_control':
  ensure       => present,
  name         => $facts['networking']['fqdn'],
  path         => '/root/.ssh/id_rsa.pub',
  username     => 'api',
  password     => 'pass',
  project_name => 'project',
  repo_name    => 'puppet',
  server_url   => 'https://git.example.com',
  provider     => 'stash',
}

# Add webhook
git_webhook { 'web_post_receive_webhook' :
  ensure       => present,
  webhook_url  => 'https://puppet:[email protected]:8088/module',
  password     => 'pass',
  username     => 'api',
  project_name => 'project',
  repo_name    => 'puppet',
  server_url   => 'https://git.example.com',
  provider     => 'stash',
  hook_exe     => '/opt/atlassian/bitbucket-data/external-hooks/stash_mco.rb',
}

Webhook - remove webhook init script and config file.

For use when moving to Code Manager, or other solutions, and the webhook should be removed.

class {'r10k::webhook':
  ensure => false,
}

Webhook Prefix Example

Prefixing the command is currently not supported in Webhook Go. This support is expected to be added with a later release.

Webhook FOSS support with MCollective

MCollective is currently unsupported by Webhook Go. This is expected to be added in a future release and documentation will be updated for that then.

Webhook Slack notifications

You can enable Slack notifications for the webhook. You will need a Slack webhook URL and the slack-notifier gem installed.

To get the Slack webhook URL you need to:

  1. Go to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks.
  2. Choose your team, press Configure.
  3. In configurations press Add configuration.
  4. Choose channel, press Add Incoming WebHooks integration.

Then configure the webhook to add your Slack Webhook URL.

class { 'r10k::webhook':
  . . .
  chatops => {
      enabled    => true,
      service    => 'slack',
      server_uri => 'http://slack.webhook/webhook', # mandatory for usage
      channel    => '#channel', # defaults to #default
      user       => 'r10k', # the username to use
      auth_token => "SLACKAUTHTOKEN",
    }
  }

Webhook Rocket.Chat notifications

You can enable Rocket.Chat notifications for the webhook. You will need a Rocket.Chat incoming webhook URL and the rocket-chat-notifier gem installed.

To get the Rocket.Chat incoming webhook URL you need to:

  1. Go to your Rocket.Chat and then select Administration-Integrations.
  2. Choose New integration.
  3. Choose Incoming WebHook. In the webhook form configure:
  • Enabled: True.
  • Name: A name for your webhook.
  • Post to Channel: The channel to post to by default.
  1. Save changes with Save Changes bottom.

Then configure the webhook to add your Rocket.Chat Webhook URL.

class { 'r10k::webhook':
  . . .
  chatops => {
    enabled    => true,
    service    => 'rocketchat',
    server_uri => '<your incoming webhook URL>',
    user       => 'username',
    channel    => '#channel',
    auth_token => 'ROCKETCHATAUTHTOKEN',
  }
}

Webhook Default Branch

The default branch of the controlrepo is commonly called production. This value can be overridden if you use another default branch name, such as master.

class { 'r10k::webhook':
  ensure => true,
  r10k   => {
    default_branch => 'master', # Optional. Defaults to 'production'
  },
}

Triggering the webhook from curl

To aid in debugging, or to give you some hints as to how to trigger the webhook by unsupported systems, here's a curl command to trigger the webhook to deploy the 'production' environment:

curl --header "X-Gitlab-Event: Push Hook" -d '
  {
    "repository": {"name": "foo", "owner": {"login": "foo"}},
    "ref": "production"
  }' http://puppet-master.example:4000/api/v1/r10k/environment

If you are utilizing environment prefixes, you'll need to specify the full environment title (including the prefix) in the 'ref' parameter:

curl --header "X-Gitlab-Event: Push Hook" -d '
  {
    "repository": {"name": "bar", "owner": {"login": "foo"}},
    "ref": "bar_production"
  }' http://puppet-master.example:4000/api/v1/r10k/environment

Troubleshooting

If you're not sure whether your webhook setup works:

  • Try to make a GET request to the heartbeat endpoint (e.g. http://puppet-master.example:8088/heartbeat).  You should see a short JSON answer similar to {"status":"success","message":"running"}.
  • Watch the webhook logfile at /var/log/webhook/access.log, and send requests (e.g. using curl). Example output if successful:
$ journalctl -f -u webhook-go.service
...
Jun 05 11:24:54 pop-os systemd[1]: Started Puppet Deployment API Server....

Docker

If you are building your image with the puppet, you need to prevent the webhook process from starting as a daemon.

The following is an example of declaring the webhook without a background mode

class { 'r10k::webhook':
  ensure => false,
}

Ignore deploying some environments

Webhook Go does not support this yet, but will in the future.

Reference

Class: r10k

This is the main public class to be declared , handingly installation and configuration declarations

Parameters within r10k:

remote

A string to be passed in as the source with a hardcode prefix of puppet

sources

A hash of all sources, this gets read out into the file as yaml. Must not be declared with remote

cachedir

A single string setting the r10k.yaml configuration value of the same name

configfile

A path to the configuration file to manage. Be aware Puppet Enterprise 4.0 and higher may conflict if you manage /etc/puppetlabs/puppet/r10k.yaml

version

A value passed to the package resource for managing the gem version

modulepath

Deprecated: for older configfile environments configuration of modulepath in puppet.conf

manage_modulepath

Deprecated: declare a resource for managing modulepath in Puppet.conf

manage_ruby_dependency

When using system ruby , options on how to declare

proxy

A string setting ther10k.yaml configuration value of the same name

gem_source

An optional string specifying location to retrieve gem

pool_size

Integer defining how many threads should be spawn while updating modules. Only available for r10k >= 3.3.0.

r10k_basedir

This module requires the puppetlabs-ruby module. In the event that your environment already includes the module with some customization, you can use the manage_ruby_dependency parameter to adjust how this module expresses that requirement. The supported values are include,declare, or ignore. The values' behavior is outlined below:

  • declare default This will explicitly declare the ruby module. Additional declarations of the ruby module will result in an inability to compile a catalog.

  • include This will simply include the ruby module. When combined with class ordering, this will permit the user to manage the instantiation of the ruby module elsewhere, potentially with non-standard parameter values.

  • ignore This will assume that ruby is handled via some other mechanism than a puppet module named ruby. It is left to the user to insure the requirement be met.

package_name

The name of the package to be installed via the provider

provider

The supported installation modes for this module

  • bundle
  • puppet_gem
  • gem
install_options

Options to pass to the provider declaration

mcollective

Install mcollective application and agents. This does NOT configure mcollective automatically

manage_configfile_symlink

Manage a symlink to the configuration file, for systems installed in weird file system configurations

git_settings

This is the git: key in r10k, it accepts a hash that can be used to configure rugged support.

    $git_settings = {
      'provider'    => 'rugged',
      'private_key' => '/root/.ssh/id_rsa',
    }

    class {'r10k':
      remote       => '[email protected]:acidprime/puppet.git',
      git_settings => $git_settings,
    }
forge_settings

This is the forge: key in r10k, it accepts a hash that contains settings for downloading modules from the Puppet Forge.

    $forge_settings = {
      'proxy'   => 'https://proxy.example.com:3128',
      'baseurl' => 'https://forgeapi.puppetlabs.com',
    }

    class {'r10k':
      remote         => '[email protected]:acidprime/puppet.git',
      forge_settings => $forge_settings,
    }
deploy_settings

This is the deploy: key in r10k, it accepts a hash that contains setting that control how r10k code deployments behave. Documentation for the settings can be found here.

    $deploy_settings = {
      'purge_levels' => ['puppetfile'],
    }

    class {'r10k':
      remote          => '[email protected]:voxpupuli/puppet.git',
      deploy_settings => $deploy_settings,
    }
configfile_symlink

boolean if to manage symlink

include_prerun_command

Deprecated: Add prerun_command to puppet.conf to run r10k when the agent on the master runs. Suggest instead declaring r10k::postrun_command as that will run after the agent runs which prevents r10k from stopping configuration management of masters from occurring as it does with prerun_commands

include_postrun_command
r10k::include_postrun_command: true

The concept here is that this is declared on the puppet master(s) that have been configured with r10k. This will cause r10k to synchronize after each puppet run. Any errors synchronizing will be logged to the standard puppet run.

Limitations

The 4.1.x release deprecates support for:

  • Puppet 3
  • Ruby 1.9.3

These items are planned for removal in v5.0.0.

Support

Please log tickets and issues at our Projects site

Development

Contributing

Modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

Please see CONTRIBUTING for more details.

Running tests

This project contains tests for rspec-puppet to verify functionality. For in-depth information please see their respective documentation, as well as CONTRIBUTING.

Quickstart:

    gem install bundler
    bundle install --without system_tests
    bundle exec rake test
    bundle exec rake lint

Check the .travis.yml for supported Operating System Versions

puppet-r10k's People

Contributors

abrader avatar acidprime avatar alexjfisher avatar bastelfreak avatar binford2k avatar dhollinger avatar dhoppe avatar ekohl avatar elyscape avatar formorer avatar ghoneycutt avatar jhoblitt avatar johnzimm avatar kenyon avatar llowder avatar luckyraul avatar ncstate-mafields avatar nike38rus avatar poikilotherm avatar rnelson0 avatar robbat2 avatar smithtrevor avatar smortex avatar tampakrap avatar trlinkin avatar tuxmea avatar vchepkov avatar venushka avatar whatsaranjit avatar zilchms 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

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  avatar  avatar  avatar

puppet-r10k's Issues

Dependency on puppetlabs-ruby constrains use

The puppetlabs-ruby module only supports Debian and Redhat based systems, so when I attempt to use this r10k module on another OS, (e.g. OS X/Darwin), it fails.

It would be a nice enhancement if there was a way to use this r10k module on a broader set of machines....

PE 3.7.0 breaks webhook, peadmin cert name changed

Error: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:44:in initialize': No such file or directory - /var/lib/peadmin/.mcollective.d/peadmin-cert.pem (Errno::ENOENT) from /usr/local/bin/webhook:44:inopen'
from /usr/local/bin/webhook:44:in <main>' [FAILED] Wrapped exception: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:44:ininitialize': No such file or directory - /var/lib/peadmin/.mcollective.d/peadmin-cert.pem (Errno::ENOENT)
from /usr/local/bin/webhook:44:in open' from /usr/local/bin/webhook:44:in

'
[FAILED]
Error: /Stage[main]/R10k::Webhook/Service[webhook]/ensure: change from stopped to running failed: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:44:in initialize': No such file or directory - /var/lib/peadmin/.mcollective.d/peadmin-cert.pem (Errno::ENOENT) from /usr/local/bin/webhook:44:inopen'
from /usr/local/bin/webhook:44:in <main>' [FAILED] Notice: Finished catalog run in 12.07 seconds [root@xmaster environments]# /sbin/service webhook start Starting webhook: /usr/local/bin/webhook:44:ininitialize': No such file or directory - /var/lib/peadmin/.mcollective.d/peadmin-cert.pem (Errno::ENOENT)
from /usr/local/bin/webhook:44:in open' from /usr/local/bin/webhook:44:in'


ls -al /var/lib/peadmin/.mcollective.d
dr-x------ 2 peadmin peadmin 4096 Dec 11 00:12 .
drwx------ 5 peadmin peadmin 4096 Dec 11 00:12 ..
-r-------- 1 peadmin peadmin 2139 Dec 11 00:12 ca.cert.pem
-rw------- 1 peadmin peadmin 0 Dec 11 00:12 client.log
-r-------- 1 peadmin peadmin 800 Dec 11 00:12 mcollective-public.pem
-r-------- 1 peadmin peadmin 3243 Dec 11 00:12 peadmin-private.pem
-r-------- 1 peadmin peadmin 800 Dec 11 00:12 peadmin-public.pem

Add release tag for 2.3.1

The module version was bumped and 2.3.1 appears on Puppet Forge. If the Puppetfile references your github project URL, 2.3.0 is the latest tag available currently.

mco r10k sync leave environment in a broken state

I got rid of all 'forge' modules as a workaround for #65 and replaced them all with 'git' modules
Modules get deployed, but an environment gets corrupted, with modules form "main" repository absent.
and the following error if I try to run r10k again:

[R10K::TaskRunner - ERROR] Task #<R10K::Task::Environment::Deploy:0x000000016ade88> failed while running: Command git clone --reference /var/cache/r10k/[email protected] [email protected]:/bp/puppet-bna.git /etc/puppetlabs/puppet/environments/development exited with 128: fatal: destination path '/etc/puppetlabs/puppet/environments/development' already exists and is not an empty directory.
# cat /etc/r10k.yaml 
:cachedir: /var/cache/r10k
:sources:
  puppet:
    basedir: /etc/puppetlabs/puppet/environments
    remote: [email protected]:/bp/puppet-bna.git

:purgedirs:
  - /etc/puppetlabs/puppet/environments

If I remove environment directory and run r10k again - it works normal until something make environment to break again.

Could not find declared class ::ruby at /etc/puppet/modules/r10k/manifests/install/gem.pp:10

Assume for this that /etc/puppet/modules contains:
a.) r10k (latest checkout from github)
b.) deploy_r10k, module which contains a manifests/init.pp that looks like:

cat manifests/init.pp
class { 'r10k':
remote => '[email protected]:org/puppet.git',
}

When trying to install by applying:

puppet apply manifests/init.pp
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::ruby at /etc/puppet/modules/r10k/manifests/install/gem.pp:10 on node puppet01.domain.tld
Wrapped exception:
Could not find declared class ::ruby
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::ruby at /etc/puppet/modules/r10k/manifests/install/gem.pp:10 on node puppet01.domain.tld

r10k::include_prerun_command doesn't apply changes during the current run

I tried to use r10k::include_prerun_command to push changes from git hooks, but it doesn't seem to work as intended. If puppet master is managed by puppet itself it doesn't apply committed changes after the commit.

Here is how I reproduced the problem.

I made this commit:

$ git log -p -1
commit f0ceb4037abb4e95dff11af176f309c5e8215b4a
Author: Vadym Chepkov <[email protected]>
Date:   Sun Aug 10 12:12:25 2014 -0400

    Added debugging statement

diff --git a/manifests/master.pp b/manifests/master.pp
index 5822001..08b187d 100644
--- a/manifests/master.pp
+++ b/manifests/master.pp
@@ -1,4 +1,5 @@
 # puppet master server
 node 't100' {
   include role::puppet_master
+  notify {"Applying catalog":}
 }

I see that agent did a run, but no debug output:

Aug 10 16:12:27 t100 puppet-agent[16198]: Caught USR1; calling reload
Aug 10 16:12:35 t100 puppet-master[24426]: Compiled catalog for t100.chepkov.lan in environment production in 4.02 seconds
Aug 10 16:12:54 t100 puppet-agent[24703]: Finished catalog run in 14.06 seconds

And yet environment has been updated:

# git -C /etc/puppetlabs/puppet/environments/production/ log  -1
commit 67ab4c73ac7dd76686b7a8fb3ffc4b00006539a1
Author: Vadym Chepkov <[email protected]>
Date:   Sun Aug 10 12:12:25 2014 -0400

    Added debugging statement

Only second run produces the result:

Aug 10 16:18:50 t100 puppet-agent[16198]: Caught USR1; calling reload
Aug 10 16:18:59 t100 puppet-master[24426]: Compiled catalog for t100.chepkov.lan in environment production in 4.10 seconds
Aug 10 16:19:07 t100 puppet-agent[26629]: Applying catalog
Aug 10 16:19:07 t100 puppet-agent[26629]: (/Stage[main]/Main/Node[t100]/Notify[Applying catalog]/message) defined 'message' as 'Applying catalog'
Aug 10 16:19:16 t100 puppet-master[27568]: Starting Puppet master version 3.6.2 (Puppet Enterprise 3.3.1)
Aug 10 16:19:19 t100 puppet-agent[26629]: Finished catalog run in 15.76 seconds

I guess the question is, why?

Thanks,
Vadym

rubygems-update makes r10k non idempotent on fresh install

The R10K module must be invoked twice on fresh RHEL based systems running older releases of rubygems in order for R10K to be properly installed.

When installing R10K > 1.0.0, there is no ordering relationship between the R10K gem, and the inclusion of the puppetlabs-ruby module. On fresh systems, this causes the R10K gem to be installed before the Ruby module is applied.

The ruby module installs and invokes rubygems-update. Among other things, rubygems-updates causes all existing modules (including the newly installed R10K gem) to be removed.

As a result, the R10K module is not idempotent on fresh CentOS installs. The R10K module must be applied twice in order for R10K to be installed, or rubygems-update must be manually installed and invoked before applying the R10K module.

r10k does not run sometimes

It seems as though r10k doesn't always run. On occasion the output will be

[R10K::Task::Deployment::DeployEnvironments - INFO] Loading environments from all sources
[R10K::Task::Environment::Deploy - NOTICE] Deploying environment master
[R10K::Task::Puppetfile::Sync - INFO] Loading modules from Puppetfile into queue
[SSH] exit-status: 0

I have not found a rhyme or reason to this, but I"m using a jenkins job to redeploy r10k when modules change, and this pretends it did when it actually did not. If I were to re-run this same command, it would most likely do it successfully. The process should either report something that I can grep for that it won't re-deploy, or ensure it happens every time.

Option to NOT install the r10k package

Ge this horrible broken error when trying to install r10k gem using this module:

Error: Could not update: Execution of '/usr/bin/gem install -v 1.1.0 --no-rdoc --no-ri r10k ' returned 1: ERROR: Can't use --version w/ multiple gems. Use name:ver instead.
Wrapped exception:
Execution of '/usr/bin/gem install -v 1.1.0 --no-rdoc --no-ri r10k ' returned 1: ERROR: Can't use --version w/ multiple gems. Use name:ver instead.
Error: /Stage[main]/R10k::Install/Package[r10k]/ensure: change from 1.3.2 to 1.1.0 failed: Could not update: Execution of '/usr/bin/gem install -v 1.1.0 --no-rdoc --no-ri r10k ' returned 1: ERROR: Can't use --version w/ multiple gems. Use name:ver instead.
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list rubygems-bundler' returned 1: Error: No matching Packages to list
Error: /Stage[main]/Ruby::Dev/Package[rubygems-bundler]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list rubygems-bundler' returned 1: Error: No matching Packages to list

It worked fine when I was installing it using my own Puppet package class. Please add an option to NOT install the r10k package.

Ubuntu 14.04 webhook init fails

When running the PE master and r10k on Ubuntu 14.04 the webhook init script will fail.

Line's 17/18 of the erb template include

Source function library.

. /etc/rc.d/init.d/functions

Is it sufficient to ln -s /lib/lsb/functions to /etc/rc.d/init.d/functions? This appears to allow the code to execute, but I'm not sure it is functionally equivalent.

It might be worth stating that the daemon package has to be installed through apt-get in order to run this code without error as well.

Exit status 42. Is that a git not found in path error?

peadmin@enterprise-dev:~$ mco rpc r10k environment -v
Discovering hosts using the mc method for 2 second(s) .... 1

  • [ ============================================================> ] 1 / 1

enterprise-dev.ops.puppetlabs.net : OK
{:output=>"", :error=>"", :status=>42}

---- r10k#environment call stats ----
Nodes: 1 / 1
Pass / Fail: 1 / 0
Start Time: 2013-10-03 10:09:09 -0700
Discovery Time: 2027.80ms
Agent Time: 78.43ms
Total Time: 2106.23ms

Deploy single environment and prerun_command

Thanks for this awesome module first of all!

I wonder if i can configure prerun_command to deploy a single env?

I have many environments and waiting for all of them to deploy for testing a small fix in one of them makes me crazy.

Deprecation warning

agent.rb:234:in metadata' r10k.rb:10:inclass:R10k': setting meta data in agents have been deprecated, DDL files are now being used for this information.

Require Git

R10k on a brand new system fails if git is not available.

install fails on PE 3.2.2 due to Puppet Module Tool Bug

On a clean install of PE 3.2.3, RHEL 6.4, I get an error:

error snippet:

Error: No such file or directory - /etc/puppetlabs/puppet/modules/r10k/spec/fixtures/modules/r10k/files

Full stack:

puppet module install zack/r10k --debug --version 1.0.2

Notice: Preparing to install into /etc/puppetlabs/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=zack-r10k
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-stdlib
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-stdlib&limit=20&offset=20
Notice: Found at least one version of puppetlabs-stdlib compatible with PE (3.2.3);
Notice: Skipping versions which don't express PE compatibility. To install
the most recent version of the module regardless of compatibility
with PE, use the '--ignore-requirements' flag.
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-ruby
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-gcc
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-pe_gem
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=mhuffnagle-make
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-inifile
Notice: Found at least one version of puppetlabs-inifile compatible with PE (3.2.3);
Notice: Skipping versions which don't express PE compatibility. To install
the most recent version of the module regardless of compatibility
with PE, use the '--ignore-requirements' flag.
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-vcsrepo
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-git
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=gentoo-portage
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-concat
Notice: Found at least one version of puppetlabs-concat compatible with PE (3.2.3);
Notice: Skipping versions which don't express PE compatibility. To install
the most recent version of the module regardless of compatibility
with PE, use the '--ignore-requirements' flag.
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=ripienaar-concat
Info: Resolving dependencies ...
Info: Preparing to install ...
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/zack-r10k-1.0.2.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/zack-r10k20140513-15637-hrn7bv --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-v98unf'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-v98unf -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-v98unf -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-v98unf'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/puppetlabs-ruby-0.1.0.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/puppetlabs-ruby20140513-15637-m9b7pl --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-ddp3g4'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-ddp3g4 -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-ddp3g4 -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-ddp3g4'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/puppetlabs-gcc-0.1.0.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/puppetlabs-gcc20140513-15637-o9857r --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-y1vi5s'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-y1vi5s -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-y1vi5s -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-y1vi5s'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/mhuffnagle-make-0.0.2.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/mhuffnagle-make20140513-15637-1eypmms --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-1sa7ryj'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-1sa7ryj -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-1sa7ryj -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-1sa7ryj'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/puppetlabs-vcsrepo-0.2.0.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/puppetlabs-vcsrepo20140513-15637-1adawzc --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-13ktisn'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-13ktisn -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-13ktisn -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-13ktisn'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/gentoo-portage-2.1.0.tar.gz
Debug: Executing 'tar xzf /var/opt/lib/pe-puppet/puppet-module/cache/gentoo-portage20140513-15637-xlpr8l --no-same-owner -C /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-l2swtt'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-l2swtt -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-l2swtt -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 /var/opt/lib/pe-puppet/puppet-module/cache/tmp-unpacker20140513-15637-l2swtt'
Notice: Installing -- do not interrupt ...
Error: No such file or directory - /etc/puppetlabs/puppet/modules/r10k/spec/fixtures/modules/r10k/files

There is a broken sym link from a test directory.. at this point the ./r10k/files directory doesn't exist.. and

$ ll /etc/puppetlabs/puppet/modules/r10k/spec/fixtures/modules/r10k/files
/etc/puppetlabs/puppet/modules/r10k/spec/fixtures/modules/r10k/files -> ../../../../files

 ll /etc/puppetlabs/puppet/modules/r10k/
drwxr-xr-x 4 root pe-puppet 4096 May 13 08:31 spec

Cannot install on PE3.0

Get the following:

# puppet module install zack/r10k
Notice: Preparing to install into /etc/puppetlabs/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Error: Could not install module 'zack-r10k' (latest: v0.0.2)
  No version of 'puppetlabs-stdlib' will satisfy dependencies
    'puppetlabs-apt' (v1.1.0) requires 'puppetlabs-stdlib' (>= 2.2.1)
    'puppetlabs-auth_conf' (v0.1.6) requires 'puppetlabs-stdlib' (>= 2.5.1)
    'puppetlabs-pe_accounts' (v2.0.1) requires 'puppetlabs-stdlib' (v3.2.x)
    'puppetlabs-pe_mcollective' (v0.1.12) requires 'puppetlabs-stdlib' (v3.2.x)
    'puppetlabs-pe_puppetdb' (v0.0.7) requires 'puppetlabs-stdlib' (>=3.2.0)
    'puppetlabs-postgresql' (v2.3.0) requires 'puppetlabs-stdlib' (>=3.2.0 <5.0.0)
    'puppetlabs-puppet_enterprise' (v3.0.0) requires 'puppetlabs-stdlib' (v3.2.x)
    'puppetlabs-puppetdb' (v1.4.0) requires 'puppetlabs-stdlib' (>= 1.0.0)
    'puppetlabs-request_manager' (v0.0.9) requires 'puppetlabs-stdlib' (v3.2.x)
    'zack-r10k' (v0.0.2) requires 'puppetlabs-stdlib' (>= 4.1.0)
    Use `puppet module install --ignore-dependencies` to install only this module

Looks like a conflict on hard dependency of puppetlabs-pe_accounts/mcollective and zack-r10k modules.

Missing dependency on service mcollective

Hi,

I am trying to write a bootstrap module to configure puppet environment using r10k module.
It seems some dependency is missing to allow module to be used in standalone mode:

# cat bootstrap.pp
class { 'r10k':
  remote       => '[email protected]:vchepkov/puppet-bootstrap.git',
  mcollective  => true,
}

# puppet apply bootstrap.pp
Notice: Compiled catalog for t100.chepkov.lan in environment production in 2.82 seconds
Error: Could not find dependent Service[pe-mcollective] for File[/opt/puppet/libexec/mcollective/mcollective/application/r10k.rb] at /opt/puppet/share/puppet/modules/r10k/manifests/mcollective.pp:20

Cheers,
Vadym

breaking master when I apply r10k config

We have a fresh install of RHEL 6.4 with PE 3.2.3. I can install the zack-r10k module without any issue, it appears. However, once applying the r10k "setup" manifest to the master it's unable to pass info between client node and master... Even if that node is the master itself. For example, 'puppet agent --test' yields some html output indicating a passenger error:

Warning: Unable to fetch my node definition, but the agent run will continue:�[0m

�[1;31mWarning: Error 500 on SERVER:

...

Additionally, getting, "could not retrieve facts from inventory service 500 'internal server error'" in the console.

Contents of my r10k "setup" manifest are:

# cat r10k_installation.pp

if $::osfamily == 'redhat' {
  class { 'firewall': ensure => stopped, }
}

file { 'r10k environments dir':
  ensure   => directory,
  path     => '/etc/puppetlabs/puppet/environments',
}

class { 'r10k':
  version           => '1.3.0',

  sources           => {
    'puppet' => {
    'remote'  => 'https://bitbucket.org/prolixalias/puppet-r10k-environments',
    'basedir' => "${::settings::confdir}/environments",
    'prefix'  => false,
  },

  'hiera' => {
    'remote'  => 'https://bitbucket.org/prolixalias/puppet-r10k-hiera',
    'basedir' => "${::settings::confdir}/hiera",
    'prefix'  => true,
  }
},

purgedirs         => ["${::settings::confdir}/environments"],
manage_modulepath => true,
modulepath        => "${::settings::confdir}/environments/\$environment/modules:/opt/puppet/share/puppet/modules",
}

exec { 'r10k deploy environment --puppetfile':
  path     => ['/bin','/sbin','/usr/bin','/usr/sbin','/opt/puppet/bin'],
  require  => [Package['git'],File['r10k environments dir'],Class['r10k::install']],
}

ini_setting { 'master module path':
  ensure   => present,
  path     => '/etc/puppetlabs/puppet/puppet.conf',
  section  => 'main',
  setting  => 'modulepath',
  value    => '/etc/puppetlabs/puppet/environments/$environment/modules:/opt/puppet/share/puppet/modules',
}

ini_setting { 'master manifest path':
  ensure   => present,
  path     => '/etc/puppetlabs/puppet/puppet.conf',
  section  => 'main',
  setting  => 'manifest',
  value    => '/etc/puppetlabs/puppet/environments/$environment/manifests/site.pp',
}

NOTE: this all works in Vagrant CentOS and Ubuntu envs.

I'm at a loss on how to diagnose. Any guidance would be great.

does this module support Puppetfile?

It's either this module doesn't support Puppetfile or I am doing something wrong:

r10k puppetfile check --trace --verbose

Is silent

install command fails with --verbose:

# r10k puppetfile install --trace --verbose

Error while running: #<RuntimeError: Unrecognized options: verbose>
/opt/puppet/lib/ruby/gems/1.9.1/gems/r10k-1.1.0/lib/r10k/task_runner.rb:18:in `initialize'
/opt/puppet/lib/ruby/gems/1.9.1/gems/r10k-1.1.0/lib/r10k/cli/puppetfile.rb:40:in `new'
/opt/puppet/lib/ruby/gems/1.9.1/gems/r10k-1.1.0/lib/r10k/cli/puppetfile.rb:40:in `block (2 levels) in command'
/opt/puppet/lib/ruby/gems/1.9.1/gems/cri-2.4.1/lib/cri/command.rb:298:in `call'
/opt/puppet/lib/ruby/gems/1.9.1/gems/cri-2.4.1/lib/cri/command.rb:298:in `run_this'
/opt/puppet/lib/ruby/gems/1.9.1/gems/cri-2.4.1/lib/cri/command.rb:251:in `run'
/opt/puppet/lib/ruby/gems/1.9.1/gems/cri-2.4.1/lib/cri/command.rb:264:in `run'
/opt/puppet/lib/ruby/gems/1.9.1/gems/cri-2.4.1/lib/cri/command.rb:264:in `run'
/opt/puppet/lib/ruby/gems/1.9.1/gems/r10k-1.1.0/bin/r10k:7:in `<top (required)>'
/usr/bin/r10k:23:in `load'
/usr/bin/r10k:23:in `<main>'

Without --verbose it still does nothing either.

If it can't find what it's looking for, shouldn't verbose or trace output at least something?

Here is my Puppetfile, for reference

mod "vchepkov/puppetlabs-mysql", 
  :git => "git://github.com/vchepkov/puppetlabs-mysql.git",
  :ref => 'percona'

Thanks,
Vadym

Remove technology stack dependencies from installation process

I am using RVM (Ruby Version Manager) for managing ruby and do not want ruby package dependencies from the os package manager. My ruby environment is fully functional, but our gem provider e.g. forces me to use ruby os packages. Is there any way to get rid of that? This technology stack should be included in the user's profile and not in our r10k module.

prefix support

unless I've missed something, this module does not support r10k prefixing as a global option. may open PR later today.

Webhook sends incorrect command to r10k if branch name contains /

It's common in, for example, the git-flow workflow to use branch names with slashes in them (e.g. feature/webhook). Unfortunately, due to the way the webhook currently parses the POST requests, only the last part of the branch name gets sent to r10k (in the preceding example, webhook), which then fails because it can't find a branch with that name.

Versions and the Puppet Forge

I'm concerned somewhat by the fact that six versions were released yesterday (2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, and 2.4.2). It seems like most if not all of those could have been consolidated into a single release. Furthermore, not all of those versions have been pushed to Puppet Forge, crucially including 2.4.0, which is what is listed in the README as the version supporting r10k. I put 2.4.0 in my Puppetfile and received an error when r10k failed to retrieve it from the Forge.

Would it help if someone else were involved in the release process?

`pe_gem` install of the r10k gem is wonked

Haven't had time to debug this, but an extra space somewhere is causing pe_gem to attempt to install a gem named "", which clearly fails. It's a spurious failure, but it causes dependent resources to not be applied until the next Puppet run.

I'll track it down later.

Error: /Stage[main]/R10k::Install/Package[r10k]/ensure: change from absent to present failed: Execution of '/opt/puppet/bin/gem install --no-rdoc --no-ri r10k ' returned 2: ERROR:  Could not find a valid gem '' (>= 0) in any repository

(Feature) webhook should support github secrets

There is an ability of adding a secret to the payload instead of using basic auth I think the webhook should support his as the password stuff is a little weird in github atm for display and updates.

Feature Request: Updated doc to use hieradata for sources

This is a feature request to update the documentation to use hieradata for the r10k source configurations. Currently, we have the r10k class on our master and it drops a /etc/r10k.yaml with configuration data. I think it would be easier to maintain the r10k sources if it was externalized in hieradata common file, along with the other r10k config options that are being set.

Gem install error on Ubuntu 12.04 when specifying the version

Ubuntu 12.04
Puppet: 3.6.2
Ruby: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Gem: 2.3.0

Receiving the following gem error when running puppet apply on a basic manifest to install r10k:

returned 1: ERROR:  Can't use --version w/ multiple gems. Use name:ver instead

The manifest looks as follows:

class { 'r10k':
  version           => '1.2.1',
  sources           => {
    'puppet' => {
      'remote'  => 'https://github.com/glarizza/puppet_repository.git',
      'basedir' => "\${::settings::confdir}/environments",
      'prefix'  => false,
    }
  },
  purgedirs         => ["\${::settings::confdir}/environments"],
  manage_modulepath => true,
  modulepath        => "\${::settings::confdir}/environments/\$environment/modules:/opt/puppet/share/puppet/module$
}

Full eror output below:

Notice: /Stage[main]/R10k::Config/File[r10k.yaml]/content: content changed '{md5}9d7efc05dd744e3bb103d5d5a9dd16d4' to '{md5}f2cf801c542cd4ee0d7ea51e62bb2862'
Error: Could not update: Execution of '/usr/bin/gem install -v 1.2.1 --no-rdoc --no-ri r10k ' returned 1: ERROR:  Can't use --version w/ multiple gems. Use name:ver instead.
Wrapped exception:
Execution of '/usr/bin/gem install -v 1.2.1 --no-rdoc --no-ri r10k ' returned 1: ERROR:  Can't use --version w/ multiple gems. Use name:ver instead.
Error: /Stage[main]/R10k::Install/Package[r10k]/ensure: change from absent to 1.2.1 failed: Could not update: Execution of '/usr/bin/gem install -v 1.2.1 --no-rdoc --no-ri r10k ' returned 1: ERROR:  Can't use --version w/ multiple gems. Use name:ver instead.

update params.pp to the latest r10k?

I've been using r10k v1.2.x and v1.3.x with this module since they were released. The params.pp still defaults to v1.1.0. What do you think about bumping the default version to 1.3.0?

License

Hi de hi - any chance you could put the code under a license please?

Missing dependency on webhook after upgrade to PE 3.7.0

I'm not sure if managing the installation of rack is appropriate in webhook.pp because the webhook seemed to work fine before the upgrade to PE 3.7.0

I can submit a PR with the necessary updates unless there is a better place for this.

Error: /Stage[main]/R10k::Webhook/Service[webhook]/ensure: change from stopped to running failed: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /opt/puppet/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find rack (~> 1.4) amongst [addressable-2.3.5, autoparse-0.3.3, bigdecimal-1.1.0, builder-3.0.0, colored-1.2, cri-2.5.0, deep_merge-1.0.0, excon-0.14.1, extlib-0.9.16, faraday-0.8.8, faraday_middleware-0.9.1, faraday_middleware-multi_json-0.0.6, fog-1.5.0, formatador-0.2.0, google-api-client-0.6.4, guid-0.1.1, hiera-eyaml-2.0.4, hiera-eyaml-2.0.3, highline-1.6.21, io-console-0.3, json-1.5.5, json_pure-1.8.1, jwt-0.1.8, launchy-2.3.0, log4r-1.1.10, mime-types-1.16, minitest-2.5.1, multi_json-1.8.4, multi_json-1.8.0, multipart-post-1.2.0, net-scp-1.0.4, net-ssh-2.1.4, nokogiri-1.5.10, r10k-1.3.4, r10k-1.3.1, rack-protection-1.5.3, rake-0.9.2.2, rbvmomi-1.3.0, rdoc-3.9.5, ruby-hmac-0.4.0, signet-0.4.5, sinatra-1.4.5, systemu-2.5.2, tilt-1.4.1, trollop-2.0, trollop-1.16.2, uuidtools-2.1.4] (Gem::LoadError) from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:777:inblock in activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in each' from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:inactivate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:750:in activate' from /opt/puppet/lib/ruby/1.9.1/rubygems.rb:212:inrescue in try_activate'
from /opt/puppet/lib/ruby/1.9.1/rubygems.rb:209:in try_activate' from /opt/puppet/lib/ruby/1.9.1/rubygems/custom_require.rb:59:inrescue in require'
from /opt/puppet/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in require' from /usr/local/bin/webhook:11:in

'
[FAILED]

trouble with remote ssl posts from stash to the webhook

When using the webhook from a Atlassian stash server, I get the following in the access.log:
[2014-07-17 15:41:31] ERROR OpenSSL::SSL::SSLError: SSL_accept returned=1 errno=0 state=SSLv3 read client certificate A: sslv3 alert certificate unknown /opt/puppet/lib/ruby/1.9.1/openssl/ssl-internal.rb:172:in `accept'

Things work fine when testing with curl from the stash server, but they fail when stash posts directly. The message makes me think that stash is sending a client cert, however the webhook is set to ignore/not ask for client certs.

I've not got the time to debug in detail right now, but I'm making a note here hoping that someone knows the answer off hand, or so that when I figure it out, I can share the info.

Ruby class is not singleton

For anyone using Ruby in their environments, using the r10k module presents a problem because of the way that ruby is included. It basically means that anyone doing an 'include ruby' anywhere in their puppet code is going to get a duplicate resource error.

Moving the to 'include ruby' here means that people can use ruby elsewhere also, though it doesn't solve the parameter being passed.

Documentation issues

Are the alternative installations really appropriate for documentation here? They don't seem to relate to the module really much at all, instead solving problems that might be related to connectivity or firewall issues that, in theory, someone attempting to use this module would already have had to deal with elsewhere.

Furthermore, the samples under the webhook prefix are confusing. What does prefix_command.rb do? What does git_webhook do? abrader-gms is completely undocumented, so the link is only useful in that it tells me where to get the module containing git_webhook.

Invalid path to r10k.ddl

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Service[pe-mcollective] { subscribe => File[/opt/puppet/libexec/mcollective/mcollective/application/r10k.ddl] }, because File[/opt/puppet/libexec/mcollective/mcollective/application/r10k.ddl] doesn't seem to be in the catalog

Deploy single environment with Puppetfile

I frequently need to do something like the following:

/var/lib/gems/1.8/bin/r10k deploy environment production -p

To deploy a single environment with its Puppetfile. Its not clear to me how I add support to the agent for this type of work, and my implementation of the MCO agent is basically blocked on this. Is this something we might be able to get added?

prerun_command setting has no dependencies

There are many resources in the R10k module that are required for R10k to run, and if any of them fail, r10k commands cannot be executed. The prerun_command, however, will currently be managed regardless of any configuration failures in these critical resources.

This may not be a simple fix by adding a require statement to the r10k::prerun_command resources, since the order in which r10k::prerun_command class is included is up to the user, meaning the required resources may not be available int he catalog yet. If we are comfortable with forcing the user to declare r10k::prerun_command after r10k is declared, or with forcing prerun_command through a parameter to r10k, that would be a quick fix.

Using defined() isn't really an option due to this same parse-ordering problem.

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.