This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from jaredledvina/feature/support-sensu-commun…
…ity-repos Support installing packages from Sensu Community Repos
- Loading branch information
Showing
16 changed files
with
375 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,16 @@ | ||
--- | ||
- name: Merge sensu_go_configs_override w/ defaults | ||
set_fact: | ||
sensu_go_final_repos: "{{ sensu_go_repos | combine(sensu_go_repos_overrides, recursive=True) }}" | ||
|
||
- name: Ensure packages for Sensu Go repos are installed | ||
- name: Ensure dependencies for Sensu Go repos are installed | ||
apt: | ||
name: "{{ sensu_go_repo_packages[ansible_pkg_mgr] }}" | ||
name: "{{ sensu_go_repo_dependencies[ansible_pkg_mgr] }}" | ||
state: present | ||
when: sensu_go_manage_repo or sensu_go_manage_community_repo | ||
|
||
- name: Ensure Sensu Go repo key is configured | ||
apt_key: | ||
url: "{{ sensu_go_final_repos[ansible_pkg_mgr]['key_url'] }}" | ||
id: "{{ sensu_go_final_repos[ansible_pkg_mgr]['key_id'] }}" | ||
|
||
- name: Configure Sensu Go apt repos | ||
apt_repository: | ||
filename: sensu_go | ||
repo: "{{ sensu_go_final_repos[ansible_pkg_mgr]['deb'] }}" | ||
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_go | ||
repo: "{{ sensu_go_final_repos[ansible_pkg_mgr]['deb-src'] }}" | ||
update_cache: false | ||
when: sensu_go_final_repos[ansible_pkg_mgr]['deb-src'] is defined | ||
notify: update apt cache | ||
- include_tasks: repo/sensu_go/{{ ansible_pkg_mgr }}.yml | ||
when: sensu_go_manage_repo | ||
|
||
- name: Cleanup - Remove old sensu_prerelease repo | ||
file: | ||
path: /etc/apt/sources.list.ld/sensu_prerelease | ||
state: absent | ||
notify: update apt cache | ||
- include_tasks: repo/sensu_community/{{ ansible_pkg_mgr }}.yml | ||
when: sensu_go_manage_community_repo | ||
|
||
- name: Flush handlers | ||
meta: flush_handlers | ||
when: sensu_go_manage_repo or sensu_go_manage_community_repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,16 @@ | ||
--- | ||
- name: Merge sensu_go_configs_override w/ defaults | ||
set_fact: | ||
sensu_go_final_repos: "{{ sensu_go_repos | combine(sensu_go_repos_overrides, recursive=True) }}" | ||
|
||
- name: Ensure packages for Sensu Go repos are installed | ||
- name: Ensure dependencies for Sensu Go repos are installed | ||
dnf: | ||
name: "{{ sensu_go_repo_packages[ansible_pkg_mgr] }}" | ||
state: present | ||
|
||
- name: Configure Sensu Go GPG key in the RPM keyring | ||
rpm_key: | ||
key: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgkey'] }}" | ||
name: "{{ sensu_go_repo_dependencies[ansible_pkg_mgr] }}" | ||
state: present | ||
register: sensu_go_import_key | ||
|
||
- name: Configure Sensu Go yum repos | ||
yum_repository: | ||
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'] }}" | ||
gpgkey: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgkey'] }}" | ||
repo_gpgcheck: "{{ sensu_go_final_repos[ansible_pkg_mgr]['repo_gpgcheck'] }}" | ||
sslverify: "{{ sensu_go_final_repos[ansible_pkg_mgr]['sslverify'] }}" | ||
metadata_expire: "{{ sensu_go_final_repos[ansible_pkg_mgr]['metadata_expire'] }}" | ||
when: sensu_go_final_repos[ansible_pkg_mgr]['rpm'] is defined | ||
when: sensu_go_manage_repo or sensu_go_manage_community_repo | ||
|
||
- name: Configure Sensu Go yum source repos | ||
yum_repository: | ||
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'] }}" | ||
gpgcheck: "{{ sensu_go_final_repos[ansible_pkg_mgr]['gpgcheck'] }}" | ||
repo_gpgcheck: "{{ sensu_go_final_repos[ansible_pkg_mgr]['repo_gpgcheck'] }}" | ||
sslverify: "{{ sensu_go_final_repos[ansible_pkg_mgr]['sslverify'] }}" | ||
metadata_expire: "{{ sensu_go_final_repos[ansible_pkg_mgr]['metadata_expire'] }}" | ||
when: sensu_go_final_repos[ansible_pkg_mgr]['rpm-src'] is defined | ||
- include_tasks: repo/sensu_go/{{ ansible_pkg_mgr }}.yml | ||
when: sensu_go_manage_repo | ||
|
||
- name: Cleanup - Remove old Sensu prerelease repos | ||
file: | ||
path: /etc/yum.repos.d/sensu_prerelease | ||
state: absent | ||
notify: yum-clean-metadata | ||
- include_tasks: repo/sensu_community/{{ ansible_pkg_mgr }}.yml | ||
when: sensu_go_manage_community_repo | ||
|
||
# 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 | ||
command: "yum -q makecache -y --disablerepo='*' --enablerepo='{{ item }}'" | ||
args: | ||
warn: false | ||
when: sensu_go_import_key.changed | ||
with_items: | ||
- sensu_go | ||
- sensu_go-source | ||
- name: Flush handlers | ||
meta: flush_handlers | ||
when: sensu_go_manage_repo or sensu_go_manage_community_repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Merge sensu_go_community_repos_overrides w/ defaults | ||
set_fact: | ||
sensu_go_final_community_repos: "{{ sensu_go_community_repos | combine(sensu_go_community_repos_overrides, recursive=True) }}" | ||
|
||
- name: Ensure Sensu Go Community repo key is configured | ||
apt_key: | ||
url: "{{ sensu_go_final_community_repos[ansible_pkg_mgr]['key_url'] }}" | ||
id: "{{ sensu_go_final_community_repos[ansible_pkg_mgr]['key_id'] }}" | ||
|
||
- name: Configure Sensu Go Community apt repos | ||
apt_repository: | ||
filename: sensu_go | ||
repo: "{{ sensu_go_final_community_repos[ansible_pkg_mgr]['deb'] }}" | ||
update_cache: false | ||
when: sensu_go_final_community_repos[ansible_pkg_mgr]['deb'] is defined | ||
notify: update apt cache | ||
|
||
- name: Configure Sensu Go Community apt source repos | ||
apt_repository: | ||
filename: sensu_go | ||
repo: "{{ sensu_go_final_community_repos[ansible_pkg_mgr]['deb-src'] }}" | ||
update_cache: false | ||
when: sensu_go_final_community_repos[ansible_pkg_mgr]['deb-src'] is defined | ||
notify: update apt cache |
Oops, something went wrong.