Skip to content

Commit

Permalink
Update apt caches every hour to pull the latest package
Browse files Browse the repository at this point in the history
  • Loading branch information
hush-hush committed Jan 19, 2018
1 parent 380b44c commit 4206648
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Role Variables
- `datadog_process_checks` - Array of process checks and options (DEPRECATED: use `process` under
`datadog_checks` instead)
- `datadog_apt_repo` - Override default Datadog `apt` repository
- `datadog_apt_cache_valid_time` - Override the default apt cache expiration time (default 1 hour)
- `datadog_apt_key_url` - Override default url to Datadog `apt` key
- `datadog_apt_key_url_new` - Override default url to the new Datadog `apt` key (in the near future the `apt` repo will have to be checked against this new key instead of the current key)
- `datadog_agent_allow_downgrade` - Set to `yes` to allow agent downgrades on apt-based platforms (use with caution, see `defaults/main.yml` for details)
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ datadog_group: root

# default apt repo
datadog_apt_repo: "deb http://apt.datadoghq.com/ stable main"
datadog_apt_cache_valid_time: 3600

# default yum repo and keys
datadog_yum_repo: "https://yum.datadoghq.com/rpm/{{ ansible_userspace_architecture }}/"
Expand Down
4 changes: 4 additions & 0 deletions tasks/pkg-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
name: datadog-agent={{ datadog_agent_version }}
state: present
force: "{{ datadog_agent_allow_downgrade }}"
update_cache: yes
cache_valid_time: "{{ datadog_apt_cache_valid_time }}"
when: datadog_agent_version != ""

- name: Ensure Datadog agent is installed
apt:
name: datadog-agent
state: latest
update_cache: yes
cache_valid_time: "{{ datadog_apt_cache_valid_time }}"
when: datadog_agent_version == ""

0 comments on commit 4206648

Please sign in to comment.