Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
Log directory, permissions, and switch to catalina.sh (#3)
Browse files Browse the repository at this point in the history
* Create log directory
* Correct some permissions
* Use CATALINA_OPTS instead of JAVA_OPTS for tomcat
  • Loading branch information
njvrzm authored May 19, 2020
1 parent 50433d0 commit 9299af1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/enable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
- name: Tomcat -javaagent setup
lineinfile:
dest: "{{ jvm_conf_file }}"
line: export JAVA_OPTS="$JAVA_OPTS -javaagent:{{ server_root }}/newrelic/newrelic.jar"
line: export CATALINA_OPTS="$CATALINA_OPTS -javaagent:{{ server_root }}/newrelic/newrelic.jar"
create: yes # the file often doesn't exist with Tomcat
mode: 0755
mode: "0755"
when: server_type == "tomcat"
become: yes
notify:
Expand Down
14 changes: 12 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
group: "{{ server_group }}"
become: yes

- name: Create the agent's log directory
file:
path: "{{ nr_java_agent_config.log_file_path }}"
state: directory
owner: "{{ server_user }}"
group: "{{ server_group }}"
mode: "0750"
when: nr_java_agent_config.log_file_path is defined

become: yes

- name: Copy provided Java agent config file into place
copy:
src: "{{ nr_java_agent_config_file }}"
Expand Down Expand Up @@ -37,7 +48,6 @@
src: "{{ nr_java_agent_zip_location }}"
remote_src: "{{ nr_java_agent_zip_is_remote }}"
dest: "{{ server_root }}"
mode: "0755"
list_files: yes
owner: "{{ server_user }}"
group: "{{ server_group }}"
Expand All @@ -50,7 +60,7 @@
src: "{{ server_root }}/newrelic/newrelic.yml.new"
dest: "{{ server_root }}/newrelic/newrelic.yml"
remote_src: true
mode: "0755"
mode: "0640"
owner: "{{ server_user }}"
group: "{{ server_group }}"
become: true
Expand Down

0 comments on commit 9299af1

Please sign in to comment.