Skip to content

Commit 4b5755d

Browse files
committed
Fix #13: Check if deployment already contains new relic file
1 parent 8aec18e commit 4b5755d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ Task description
8585

8686
Create a virtualenv if it does not exist.
8787

88+
6. Check New Relic conf file in source
89+
90+
Otherwise create from template.
91+
8892
7. Configure New Relic
8993

9094
If `newrelic` is defined configures New Relic.

tasks/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525
register: mkvirtualenv
2626
failed_when: 'mkvirtualenv.changed and "New python executable" not in mkvirtualenv.stdout'
2727

28+
- name: Check New Relic conf file
29+
local_action: stat path={{ conf.dev_path }}/newrelic.ini
30+
register: check_new_relic_file
31+
2832
- name: Configure New Relic
2933
template: src="newrelic.ini.j2" dest="{{ virtualenv_dir }}/{{ project }}.newrelic.ini" backup=yes
30-
when: newrelic is defined
34+
when: check_new_relic_file == False and newrelic is defined
3135

3236
- name: Open ownership
3337
file: name="{{ conf.host_path }}" owner="{{ ansible_user_id }}" mode=0775 state=directory recurse=yes

0 commit comments

Comments
 (0)