diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5d047472f0..38cacd4e93 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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 @@ -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 ``` diff --git a/.msync.yml b/.msync.yml index 551989162f..23dfa32f93 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1 +1 @@ -modulesync_config_version: '2.7.0' +modulesync_config_version: '2.8.0' diff --git a/.sync.yml b/.sync.yml index 6007553f06..36effa72e0 100644 --- a/.sync.yml +++ b/.sync.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 8ab1c6b5fc..e368e98738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/Gemfile b/Gemfile index 24dbb7ff61..9571ef3cf3 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/manifests/lvs/real_server.pp b/manifests/lvs/real_server.pp index 5bcdce084e..cf6a6723cb 100644 --- a/manifests/lvs/real_server.pp +++ b/manifests/lvs/real_server.pp @@ -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}", } diff --git a/manifests/vrrp/sync_group.pp b/manifests/vrrp/sync_group.pp index 42d70162ec..6065c19362 100644 --- a/manifests/vrrp/sync_group.pp +++ b/manifests/vrrp/sync_group.pp @@ -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', } diff --git a/manifests/vrrp/track_process.pp b/manifests/vrrp/track_process.pp index f23bc9b754..169778406a 100644 --- a/manifests/vrrp/track_process.pp +++ b/manifests/vrrp/track_process.pp @@ -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, diff --git a/metadata.json b/metadata.json index 4c2c5e25cb..1b6cbfdd82 100644 --- a/metadata.json +++ b/metadata.json @@ -34,16 +34,25 @@ "8" ] }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "16.04", + "18.04" + ] + }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "6" + "6", + "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6" + "6", + "7" ] } ], diff --git a/spec/acceptance/keepalived_spec.rb b/spec/acceptance/keepalived_spec.rb index f87d18ce5c..c4764d1e60 100644 --- a/spec/acceptance/keepalived_spec.rb +++ b/spec/acceptance/keepalived_spec.rb @@ -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'], @@ -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) @@ -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'], diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c53e703156..f16fb15283 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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')) @@ -31,6 +32,7 @@ add_filter '/spec' add_filter '/vendor' add_filter '/.vendor' + add_filter Bundler.configured_bundle_path.path end end