Skip to content

Commit

Permalink
Merge pull request #2 from andrewsomething/new-agent
Browse files Browse the repository at this point in the history
Update for new do-agent repo and remove old one
  • Loading branch information
andrewsomething authored Apr 9, 2019
2 parents 2b882b1 + 26b6186 commit c15adf1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
7 changes: 7 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ galaxy_info:
- wily
- xenial
- yakkety
- xenial
- zesty
- artful
- bionic
- cosmic
- name: Debian
versions:
- jessie
- stretch
- name: EL
versions:
- 6
- 7
galaxy_tags:
- cloud
Expand Down
31 changes: 29 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
state: present
when: agent_apt_key_url is defined

- name: ensure old do-agent apt repository is removed
apt_repository:
repo: "{{ agent_apt_repo_old }}"
filename: "{{ agent_apt_repo_file }}"
update_cache: true
state: absent
when: agent_apt_repo_old is defined

- name: ensure do-agent apt repository is enabled
apt_repository:
repo: "{{ agent_apt_repo }}"
Expand All @@ -29,6 +37,19 @@
state: present
when: agent_apt_repo is defined

- name: ensure old do-agent yum repository is removed
yum_repository:
name: digitalocean-agent
description: DigitalOcean agent
baseurl: "{{ agent_yum_repo_old }}"
file: "{{ agent_yum_repo_file }}"
gpgkey: "{{ agent_yum_key_url }}"
gpgcheck: yes
enabled: yes
failovermethod: priority
state: absent
when: agent_yum_repo_old is defined

- name: ensure do-agent yum repository is enabled
yum_repository:
name: do-agent
Expand All @@ -37,12 +58,18 @@
file: "{{ agent_yum_repo_file }}"
gpgkey: "{{ agent_yum_key_url }}"
gpgcheck: yes
state: present
enabled: yes
failovermethod: priority
state: present
when: agent_yum_repo is defined

- name: ensure do-agent packages are installed
- name: ensure old do-agent packages are uninstalled with yum
package:
name: do-agent-0.*
state: absent
when: agent_yum_repo_old is defined

- name: ensure latest do-agent packages are installed
package:
name: do-agent
state: latest
Expand Down
8 changes: 5 additions & 3 deletions vars/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ agent_pre_packages:
- apt-transport-https
- ca-certificates

agent_apt_key_url: https://repos.sonar.digitalocean.com/sonar-agent.asc
agent_apt_key_url: https://repos.insights.digitalocean.com/sonar-agent.asc

agent_apt_repo: deb https://repos.sonar.digitalocean.com/apt main main
agent_apt_repo_old: deb https://repos.sonar.digitalocean.com/apt main main

agent_apt_repo_file: digitalocean-agent.list
agent_apt_repo: deb https://repos.insights.digitalocean.com/apt/do-agent main main

agent_apt_repo_file: digitalocean-agent
5 changes: 3 additions & 2 deletions vars/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
agent_yum_key_url: https://repos.sonar.digitalocean.com/sonar-agent.asc
agent_yum_repo: https://repos.sonar.digitalocean.com/yum/$basearch
agent_yum_key_url: https://repos.insights.digitalocean.com/sonar-agent.asc
agent_yum_repo: https://repos.insights.digitalocean.com/yum/do-agent/$basearch
agent_yum_repo_old: https://repos.sonar.digitalocean.com/yum/$basearch
agent_yum_repo_file: digitalocean-agent

0 comments on commit c15adf1

Please sign in to comment.