Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
ada3818a
Commit
ada3818a
authored
Mar 26, 2018
by
Simon Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the splunk forwarder install role so it can be run on both ubuntu and RHEL
parent
df1ea3fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
playbooks/roles/splunkforwarder/tasks/main.yml
+13
-13
No files found.
playbooks/roles/splunkforwarder/tasks/main.yml
View file @
ada3818a
...
@@ -37,28 +37,28 @@
...
@@ -37,28 +37,28 @@
get_url
:
get_url
:
dest
:
"
/tmp/{{
SPLUNKFORWARDER_DEB
}}"
dest
:
"
/tmp/{{
SPLUNKFORWARDER_DEB
}}"
url
:
"
{{
SPLUNKFORWARDER_PACKAGE_URL
}}"
url
:
"
{{
SPLUNKFORWARDER_PACKAGE_URL
}}"
register
:
download_
package
register
:
download_
deb
until
:
download_
package
|succeeded
until
:
download_
deb
|succeeded
retries
:
5
retries
:
5
when
:
ansible_distribution in common_debian_variants
when
:
ansible_distribution in common_debian_variants
-
name
:
Install splunk forwarder
-
name
:
Install splunk forwarder
shell
:
"
gdebi
-nq
/tmp/{{
SPLUNKFORWARDER_DEB
}}"
shell
:
"
gdebi
-nq
/tmp/{{
SPLUNKFORWARDER_DEB
}}"
when
:
ansible_distribution in common_debian_variants and download_
package
.changed
when
:
ansible_distribution in common_debian_variants and download_
deb
.changed
# Install Splunk Forwarder for common_redhat_variants
# Install Splunk Forwarder for common_redhat_variants
-
name
:
Download the splunk rpm
-
name
:
Download the splunk rpm
get_url
:
get_url
:
dest
:
"
/tmp/{{
SPLUNKFORWARDER_RPM
}}"
dest
:
"
/tmp/{{
SPLUNKFORWARDER_RPM
}}"
url
:
"
{{
SPLUNKFORWARDER_PACKAGE_URL
}}"
url
:
"
{{
SPLUNKFORWARDER_PACKAGE_URL
}}"
register
:
download_
package
register
:
download_
rpm
until
:
download_
package
|succeeded
until
:
download_
rpm
|succeeded
retries
:
5
retries
:
5
when
:
ansible_distribution in common_redhat_variants
when
:
ansible_distribution in common_redhat_variants
-
name
:
Install splunk forwarder
-
name
:
Install splunk forwarder
shell
:
"
rpm
-i
/tmp/{{
SPLUNKFORWARDER_RPM
}}"
shell
:
"
rpm
-i
/tmp/{{
SPLUNKFORWARDER_RPM
}}"
when
:
ansible_distribution in common_redhat_variants and download_
package
.changed
when
:
ansible_distribution in common_redhat_variants and download_
rpm
.changed
-
name
:
Create splunk user
-
name
:
Create splunk user
user
:
user
:
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
state
:
present
state
:
present
append
:
yes
append
:
yes
groups
:
syslog,adm
groups
:
syslog,adm
when
:
download_
package
.changed
when
:
download_
rpm.changed or download_deb
.changed
# Need to start splunk manually so that it can create various files
# Need to start splunk manually so that it can create various files
# and directories that aren't created till the first run and are needed
# and directories that aren't created till the first run and are needed
...
@@ -76,19 +76,19 @@
...
@@ -76,19 +76,19 @@
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
start
--accept-license
--answer-yes
--no-prompt"
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
start
--accept-license
--answer-yes
--no-prompt"
args
:
args
:
creates
:
"
{{
splunkforwarder_output_dir
}}/var/lib/splunk"
creates
:
"
{{
splunkforwarder_output_dir
}}/var/lib/splunk"
when
:
download_
package
.changed
when
:
download_
rpm.changed or download_deb
.changed
register
:
started_manually
register
:
started_manually
-
name
:
Stop splunk manually
-
name
:
Stop splunk manually
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
stop
--accept-license
--answer-yes
--no-prompt"
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
stop
--accept-license
--answer-yes
--no-prompt"
when
:
download_package.changed
and started_manually.changed
when
:
(download_rpm.changed or download_deb.changed)
and started_manually.changed
-
name
:
Create boot script
-
name
:
Create boot script
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
enable
boot-start
-user
splunk
--accept-license
--answer-yes
--no-prompt"
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
enable
boot-start
-user
splunk
--accept-license
--answer-yes
--no-prompt"
args
:
args
:
creates
:
/etc/init.d/splunk
creates
:
/etc/init.d/splunk
register
:
create_boot_script
register
:
create_boot_script
when
:
download_
package
.changed
when
:
download_
rpm.changed or download_deb
.changed
notify
:
restart splunkforwarder
notify
:
restart splunkforwarder
-
name
:
Ensure splunk forder permissions
-
name
:
Ensure splunk forder permissions
...
@@ -98,12 +98,12 @@
...
@@ -98,12 +98,12 @@
recurse
:
yes
recurse
:
yes
owner
:
splunk
owner
:
splunk
group
:
splunk
group
:
splunk
when
:
download_
package
.changed
when
:
download_
rpm.changed or download_deb
.changed
notify
:
restart splunkforwarder
notify
:
restart splunkforwarder
-
name
:
Update admin pasword
-
name
:
Update admin pasword
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
edit
user
admin
-password
'{{
SPLUNKFORWARDER_PASSWORD
}}'
-auth
admin:changeme
--accept-license
--answer-yes
--no-prompt"
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
edit
user
admin
-password
'{{
SPLUNKFORWARDER_PASSWORD
}}'
-auth
admin:changeme
--accept-license
--answer-yes
--no-prompt"
when
:
download_
package
.changed
when
:
download_
rpm.changed or download_deb
.changed
notify
:
restart splunkforwarder
notify
:
restart splunkforwarder
-
name
:
Add chkconfig to init script
-
name
:
Add chkconfig to init script
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
line
:
"
#
chkconfig:
235
98
55"
line
:
"
#
chkconfig:
235
98
55"
insertafter
:
"
#!/bin/sh"
insertafter
:
"
#!/bin/sh"
state
:
present
state
:
present
when
:
download_package.changed
and create_boot_script.changed
when
:
(download_rpm.changed or download_deb.changed)
and create_boot_script.changed
notify
:
restart splunkforwarder
notify
:
restart splunkforwarder
-
name
:
Make sure necessary dirs exist
-
name
:
Make sure necessary dirs exist
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment