Skip to content

Commit

Permalink
Merge branch 'master' into use_vmac_vrrp_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
saz committed Sep 25, 2019
2 parents a324c7b + f833bc5 commit 916f600
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 13 deletions.
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: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
.travis.yml:
docker_sets:
- set: centos6-64
- set: centos7-64
- set: debian8-64
- set: ubuntu1604-64
- set: ubuntu1804-64
secure: "GkH8b+4jKSQ9TwHnUca5HG5L1g+doS8k1Sp9/K7MBtzFdcWIZxVAc7xUNogq1BbKRm50aNcWbFK7NL5t3GkUH8fNuybZegLEdsrLhJAx57GplC9ip7qVVHsT6GjJ3MrdhbyCOvgHRprMpmENG5vqtXEfrnJ6LSf1MP3DkQPlfrY="
spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml:
delete: true
Expand Down
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ matrix:
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
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
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
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=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
Expand All @@ -39,6 +47,22 @@ matrix:
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-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=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=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=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=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
branches:
only:
- master
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false
Expand Down
2 changes: 1 addition & 1 deletion manifests/lvs/real_server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$_name = regsubst($name, '[:\/\n]', '')

concat::fragment { "keepalived.conf_lvs_real_server_${_name}":
target => "${::keepalived::config_dir}/keepalived.conf",
target => "${keepalived::config_dir}/keepalived.conf",
content => template('keepalived/lvs_real_server.erb'),
order => "250-${virtual_server}-${_name}",
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/vrrp/sync_group.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$_name = regsubst($name, '[:\/\n]', '')

concat::fragment { "keepalived.conf_vrrp_sync_group_${_name}":
target => "${::keepalived::config_dir}/keepalived.conf",
target => "${keepalived::config_dir}/keepalived.conf",
content => template('keepalived/vrrp_sync_group.erb'),
order => '050',
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/vrrp/track_process.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Boolean $full_command = false
) {
concat::fragment { "keepalived.conf_vrrp_track_process_${proc_name}":
target => "${::keepalived::config_dir}/keepalived.conf",
target => "${keepalived::config_dir}/keepalived.conf",
content => epp('keepalived/vrrp_track_process.epp', {
'name' => $name,
'proc_name' => $proc_name,
Expand Down
13 changes: 11 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,25 @@
"8"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6"
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6"
"6",
"7"
]
}
],
Expand Down
15 changes: 12 additions & 3 deletions spec/acceptance/keepalived_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
describe 'keepalived class' do
context 'with default parameters' do
pp = <<-EOS
include keepalived
class { 'keepalived':
sysconf_options => '-D --vrrp',
}
notify { "Keepalived version was: ${facts['keepalived_version']}":
require => Class['keepalived'],
Expand All @@ -14,7 +16,12 @@
apply_manifest(pp, catch_failures: true)
end
it 'works idempotently' do
apply_manifest('include keepalived', catch_changes: true)
pp2 = <<-EOS
class { 'keepalived':
sysconf_options => '-D --vrrp',
}
EOS
apply_manifest(pp2, catch_changes: true)
end
it 'creates fact keepalived_version' do
service_fact = apply_manifest(pp, catch_failures: true)
Expand All @@ -32,7 +39,9 @@

context 'on master with vrrp instance' do
pp = <<-EOS
include keepalived
class { 'keepalived':
sysconf_options => '-D --vrrp',
}
keepalived::vrrp::instance { 'VI_50':
interface => $facts['networking']['primary'],
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
require 'bundler'
include RspecPuppetFacts

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
Expand All @@ -31,6 +32,7 @@
add_filter '/spec'
add_filter '/vendor'
add_filter '/.vendor'
add_filter Bundler.configured_bundle_path.path
end
end

Expand Down

0 comments on commit 916f600

Please sign in to comment.