---
- name: Check for newrelic_license_key
  fail:
    msg: "newrelic_license_key has not been defined"
  when: newrelic_license_key|default(False) == False

- name: main | Debug
  debug:
    var=newrelic_jar_url

- name: main | Create newrelic-jar target directory
  file:
    path="{{ newrelic_jar_dir }}"
    state=directory
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0755
    
- name: main | Download newrelic.jar
  get_url:
    url="{{ newrelic_jar_url }}"
    dest="{{ newrelic_jar_dir }}"
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0644
    
- name: main | Configure new relic
  template:
    src=newrelic.yml.j2
    dest="{{ newrelic_jar_config_file }}"
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0644
  tags: fritz

---
- name: Check for newrelic_license_key
  fail:
    msg: "newrelic_license_key has not been defined"
  when: newrelic_license_key|default(False) == False

- name: main | Debug
  debug:
    var=newrelic_jar_url

- name: main | Create newrelic-jar target directory
  file:
    path="{{ newrelic_jar_dir }}"
    state=directory
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0755
    
- name: main | Download newrelic.jar
  get_url:
    url="{{ newrelic_jar_url }}"
    dest="{{ newrelic_jar_dir }}"
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0644
    
- name: main | Create version-less symbolic link for newrelic.jar file
  file:
    src="{{ newrelic_jar_dir }}/{{ newrelic_jar_filename }}"
    dest="{{ newrelic_jar_dir }}/newrelic-agent.jar"
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    state=link
    
- name: main | Configure new relic
  template:
    src=newrelic.yml.j2
    dest="{{ newrelic_jar_config_file }}"
    owner="{{ newrelic_jar_user }}"
    group="{{ newrelic_jar_group }}"
    mode=0644
  tags: fritz

Create version-less symbolic link for newrelic.jar file
Create version-less symbolic link for newrelic.jar file