Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to Elastic Stack version 7 #26

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Release 7.0.0
- Default to Elastic Stack version 7
- Drop support for Puppet version < 4.10.0

## Release 6.3.2
- Allow puppetlabs-apt version 7.x
- Allow puppetlabs-stdlib version 6.x
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Boolean $prerelease = false,
Optional[Integer] $priority = undef,
String $proxy = 'absent',
Integer $version = 6,
Integer $version = 7,
Optional[String] $base_repo_url = undef,
) {
if $prerelease {
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elastic-elastic_stack",
"version": "6.3.2",
"version": "7.0.0",
"author": "toby@jarpy.net",
"summary": "Helpers for installing and configuring components of the Elastic Stack.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -65,7 +65,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.6.1 < 7.0.0"
"version_requirement": ">= 4.10.0 < 7.0.0"
}
],
"pdk-version": "1.0.1",
Expand Down
43 changes: 28 additions & 15 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ def url(format, version)
end
end

def declare_apt(version: '6.x', **params)
def declare_apt(version: '7.x', **params)
params[:location] ||= url('apt', version)
contain_apt__source('elastic').with(params)
end

def declare_yum(version: '6.x', **params)
def declare_yum(version: '7.x', **params)
params[:baseurl] ||= url('yum', version)
contain_yumrepo('elastic').with(params)
end

def declare_zypper(version: '6.x', **params)
def declare_zypper(version: '7.x', **params)
params[:baseurl] ||= url('yum', version)
contain_zypprepo('elastic').with(params)
end
Expand Down Expand Up @@ -70,6 +70,19 @@ def declare_zypper(version: '6.x', **params)
end
end

context 'with "version => 6"' do
let(:params) { default_params.merge(version: 6) }

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(version: '6.x') }
when 'RedHat'
it { is_expected.to declare_yum(version: '6.x') }
when 'Suse'
it { is_expected.to declare_zypper(version: '6.x') }
end
end

context 'with "priority => 99"' do
let(:params) { default_params.merge(priority: 99) }

Expand All @@ -88,11 +101,11 @@ def declare_zypper(version: '6.x', **params)

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(version: '6.x-prerelease') }
it { is_expected.to declare_apt(version: '7.x-prerelease') }
when 'RedHat'
it { is_expected.to declare_yum(version: '6.x-prerelease') }
it { is_expected.to declare_yum(version: '7.x-prerelease') }
when 'Suse'
it { is_expected.to declare_zypper(version: '6.x-prerelease') }
it { is_expected.to declare_zypper(version: '7.x-prerelease') }
end
end

Expand All @@ -101,11 +114,11 @@ def declare_zypper(version: '6.x', **params)

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(version: 'oss-6.x') }
it { is_expected.to declare_apt(version: 'oss-7.x') }
when 'RedHat'
it { is_expected.to declare_yum(version: 'oss-6.x') }
it { is_expected.to declare_yum(version: 'oss-7.x') }
when 'Suse'
it { is_expected.to declare_zypper(version: 'oss-6.x') }
it { is_expected.to declare_zypper(version: 'oss-7.x') }
end
end

Expand All @@ -114,11 +127,11 @@ def declare_zypper(version: '6.x', **params)

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(version: 'oss-6.x-prerelease') }
it { is_expected.to declare_apt(version: 'oss-7.x-prerelease') }
when 'RedHat'
it { is_expected.to declare_yum(version: 'oss-6.x-prerelease') }
it { is_expected.to declare_yum(version: 'oss-7.x-prerelease') }
when 'Suse'
it { is_expected.to declare_zypper(version: 'oss-6.x-prerelease') }
it { is_expected.to declare_zypper(version: 'oss-7.x-prerelease') }
end
end

Expand All @@ -127,11 +140,11 @@ def declare_zypper(version: '6.x', **params)

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(location: 'https://mymirror.example.org/elastic-artifacts/packages/6.x/apt') }
it { is_expected.to declare_apt(location: 'https://mymirror.example.org/elastic-artifacts/packages/7.x/apt') }
when 'RedHat'
it { is_expected.to declare_yum(baseurl: 'https://mymirror.example.org/elastic-artifacts/packages/6.x/yum') }
it { is_expected.to declare_yum(baseurl: 'https://mymirror.example.org/elastic-artifacts/packages/7.x/yum') }
when 'Suse'
it { is_expected.to declare_zypper(baseurl: 'https://mymirror.example.org/elastic-artifacts/packages/6.x/yum') }
it { is_expected.to declare_zypper(baseurl: 'https://mymirror.example.org/elastic-artifacts/packages/7.x/yum') }
end
end

Expand Down