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>
pull/4410/head
Anthony Rusdi 2019-08-26 01:47:32 +07:00 committed by Dimitri Savineau
parent 0cedc4d303
commit 4c592066b7
6 changed files with 24 additions and 3 deletions

View File

@ -235,6 +235,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

View File

@ -235,6 +235,7 @@ ceph_rhcs_version: 4
# 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

View File

@ -266,7 +266,10 @@ ceph_repository_obs = (
("ceph_obs_repo", types.string),
)
ceph_repository_custom = ("ceph_custom_repo", types.string)
ceph_repository_custom = (
("ceph_custom_key", types.string),
("ceph_custom_repo", types.string),
)
ceph_repository_uca = (
("ceph_stable_openstack_release_uca", types.string),

View File

@ -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
update_cache: yes

View File

@ -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 }}"

View File

@ -227,6 +227,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