Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #50 from jaredledvina/feature/fixup-prerelease-rep…
Browse files Browse the repository at this point in the history
…o-name

Repos - Rename prerelease to go for consistency
  • Loading branch information
jaredledvina authored Feb 16, 2019
2 parents b29e6b9 + 093f9d6 commit 06a91be
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 18 deletions.
9 changes: 9 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@
service:
name: sensu-agent
state: restarted

- name: update apt cache
apt:
update_cache: true

- name: yum-clean-metadata
command: yum clean metadata
args:
warn: no
4 changes: 2 additions & 2 deletions molecule/shared/tests/test_default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
it { should be_installed }
end

describe yum.repo('sensu_prerelease') do
describe yum.repo('sensu_go') do
it { should exist }
it { should be_enabled }
end

describe yum.repo('sensu_prerelease-source') do
describe yum.repo('sensu_go-source') do
it { should exist }
it { should be_enabled }
end
Expand Down
19 changes: 15 additions & 4 deletions tasks/repo/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@

- name: Configure Sensu Go apt repos
apt_repository:
filename: sensu_prerelease
filename: sensu_go
repo: "{{ sensu_go_final_repos[ansible_pkg_mgr]['deb'] }}"
update_cache: true
update_cache: false
when: sensu_go_final_repos[ansible_pkg_mgr]['deb'] is defined
notify: update apt cache

- name: Configure Sensu Go apt source repos
apt_repository:
filename: sensu_prerelease
filename: sensu_go
repo: "{{ sensu_go_final_repos[ansible_pkg_mgr]['deb-src'] }}"
update_cache: true
update_cache: false
when: sensu_go_final_repos[ansible_pkg_mgr]['deb-src'] is defined
notify: update apt cache

- name: Cleanup - Remove old sensu_prerelease repo
file:
path: /etc/apt/sources.list.ld/sensu_prerelease
state: absent
notify: update apt cache

- name: Flush handlers
meta: flush_handlers
18 changes: 12 additions & 6 deletions tasks/repo/dnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

- name: Configure Sensu Go yum repos
yum_repository:
file: sensu_prerelease
name: sensu_prerelease
file: sensu_go
name: sensu_go
description: packagecloud.io mirrors for Sensu Go
baseurl: "{{ sensu_go_final_repos[ansible_pkg_mgr]['rpm'] }}"
gpgcheck: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgcheck'] }}"
Expand All @@ -29,8 +29,8 @@

- name: Configure Sensu Go yum source repos
yum_repository:
file: sensu_prerelease
name: sensu_prerelease-source
file: sensu_go
name: sensu_go-source
description: packagecloud.io mirrors for Sensu Go Source RPMS
baseurl: "{{ sensu_go_final_repos[ansible_pkg_mgr]['rpm-src'] }}"
gpgkey: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgkey'] }}"
Expand All @@ -40,6 +40,12 @@
metadata_expire: "{{ sensu_go_final_repos[ansible_pkg_mgr]['metadata_expire'] }}"
when: sensu_go_final_repos[ansible_pkg_mgr]['rpm-src'] is defined

- name: Cleanup - Remove old Sensu prerelease repos
file:
path: /etc/yum.repos.d/sensu_prerelease
state: absent
notify: yum-clean-metadata

# HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
# Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
- name: Make yum cache to import GPG keys
Expand All @@ -48,5 +54,5 @@
warn: false
when: sensu_go_import_key.changed
with_items:
- sensu_prerelease
- sensu_prerelease-source
- sensu_go
- sensu_go-source
18 changes: 12 additions & 6 deletions tasks/repo/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

- name: Configure Sensu Go yum repos
yum_repository:
file: sensu_prerelease
name: sensu_prerelease
file: sensu_go
name: sensu_go
description: packagecloud.io mirrors for Sensu Go
baseurl: "{{ sensu_go_final_repos[ansible_pkg_mgr]['rpm'] }}"
gpgcheck: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgcheck'] }}"
Expand All @@ -29,8 +29,8 @@

- name: Configure Sensu Go yum source repos
yum_repository:
file: sensu_prerelease
name: sensu_prerelease-source
file: sensu_go
name: sensu_go-source
description: packagecloud.io mirrors for Sensu Go Source RPMS
baseurl: "{{ sensu_go_final_repos[ansible_pkg_mgr]['rpm-src'] }}"
gpgkey: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgkey'] }}"
Expand All @@ -40,6 +40,12 @@
metadata_expire: "{{ sensu_go_final_repos[ansible_pkg_mgr]['metadata_expire'] }}"
when: sensu_go_final_repos[ansible_pkg_mgr]['rpm-src'] is defined

- name: Cleanup - Remove old Sensu prerelease repos
file:
path: /etc/yum.repos.d/sensu_prerelease
state: absent
notify: yum-clean-metadata

# HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
# Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
- name: Make yum cache to import GPG keys
Expand All @@ -48,5 +54,5 @@
warn: false
when: sensu_go_import_key.changed
with_items:
- sensu_prerelease
- sensu_prerelease-source
- sensu_go
- sensu_go-source

0 comments on commit 06a91be

Please sign in to comment.