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
ecee8846
Commit
ecee8846
authored
May 15, 2018
by
Fred Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update nr display name to instanceid on aws
parent
ef8f4998
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh
+18
-0
playbooks/roles/newrelic_infrastructure/tasks/main.yml
+15
-0
No files found.
playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh
0 → 100644
View file @
ecee8846
#! /usr/bin/env bash
if
command
-v
ec2metadata
>
/dev/null 2>&1
;
then
INSTANCEID
=
$(
ec2metadata
--instance-id
)
;
HOSTNAME
=
$(
hostname
)
DISPLAY_NAME
=
"
$HOSTNAME
-
$INSTANCEID
"
if
[[
-f
/etc/newrelic/nrsysmond.cfg
]]
;
then
sudo
sed
-i
's/^hostname=.*//g'
/etc/newrelic/nrsysmond.cfg
echo
"hostname=
\"
$DISPLAY_NAME
\"
"
|
sudo
tee
-a
/etc/newrelic/nrsysmond.cfg
sudo
service newrelic-sysmond restart
fi
if
[[
-f
/etc/newrelic-infra.yml
]]
;
then
sudo
sed
-i
's/^display_name: .*//g'
/etc/newrelic-infra.yml
echo
"display_name:
\"
$DISPLAY_NAME
\"
"
|
sudo
tee
-a
/etc/newrelic-infra.yml
sudo
service newrelic-infra restart
fi
fi
playbooks/roles/newrelic_infrastructure/tasks/main.yml
View file @
ecee8846
...
@@ -81,6 +81,21 @@
...
@@ -81,6 +81,21 @@
-
install:app-requirements
-
install:app-requirements
when
:
ansible_distribution == 'Amazon'
when
:
ansible_distribution == 'Amazon'
-
name
:
Install newrelic display name script
copy
:
src
:
"
edx/bin/write_nr_display_name_config.sh"
dest
:
"
/edx/bin/write_nr_display_name_config.sh"
owner
:
root
group
:
root
mode
:
u=rwx,g=r,o=r
-
name
:
Run newrelic display name script on boot
lineinfile
:
path
:
"
/etc/rc.local"
line
:
"
/edx/bin/write_nr_display_name_config.sh"
insertbefore
:
"
exit
0"
mode
:
"
u+x,g+x"
-
name
:
Restart the infrastructure agent if the license key changes
-
name
:
Restart the infrastructure agent if the license key changes
service
:
service
:
name
:
newrelic-infra
name
:
newrelic-infra
...
...
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