Skip to content

Commit

Permalink
Add Travis CI and puppet-lint
Browse files Browse the repository at this point in the history
Fix lint problems.
  • Loading branch information
Nathan L Smith committed Feb 7, 2018
1 parent f94fe69 commit b852305
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
branches:
only:
- master
cache: bundler
dist: trusty
sudo: false
script: bundle exec puppet-lint --no-autoloader_layout-check Puppetfile **/*.pp
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://rubygems.org'

gem 'puppet'
gem 'puppet-lint'
gem 'librarian-puppet'
gem 'test-kitchen'
gem 'kitchen-puppet'
Expand Down
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
forge "https://forgeapi.puppetlabs.com"
forge 'https://forgeapi.puppetlabs.com'

metadata
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# newrelic-infra Puppet module

[![Build Status](https://travis-ci.org/newrelic/infrastructure-agent-puppet.svg?branch=master)](https://travis-ci.org/newrelic/infrastructure-agent-puppet)

## Description

This module installs and configures the New Relic Infrastructure agent.
Expand All @@ -8,8 +10,8 @@ This module installs and configures the New Relic Infrastructure agent.

### What newrelic-infra affects

- Adds the New Relic Infrastructure package repository source
- Installs and configures the New Relic Infrastructure agent
* Adds the New Relic Infrastructure package repository source
* Installs and configures the New Relic Infrastructure agent

### Beginning with newrelic-infra

Expand Down Expand Up @@ -66,15 +68,17 @@ Optional. Enables verbose logging for the agent when set the value with 1, the d

Optional. To log to another location, provide a full path and file name. When not set, the agent logs to the system log files.
Typical default locations:
- Amazon Linux, CentOS, RHEL: `/var/log/messages`
- Debian, Ubuntu: `/var/log/syslog`
- Windows Server: `C:\Program Files\New Relic\newrelic-infra\newrelic-infra.log`

* Amazon Linux, CentOS, RHEL: `/var/log/messages`
* Debian, Ubuntu: `/var/log/syslog`
* Windows Server: `C:\Program Files\New Relic\newrelic-infra\newrelic-infra.log`

##### `proxy`

Optional. Set the proxy server the agent should use. Examples:
- `https://myproxy.foo.com:8080`
- `http://10.10.254.254`

* `https://myproxy.foo.com:8080`
* `http://10.10.254.254`

##### `custom_attributes`

Expand All @@ -93,7 +97,7 @@ package has been mirrored to another repo that's already present on the system (
* CentOS version 6 or higher
* Debian version 7 ("Wheezy") or higher
* Red Hat Enterprise Linux (RHEL) version 6 or higher
* Ubuntu versions 12.04.*, 14.04.*, and 16.04.* (LTS versions)
* Ubuntu versions 12.04._, 14.04._, and 16.04.\* (LTS versions)

## License

Expand Down
26 changes: 13 additions & 13 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
) {
# Validate license key
if $license_key == '' {
fail("New Relic license key not provided")
fail('New Relic license key not provided')
}


Expand All @@ -61,13 +61,13 @@
ensure_packages('apt-transport-https')
apt::source { 'newrelic_infra-agent':
ensure => $package_repo_ensure,
location => "https://download.newrelic.com/infrastructure_agent/linux/apt",
release => $lsbdistcodename,
repos => "main",
architecture => "amd64",
location => 'https://download.newrelic.com/infrastructure_agent/linux/apt',
release => $::lsbdistcodename,
repos => 'main',
architecture => 'amd64',
key => {
'id' => "A758B3FBCD43BE8D123A3476BB29EE038ECCE87C",
'source' => "https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg",
'id' => 'A758B3FBCD43BE8D123A3476BB29EE038ECCE87C',
'source' => 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg',
},
require => Package['apt-transport-https'],
notify => Exec['apt_update'],
Expand All @@ -89,15 +89,15 @@
}
'RedHat', 'CentOS','Amazon': {
if ($::operatingsystem == 'Amazon') {
$repo_releasever = "6"
$repo_releasever = '6'
} else {
$repo_releasever = $operatingsystemmajrelease
$repo_releasever = $::operatingsystemmajrelease
}
yumrepo { 'newrelic_infra-agent':
ensure => $package_repo_ensure,
descr => "New Relic Infrastructure",
baseurl => "https://download.newrelic.com/infrastructure_agent/linux/yum/el/$repo_releasever/x86_64",
gpgkey => "https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg",
descr => 'New Relic Infrastructure',
baseurl => "https://download.newrelic.com/infrastructure_agent/linux/yum/el/${repo_releasever}/x86_64",
gpgkey => 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg',
gpgcheck => true,
repo_gpgcheck => true,
}
Expand Down Expand Up @@ -135,7 +135,7 @@
} else {
# Setup agent service
service { 'newrelic-infra':
ensure => $service_ensure,
ensure => $service_ensure,
require => Package['newrelic-infra'],
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/default/init.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class { 'newrelic_infra::agent':
ensure => 'latest',
license_key => 'YOUR_NR_LICENSE_KEY',
ensure => 'latest',
license_key => 'YOUR_NR_LICENSE_KEY',
}

0 comments on commit b852305

Please sign in to comment.