Skip to content

Commit

Permalink
feat: add configurable newrelic_group and newrelic_groups
Browse files Browse the repository at this point in the history
since docker integration only works if you add the `docker` group to `newrelic_groups` it
doesn't make sense to enable it by default.

BREAKING CHANGE: `newrelic_disable_docker` and `newrelic_disable_nfs` now default to `yes`
  • Loading branch information
franklinkim committed Feb 13, 2016
1 parent 335ac45 commit b06cf9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 7 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
#
# newrelic_license_key: yourkey

# user name
# User name
newrelic_user: newrelic
# User group
newrelic_group: newrelic
# User groups to append to user
newrelic_groups: []
# Name of the file where the server monitor will store it's log messages.
newrelic_logfile: /var/log/newrelic/nrsysmond.log
# Level of detail you want in the log file
newrelic_loglevel: info
# Set to true to disable NFS client statistics gathering.
newrelic_disable_nfs: no
newrelic_disable_nfs: yes
# Set to true to disable Docker container statistics gathering.
newrelic_disable_docker: no
newrelic_disable_docker: yes
# start on boot
newrelic_service_enabled: yes
# current state: started, stopped
Expand Down
8 changes: 7 additions & 1 deletion tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
src: "{{ item }}.j2"
dest: "/{{ item }}"
owner: "{{ newrelic_user }}"
group: "{{ newrelic_user }}"
group: "{{ newrelic_group }}"
mode: "0640"
notify: restart newrelic
with_items:
- "etc/newrelic/nrsysmond.cfg"

- name: Configuring user groups
user:
name: "{{ newrelic_user }}"
groups: "{{ newrelic_groups }}"
append: yes
when: not newrelic_disable_docker
4 changes: 0 additions & 4 deletions tasks/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
name: newrelic-sysmond
state: "{{ newrelic_service_state }}"
enabled: "{{ newrelic_service_enabled }}"

- name: Add newrelic user to docker group
user: name=newrelic append=yes groups=docker
when: not newrelic_disable_docker

0 comments on commit b06cf9f

Please sign in to comment.