Skip to content

Commit

Permalink
enable amazon platform support for splunk forwarder
Browse files Browse the repository at this point in the history
This commit addes support for the amazon platform family to install
splunk forwarder on EC2 instances using the Amazon Linux AMI
  • Loading branch information
Chris Richard committed Aug 28, 2017
1 parent 29c9ebf commit 61fbaf4
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 5 deletions.
77 changes: 77 additions & 0 deletions .kitchen.ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
driver:
name: ec2
aws_ssh_key_id: kiri-aws
security_group_ids: ["sg-1a31097d"]
subnet_id: subnet-b901dae1
region: us-west-1
availability_zone: us-west-1c
require_chef_omnibus: true
instance_type: t2.micro
associate_public_ip: true

provisioner:
name: chef_zero
deprecations_as_errors: true
data_bags_path: "test/fixtures/data_bags"
cookbook_path: "./cookbooks"

transport:
ssh_key: /Users/kiri/.ssh/kiri-aws.pem
connection_timeout: 10
connection_retries: 5
username: ec2-user

platforms:
- name: amazonlinux
driver:
image_id: ami-3a674d5a
transport:
ssh_key: /Users/kiri/.ssh/kiri-aws.pem
username: ec2-user

suites:
- name: client
run_list:
- recipe[chef-splunk::default]
- recipe[test::default]
attributes:
dev_mode: true
splunk:
accept_license: true


- name: client-inputs-outputs
run_list:
- recipe[chef-splunk::default]
- recipe[test::default]
attributes:
dev_mode: true
splunk:
accept_license: true
outputs_conf:
sslCommonNameToCheck: sslCommonName
sslCertPath: $SPLUNK_HOME/etc/certs/cert.pem
sslPassword: password
sslRootCAPath: $SPLUNK_HOME/etc/certs/cacert.pem
sslVerifyServerCert: false
inputs_conf:
host: localhost
ports:
- port_num: 123123
config:
connection_host: dns
sourcetype: syslog
source: tcp:123123

- name: client_lwrps
run_list:
- recipe[chef-splunk::default]
- recipe[test::default]
attributes:
dev_mode: true
splunk:
server:
runasroot: false
accept_license: true
is_server: false
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
default['splunk']['splunk_servers'] = []

case node['platform_family']
when 'rhel', 'fedora', 'suse'
when 'rhel', 'fedora', 'suse', 'amazon'
if node['kernel']['machine'] == 'x86_64'
default['splunk']['forwarder']['url'] = 'https://download.splunk.com/products/universalforwarder/releases/6.6.0/linux/splunkforwarder-6.6.0-1c4f3bbe1aea-linux-2.6-x86_64.rpm'
default['splunk']['server']['url'] = 'https://download.splunk.com/products/splunk/releases/6.6.0/linux/splunk-6.6.0-1c4f3bbe1aea-linux-2.6-x86_64.rpm'
Expand Down
2 changes: 1 addition & 1 deletion attributes/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
if node['splunk']['upgrade_enabled']
case node['platform_family']
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
if node['kernel']['machine'] == 'x86_64'
default['splunk']['upgrade']['server_url'] = 'http://download.splunk.com/releases/4.3.7/splunk/linux/splunk-4.3.7-181874-linux-2.6-x86_64.rpm'
default['splunk']['upgrade']['forwarder_url'] = 'http://download.splunk.com/releases/4.3.7/universalforwarder/linux/splunkforwarder-4.3.7-181874-linux-2.6-x86_64.rpm'
Expand Down
6 changes: 3 additions & 3 deletions definitions/splunk_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
end

local_package_resource = case node['platform_family']
when 'rhel', 'fedora', 'suse' then :rpm_package
when 'debian' then :dpkg_package
when 'omnios' then :solaris_package
when 'rhel', 'fedora', 'suse', 'amazon' then :rpm_package
when 'debian' then :dpkg_package
when 'omnios' then :solaris_package
end

declare_resource local_package_resource, params[:name] do
Expand Down

0 comments on commit 61fbaf4

Please sign in to comment.