Skip to content

Commit

Permalink
Merge pull request #4 from appcanary/j0ni/update-for-yaml
Browse files Browse the repository at this point in the history
Update for YAML configuration
  • Loading branch information
mveytsman authored Jun 9, 2017
2 parents 25215b4 + 993a236 commit 9ef36fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
apt_repository: repo='deb https://packagecloud.io/appcanary/agent/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} main' state=present update_cache=yes

- name: Install appcanary agent
apt: name=appcanary state=present update_cache=yes
apt: name=appcanary state=latest update_cache=yes
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
when: ansible_os_family == "RedHat"

- name: Upload appcanary config
template: src=agent.conf.j2 dest=/etc/appcanary/agent.conf
template: src=agent.yml.j2 dest=/etc/appcanary/agent.yml
notify:
- restart appcanary
2 changes: 1 addition & 1 deletion tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
shell: yum -q makecache -y --disablerepo='*' --enablerepo='appcanary_agent'

- name: Install appcanary agent
yum: name=appcanary state=present
yum: name=appcanary state=latest
14 changes: 5 additions & 9 deletions templates/agent.conf.j2 → templates/agent.yml.j2
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
api_key = "{{api_key}}"
api_key: "{{api_key}}"

watchers:
{% if monitor_system_packages and ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' %}
[[files]]
path = "/var/lib/dpkg/status"
- path: "/var/lib/dpkg/status"
{% endif %}

{% if monitor_system_packages and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' %}
[[files]]
process = "rpm -qa"
- command: "rpm -qa"
{% endif %}

{% for file in monitored_files %}
[[files]]
path = "{{ file }}"
- path: "{{ file }}"
{% endfor %}

0 comments on commit 9ef36fe

Please sign in to comment.