Showing with 624 additions and 1,261 deletions.
  1. +16 −0 .fixtures.yml
  2. +5 −34 .github/CONTRIBUTING.md
  3. +75 −0 .github/workflows/ci.yml
  4. +29 −0 .github/workflows/release.yml
  5. +2 −1 .msync.yml
  6. +1 −1 .overcommit.yml
  7. +15 −2 .pmtignore
  8. +3 −549 .rubocop.yml
  9. +0 −8 .sync.yml
  10. +0 −80 .travis.yml
  11. +31 −1 CHANGELOG.md
  12. +1 −1 Dockerfile
  13. +11 −26 Gemfile
  14. +1 −1 README.md
  15. +8 −1 Rakefile
  16. 0 files/{ → mcollective}/agent/r10k.ddl
  17. +308 −0 files/mcollective/agent/r10k.json
  18. +5 −4 templates/agent/r10k.rb.erb → files/mcollective/agent/r10k.rb
  19. 0 files/{ → mcollective}/application/r10k.rb
  20. +2 −2 manifests/install.pp
  21. +22 −46 manifests/mcollective.pp
  22. +2 −22 manifests/params.pp
  23. +1 −1 manifests/webhook/config.pp
  24. +9 −13 metadata.json
  25. +0 −13 spec/acceptance/nodesets/archlinux-2-x64.yml
  26. +0 −31 spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml
  27. +0 −34 spec/acceptance/nodesets/ec2/image_templates.yaml
  28. +0 −29 spec/acceptance/nodesets/ec2/rhel-73-x64.yml
  29. +0 −29 spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml
  30. +0 −29 spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml
  31. +0 −29 spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml
  32. +1 −1 spec/classes/install_spec.rb
  33. +0 −60 spec/classes/mcollective/application_spec.rb
  34. +22 −105 spec/classes/mcollective_spec.rb
  35. +43 −0 spec/classes/webhook/config_spec.rb
  36. +1 −1 spec/spec_helper.rb
  37. +7 −6 templates/webhook.bin.erb
  38. +0 −100 templates/webhook.init.erb
  39. +3 −1 templates/webhook.yaml.erb
16 changes: 16 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,19 @@ fixtures:
inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
vcsrepo: "https://github.com/puppetlabs/puppetlabs-vcsrepo.git"
git: "https://github.com/puppetlabs/puppetlabs-git.git"
mcollective: "https://github.com/choria-io/puppet-mcollective.git"
choria: "https://github.com/choria-io/puppet-choria.git"
cron_core:
repo: "https://github.com/puppetlabs/puppetlabs-cron_core.git"
puppet_version: ">= 6.0.0"
yumrepo_core:
repo: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
puppet_version: ">= 6.0.0"
apt: "https://github.com/puppetlabs/puppetlabs-apt"
forge_modules:
mcollective_choria: "choria/mcollective_choria"
mcollective_agent_puppet: "choria/mcollective_agent_puppet"
mcollective_agent_service: "choria/mcollective_agent_service"
mcollective_agent_package: "choria/mcollective_agent_package"
mcollective_agent_filemgr: "choria/mcollective_agent_filemgr"
mcollective_util_actionpolicy: "choria/mcollective_util_actionpolicy"
39 changes: 5 additions & 34 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ By participating in this project you agree to abide by its terms.

Please be prepared to repeat some of these steps as our contributors review your code.

Also consider sending in your profile code that calls this component module as an acceptance test or provide it via an issue. This helps reviewers a lot to test your use case and prevents future regressions!

## Writing proper commits - short version

* Make commits of logical units.
Expand Down Expand Up @@ -230,52 +232,21 @@ simple tests against it after applying the module. You can run this
with:

```sh
bundle exec rake acceptance
```

This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,

```sh
BEAKER_set=centos-7-x64 bundle exec rake acceptance
```

There are default rake tasks for the various acceptance test modules, e.g.,

```sh
bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
```

If you don't want to have to recreate the virtual machine every time you can
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
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=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
BEAKER_setfile=debian10-x64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
The following strings are known to work:

* ubuntu1604
* ubuntu1804
* debian8
* ubuntu2004
* debian9
* debian10
* centos6
* centos7
* centos8

The easiest way to debug in a docker container is to open a shell:

```sh
docker exec -it -u root ${container_id_or_name} bash
```
For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
repository.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on: pull_request

jobs:
setup_matrix:
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
timeout-minutes: 40
outputs:
beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }}
puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
env:
BUNDLE_WITHOUT: development:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run rake validate
run: bundle exec rake validate
- name: Run rake rubocop
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
tags:
- '*'

env:
BUNDLE_WITHOUT: development:test:system_tests

jobs:
deploy:
name: 'deploy to forge'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Build and Deploy
env:
# Configure secrets here:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
run: bundle exec rake module:push
3 changes: 2 additions & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
modulesync_config_version: '3.0.0'
---
modulesync_config_version: '4.1.0'
2 changes: 1 addition & 1 deletion .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ PrePush:
- 'validate'
- 'test'
- 'rubocop'
command: [ 'bundle', 'exec', 'rake' ]
command: ['bundle', 'exec', 'rake']
17 changes: 15 additions & 2 deletions .pmtignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
docs/
pkg/
Gemfile
Gemfile.lock
Gemfile.local
vendor/
.vendor/
spec/fixtures/manifests/
spec/fixtures/modules/
spec/
Rakefile
.vagrant/
.bundle/
.ruby-version
coverage/
log/
.idea/
.dependencies/
.github/
.librarian/
Puppetfile.lock
*.iml
.editorconfig
.fixtures.yml
.gitignore
.msync.yml
.overcommit.yml
.pmtignore
.rspec
.rspec_parallel
.rubocop.yml
.sync.yml
.*.sw?
.yardoc/
.yardopts
Dockerfile
Loading