2017-06-12 19:37:41 +02:00
|
|
|
---
|
2017-07-13 15:57:42 +02:00
|
|
|
|
2017-06-12 19:37:41 +02:00
|
|
|
- name: Add dotdeb GPG key
|
|
|
|
apt_key:
|
|
|
|
# url: https://download.newrelic.com/548C16BF.gpg
|
|
|
|
data: "{{ lookup('file', '548C16BF.gpg') }}"
|
|
|
|
|
2017-07-12 12:17:33 +02:00
|
|
|
- name: set squid_service_name=squid3 for Debian < 9
|
|
|
|
set_fact:
|
|
|
|
squid_service_name: squid3
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "Debian"
|
|
|
|
- ansible_distribution_major_version | version_compare('9', '<')
|
|
|
|
|
2017-07-13 15:57:42 +02:00
|
|
|
- name: Find squid config whitelist
|
|
|
|
shell: find /etc/{{ squid_service_name | default('squid') }}/whitelist-custom.conf /etc/{{ squid_service_name | default('squid') }}/whitelist.conf 2> /dev/null
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
|
|
|
register: squid_whitelist_files
|
|
|
|
|
2017-06-12 19:37:41 +02:00
|
|
|
- name: Append packages.dotdeb.org to Squid whitelist
|
|
|
|
lineinfile:
|
2017-07-12 12:17:33 +02:00
|
|
|
dest: "{{ squid_whitelist_files.stdout_lines | first }}"
|
2017-06-12 19:37:41 +02:00
|
|
|
line: "http://apt.newrelic.com/.*"
|
2017-07-12 12:17:33 +02:00
|
|
|
state: present
|
|
|
|
notify: "reload {{ squid_service_name | default('squid') }}"
|
|
|
|
when: squid_whitelist_files.stdout != ""
|
2017-06-12 19:37:41 +02:00
|
|
|
|
|
|
|
- meta: flush_handlers
|
|
|
|
|
|
|
|
- name: Install NewRelic repository
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb http://apt.newrelic.com/debian/ newrelic non-free"
|
|
|
|
state: present
|
|
|
|
filename: newrelic
|
2017-07-13 15:57:42 +02:00
|
|
|
update_cache: yes
|