From 46e4d2aeeb91ef41d605b696fd69adf5ef7ad423 Mon Sep 17 00:00:00 2001 From: Anthony Rusdi <33247310+antrusd@users.noreply.github.com> Date: Mon, 26 Aug 2019 01:47:32 +0700 Subject: [PATCH] ceph_custom_repo: define apt and rpm key for custom repo This commit also remove the notify on new added debian repo, force update_cache to yes and define sample ceph_custom_key vars. Signed-off-by: Anthony Rusdi <33247310+antrusd@users.noreply.github.com> (cherry picked from commit 4c592066b7c1caaec700af347fc9edf2109c1659) --- group_vars/all.yml.sample | 1 + group_vars/rhcs.yml.sample | 1 + .../tasks/installs/debian_custom_repository.yml | 11 +++++++++-- .../tasks/installs/redhat_custom_repository.yml | 8 ++++++++ roles/ceph-defaults/defaults/main.yml | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 918dcce25..ecf8b539c 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -222,6 +222,7 @@ dummy: # a URL to the .repo file to be installed on the targets. For deb, # ceph_custom_repo should be the URL to the repo base. # +#ceph_custom_key: https://server.domain.com/ceph-custom-repo-key.asc #ceph_custom_repo: https://server.domain.com/ceph-custom-repo diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index fe42feb9a..417868951 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -222,6 +222,7 @@ ceph_iscsi_config_dev: false # a URL to the .repo file to be installed on the targets. For deb, # ceph_custom_repo should be the URL to the repo base. # +#ceph_custom_key: https://server.domain.com/ceph-custom-repo-key.asc #ceph_custom_repo: https://server.domain.com/ceph-custom-repo diff --git a/roles/ceph-common/tasks/installs/debian_custom_repository.yml b/roles/ceph-common/tasks/installs/debian_custom_repository.yml index ccd822c9d..10c5ea38f 100644 --- a/roles/ceph-common/tasks/installs/debian_custom_repository.yml +++ b/roles/ceph-common/tasks/installs/debian_custom_repository.yml @@ -1,7 +1,14 @@ --- +- name: configure debian custom apt key + apt_key: + url: "{{ ceph_custom_key }}" + state: present + register: result + until: result is succeeded + when: ceph_custom_key is defined + - name: configure debian custom repository apt_repository: repo: "deb {{ ceph_custom_repo }} {{ ansible_distribution_release }} main" state: present - update_cache: no - notify: update apt cache if a repo was added \ No newline at end of file + update_cache: yes diff --git a/roles/ceph-common/tasks/installs/redhat_custom_repository.yml b/roles/ceph-common/tasks/installs/redhat_custom_repository.yml index 273262927..5bdefa2c3 100644 --- a/roles/ceph-common/tasks/installs/redhat_custom_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_custom_repository.yml @@ -1,4 +1,12 @@ --- +- name: configure red hat custom rpm key + rpm_key: + key: "{{ ceph_custom_key }}" + state: present + register: result + until: result is succeeded + when: ceph_custom_key is defined + - name: configure red hat custom repository get_url: url: "{{ ceph_custom_repo }}" diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 5d88e79e0..2ccfa047a 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -214,6 +214,7 @@ ceph_iscsi_config_dev: true # special repo for deploying iSCSI gateways # a URL to the .repo file to be installed on the targets. For deb, # ceph_custom_repo should be the URL to the repo base. # +ceph_custom_key: https://server.domain.com/ceph-custom-repo-key.asc ceph_custom_repo: https://server.domain.com/ceph-custom-repo