23 changes: 19 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,34 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development system_tests release
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --with system_tests --without development release
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
environment variable:

```sh
BUNDLE_JOBS="$(nproc)"
```

### Note for OS X users

`nproc` isn't a valid command unter OS x. As an alternative, you can do:

```sh
--jobs "$(sysctl -n hw.ncpu)"
```

## Syntax and style
Expand Down Expand Up @@ -160,7 +175,7 @@ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
Beaker also supports docker containers. We also use that in our automated CI
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:

```
```sh
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
```

Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.7.0'
modulesync_config_version: '2.8.0'
3 changes: 2 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
.travis.yml:
docker_sets:
- set: ubuntu1404-64
- set: ubuntu1604-64
- set: ubuntu1804-64
- set: centos7-64
- set: centos6-64
secure: "WcBaQ0iem0kLmgOHvOEYOsgAk6eFZcSJ/6AisPhS4Ty9gxaEcytE8if2d9ThOItRRua5XGAPk7WbYmTa/cy/EsH0LYwSDdP2eagI95CnmryGya5TShKwUMv1ETUOBFucRYxtcOo7URnTMe2d6IpxEazuZ87cwGLUV5taBRkEvkw="
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
dist: xenial
dist: bionic
language: ruby
cache: bundler
before_install:
Expand All @@ -25,27 +25,35 @@ matrix:
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
branches:
only:
Expand Down
33 changes: 31 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v8.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v8.0.0) (2019-10-27)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v7.0.0...v8.0.0)

**Breaking changes:**

- modulesync 2.9.0 & drop Ubuntu 14.04, add 16.04/18.04 [\#501](https://github.com/voxpupuli/puppet-r10k/pull/501) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- implement Archlinux support [\#503](https://github.com/voxpupuli/puppet-r10k/pull/503) ([bastelfreak](https://github.com/bastelfreak))
- Implement pool\_size parameter [\#492](https://github.com/voxpupuli/puppet-r10k/pull/492) ([baurmatt](https://github.com/baurmatt))
- Allow uppercase characters in environment names [\#491](https://github.com/voxpupuli/puppet-r10k/pull/491) ([nmaludy](https://github.com/nmaludy))

**Fixed bugs:**

- Trim "full\_name" when module name has no dash [\#498](https://github.com/voxpupuli/puppet-r10k/pull/498) ([posledov](https://github.com/posledov))

**Closed issues:**

- rotated logfiles should not have executable bit set [\#499](https://github.com/voxpupuli/puppet-r10k/issues/499)
- r10k, invoked by r10k::webhook, does not update the module code [\#496](https://github.com/voxpupuli/puppet-r10k/issues/496)

**Merged pull requests:**

- remove git dependency from r10k::install::puppet\_gem [\#502](https://github.com/voxpupuli/puppet-r10k/pull/502) ([Andor](https://github.com/Andor))
- r10k webhook logfiles should not be executable [\#500](https://github.com/voxpupuli/puppet-r10k/pull/500) ([tuxmea](https://github.com/tuxmea))
- Add slack\_icon docs to README [\#497](https://github.com/voxpupuli/puppet-r10k/pull/497) ([0x6d617474](https://github.com/0x6d617474))
- webhook: use the systemd service by default [\#494](https://github.com/voxpupuli/puppet-r10k/pull/494) ([kenyon](https://github.com/kenyon))

## [v7.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v7.0.0) (2019-06-18)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v6.8.0...v7.0.0)
Expand Down Expand Up @@ -222,7 +252,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- release 6.1.0 [\#381](https://github.com/voxpupuli/puppet-r10k/pull/381) ([bastelfreak](https://github.com/bastelfreak))
- Quote the exact JSON response for `heartbeat` [\#379](https://github.com/voxpupuli/puppet-r10k/pull/379) ([bittner](https://github.com/bittner))
- Better handling for the default branch [\#376](https://github.com/voxpupuli/puppet-r10k/pull/376) ([rnelson0](https://github.com/rnelson0))
- Add Troubleshooting section \(logfile, heartbeat\) to README [\#375](https://github.com/voxpupuli/puppet-r10k/pull/375) ([bittner](https://github.com/bittner))
Expand Down Expand Up @@ -281,7 +310,6 @@ These should not affect the functionality of the module.
- Use styleguide compliant syntax for sshkey example. [\#353](https://github.com/voxpupuli/puppet-r10k/pull/353) ([kallies](https://github.com/kallies))
- Fix webhook slack\_username parameter handling [\#350](https://github.com/voxpupuli/puppet-r10k/pull/350) ([alexbrett](https://github.com/alexbrett))
- Webhook Background mode [\#349](https://github.com/voxpupuli/puppet-r10k/pull/349) ([luckyraul](https://github.com/luckyraul))
- Cleanup webhook use case notes; specifically PE/FOSS split. [\#338](https://github.com/voxpupuli/puppet-r10k/pull/338) ([rnelson0](https://github.com/rnelson0))

## [v5.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v5.0.0) (2017-03-07)

Expand All @@ -296,6 +324,7 @@ These should not affect the functionality of the module.
- r10k.yaml contents indentation is incorrect [\#345](https://github.com/voxpupuli/puppet-r10k/pull/345) ([Kotty666](https://github.com/Kotty666))
- Update yaml location for \>PE3 [\#343](https://github.com/voxpupuli/puppet-r10k/pull/343) ([rnelson0](https://github.com/rnelson0))
- replace all validate functions with datatypes [\#341](https://github.com/voxpupuli/puppet-r10k/pull/341) ([bastelfreak](https://github.com/bastelfreak))
- Cleanup webhook use case notes; specifically PE/FOSS split. [\#338](https://github.com/voxpupuli/puppet-r10k/pull/338) ([rnelson0](https://github.com/rnelson0))
- Remove support for Puppet 3 and Ruby \<2.0.0 [\#321](https://github.com/voxpupuli/puppet-r10k/pull/321) ([rnelson0](https://github.com/rnelson0))
- Ensure webhook run folder exists on redhat systemd environments [\#283](https://github.com/voxpupuli/puppet-r10k/pull/283) ([luisfdez](https://github.com/luisfdez))

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN bundle install --without system_tests development release --path=${BUNDLE_PA
COPY . .

RUN bundle install
RUN bundle exec release_checks
RUN bundle exec rake release_checks

# Container should not saved
RUN exit 1
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

group :test do
gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
gem 'rspec-puppet-facts', '>= 1.9.5', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
Expand All @@ -21,6 +21,8 @@ group :test do
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-topscope-variable-check', :require => false
gem 'puppet-lint-legacy_facts-check', :require => false
gem 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false
Expand Down Expand Up @@ -64,7 +66,7 @@ end
group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'voxpupuli-release', :require => false
gem 'puppet-strings', '>= 2.2', :require => false
end

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,13 @@ class { 'r10k::webhook::config':
slack_webhook => 'http://slack.webhook/webhook', # mandatory for usage
slack_channel => '#channel', # defaults to #default
slack_username => 'r10k', # the username to use
slack_proxy_url => 'http://proxy.example.com:3128' # Optional. Defaults to undef.
slack_proxy_url => 'http://proxy.example.com:3128', # Optional. Defaults to undef.
slack_icon => 'unicorn_face' # Optional. Defaults to undef.
}
```

Note that slack icon names should omit the opening and closing colons (`:`).

### Webhook Rocket.Chat notifications

You can enable Rocket.Chat notifications for the webhook. You will need a
Expand Down Expand Up @@ -755,6 +758,9 @@ When using system ruby , options on how to declare
##### `proxy`
A string setting the`r10k.yaml` configuration value of the same name

##### `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](https://github.com/puppetlabs/puppetlabs-ruby.git) module. In the event that your environment already includes
the module with some customization, you can use the `manage_ruby_dependency`
Expand Down
13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ begin
metadata = JSON.load(File.read(metadata_json))
config.project = metadata['name']
end

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /linux/
task :changelog do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
changelog_txt = File.read(changelog_file)
new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
File.open(changelog_file, "w") {|file| file.puts new_contents }
end
end

rescue LoadError
end
# vim: syntax=ruby
6 changes: 5 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
# Hash containing settings for downloading modules from the Puppet Forge.
# * [*proxy*]
# String containing proxy setting for r10k.yaml.
# Default: ''
# Default: undef
# * [*pool_size*]
# Integer defining how many threads should be spawn while updating modules. Only available for r10k >= 3.3.0.
# Default: undef
#
# === Examples
#
Expand Down Expand Up @@ -66,6 +69,7 @@
$root_group = $r10k::params::root_group,
Stdlib::Absolutepath $puppetconf_path = $r10k::params::puppetconf_path,
Optional[String[1]] $proxy = $r10k::params::proxy,
Optional[Integer[1]] $pool_size = $r10k::params::pool_size,
String $r10k_yaml_template = 'r10k/r10k.yaml.erb',
) inherits r10k::params {

Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Hash $deploy_settings = $r10k::params::deploy_settings,
$root_user = $r10k::params::root_user,
Optional[String[1]] $proxy = $r10k::params::proxy,
Optional[Integer[1]] $pool_size = $r10k::params::pool_size,
$root_group = $r10k::params::root_group,
$postrun = undef,
Boolean $include_prerun_command = false,
Expand Down Expand Up @@ -71,6 +72,7 @@
root_user => $root_user,
root_group => $root_group,
proxy => $proxy,
pool_size => $pool_size,
}

if $mcollective {
Expand Down
1 change: 0 additions & 1 deletion manifests/install/puppet_gem.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This class links the r10k binary for Puppet FOSS 4.2 and up
class r10k::install::puppet_gem {
require git

if versioncmp("${::puppetversion}", '4.2.0') >= 0 { #lint:ignore:only_variable_string
file { '/usr/bin/r10k':
Expand Down
4 changes: 2 additions & 2 deletions manifests/mcollective/application.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

File {
ensure => present,
owner => $::r10k::root_user,
group => $::r10k::root_group,
owner => $r10k::root_user,
group => $r10k::root_group,
mode => '0644',
}
# Install the agent and its ddl file
Expand Down
49 changes: 28 additions & 21 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
$version = 'installed'
$manage_modulepath = false
$manage_ruby_dependency = 'declare'
$provider = 'puppet_gem'

$provider = $facts['os']['name'] ? {
'Archlinux' => 'gem',
default => 'puppet_gem',
}

$install_options = []
$sources = undef
$puppet_master = true
$proxy = undef
$pool_size = undef

if 'puppet_environment' in $facts {
$r10k_basedir = $facts['puppet_environmentpath']
Expand All @@ -36,14 +42,16 @@
# Include the mcollective agent
$mcollective = false

if $::osfamily == 'Debian' {
$functions_path = '/lib/lsb/init-functions'
$start_pidfile_args = '--pidfile=$pidfile'
} elsif $::osfamily == 'SUSE' {
$functions_path = '/etc/rc.status'
} else {
$functions_path = '/etc/rc.d/init.d/functions'
$start_pidfile_args = '--pidfile $pidfile'
case $facts['os']['family'] {
'Debian': {
$functions_path = '/lib/lsb/init-functions'
$start_pidfile_args = '--pidfile=$pidfile'
}
'SUSE': { $functions_path = '/etc/rc.status' }
default: {
$functions_path = '/etc/rc.d/init.d/functions'
$start_pidfile_args = '--pidfile $pidfile'
}
}

# We check for the function right now instead of $::pe_server_version
Expand Down Expand Up @@ -168,18 +176,17 @@
$webhook_webrick_version = 'installed'
$webhook_generate_types = false

# Service Settings for SystemD in EL7
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
$webhook_service_file = '/usr/lib/systemd/system/webhook.service'
$webhook_service_template = 'webhook.redhat.service.erb'
} elsif $::osfamily == 'Gentoo' {
$webhook_service_file = '/etc/init.d/webhook'
$webhook_service_template = 'webhook.init.gentoo.erb'
} elsif $::osfamily == 'Suse' and $::operatingsystemrelease >= '12' { #lint:ignore:version_comparison
$webhook_service_file = '/etc/systemd/system/webhook.service'
$webhook_service_template = 'webhook.suse.service.erb'
if $facts['os']['family'] == 'Gentoo' {
$webhook_service_file = '/etc/init.d/webhook'
$webhook_service_template = 'webhook.init.gentoo.erb'
$webhook_service_file_mode = '0755'
} elsif $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] < '7' {
$webhook_service_file = '/etc/init.d/webhook'
$webhook_service_template = 'webhook.init.erb'
$webhook_service_file_mode = '0755'
} else {
$webhook_service_file = '/etc/init.d/webhook'
$webhook_service_template = 'webhook.init.erb'
$webhook_service_file = '/etc/systemd/system/webhook.service'
$webhook_service_template = 'webhook.service.erb'
$webhook_service_file_mode = '0644'
}
}
Loading