Skip to content

Commit

Permalink
Normalize Repository file for RHEL and CentOS (#45)
Browse files Browse the repository at this point in the history
* Normalize Repository file for RHEL and CentOS

According to the following we could make use of `yum variables`:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Using_Yum_Variables.html

Furthermore it might be preferable to set the `descr`  field to the value on the official docs instructions:
https://www.influxdata.com/package-repository-for-linux/#centos-users

* Update install.pp

* Update telegraf_spec.rb

* Update telegraf_spec.rb

copy pasterino typo :)

* Update install.pp

* Test CentOS and RHEL

* Update .travis.yml
  • Loading branch information
doomnuggets authored and yankcrime committed Jan 27, 2017
1 parent f617cd5 commit f7fd88c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
}
'RedHat': {
yumrepo { 'influxdata':
descr => 'influxdata',
descr => "InfluxData Repository - ${::operatingsystem} \$releasever",
enabled => 1,
baseurl => "https://repos.influxdata.com/rhel/${::operatingsystemmajrelease}/${::architecture}/${::telegraf::repo_type}",
baseurl => "https://repos.influxdata.com/${_operatingsystem}/\$releasever/\$basearch/${::telegraf::repo_type}",
gpgkey => 'https://repos.influxdata.com/influxdb.key',
gpgcheck => true,
gpgcheck => 1,
}
Yumrepo['influxdata'] -> Package['telegraf']
}
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/telegraf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

describe 'telegraf' do
context 'Supported operating systems' do
['RedHat', ].each do |osfamily|
['RedHat', 'CentOS'].each do |operatingsystem|
[6,7].each do |releasenum|
context "RedHat #{releasenum} release specifics" do
context "#{osfamily} #{releasenum} release specifics" do
let(:facts) {{
:operatingsystem => osfamily,
:operatingsystem => operatingsystem,
:operatingsystemrelease => releasenum,
:operatingsystemmajrelease => releasenum,
}}
Expand Down Expand Up @@ -80,15 +80,15 @@
it { should contain_service('telegraf') }
it { should contain_yumrepo('influxdata')
.with(
:baseurl => "https://repos.influxdata.com/rhel/#{releasenum}/x86_64/stable",
:baseurl => "https://repos.influxdata.com/#{operatingsystem.downcase}/\$releasever/\$basearch/stable",
)
}

describe 'allow custom repo_type' do
let(:params) { {:repo_type => 'unstable' } }
it { should contain_yumrepo('influxdata')
.with(
:baseurl => "https://repos.influxdata.com/rhel/#{releasenum}/x86_64/unstable",
:baseurl => "https://repos.influxdata.com/#{operatingsystem.downcase}/\$releasever/\$basearch/unstable",
)
}
end
Expand Down

0 comments on commit f7fd88c

Please sign in to comment.