diff --git a/tasks/debian.yml b/tasks/debian.yml index 4ae5e10..dc8c8a1 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index dc037cb..c1deefd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/redhat.yml b/tasks/redhat.yml index aabfe86..d4c79f8 100644 --- a/tasks/redhat.yml +++ b/tasks/redhat.yml @@ -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 diff --git a/templates/agent.conf.j2 b/templates/agent.yml.j2 similarity index 70% rename from templates/agent.conf.j2 rename to templates/agent.yml.j2 index 4d222d0..4a68699 100644 --- a/templates/agent.conf.j2 +++ b/templates/agent.yml.j2 @@ -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 %}