]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add a custom repo ability 858/head
authorDaniel Gryniewicz <dang@redhat.com>
Wed, 22 Jun 2016 14:13:55 +0000 (10:13 -0400)
committerDaniel Gryniewicz <dang@redhat.com>
Fri, 24 Jun 2016 13:46:48 +0000 (09:46 -0400)
Add the ability to use a custom repo, rather than just upstream, RHEL,
and distro.  This allows ansible to be used for internal testing.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
group_vars/all.sample
roles/ceph-common/README.md
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/installs/debian_ceph_repository.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml

index 963b4a1283c7825d6bd3da632fb06cfd5aa92b45..372b50f5ae7109d52f08802dd7cb7d3f1b5a2faa 100644 (file)
@@ -43,7 +43,7 @@ dummy:
 # is not needed for versions after infernalis.
 #use_server_package_split: true
 
-# /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_stable_uca OR ceph_dev /!\
+# /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_stable_uca OR ceph_dev OR ceph_custom /!\
 
 #debian_package_dependencies:
 #  - python-pycurl
@@ -174,6 +174,15 @@ dummy:
 # For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important.
 #ceph_dev_redhat_distro: centos7
 
+# CUSTOM
+# ###
+
+# Use a custom repository to install ceph.  For RPM, ceph_custom_repo should be
+# 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: false # use custom ceph repository
+#ceph_custom_repo: https://server.domain.com/ceph-custom-repo
+
 
 ######################
 # CEPH CONFIGURATION #
index c3c4dbd9ee355608126fa775b9e9e0638fcbfb8d..0270c3bcc67938ae605def05096814c59aa8b324 100644 (file)
@@ -27,6 +27,7 @@ Have a look at `defaults/main.yml`.
   * `ceph_dev`
   * `ceph_stable_ice`
   * `ceph_stable_rh_storage`
+  * `ceph_custom`
 * `journal_size`
 * `monitor_interface`
 * `public_network`
index a8d135437334b3f67cd9e9564ecf1132546a526c..0542b0cc32ab4e28d382099552340063d911e0ad 100644 (file)
@@ -35,7 +35,7 @@ upgrade_ceph_packages: False
 # is not needed for versions after infernalis.
 use_server_package_split: true
 
-# /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_stable_uca OR ceph_dev /!\
+# /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_stable_uca OR ceph_dev OR ceph_custom /!\
 
 debian_package_dependencies:
   - python-pycurl
@@ -166,6 +166,15 @@ ceph_dev_branch: master # development branch you would like to use e.g: master,
 # For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important.
 ceph_dev_redhat_distro: centos7
 
+# CUSTOM
+# ###
+
+# Use a custom repository to install ceph.  For RPM, ceph_custom_repo should be
+# 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: false # use custom ceph repository
+ceph_custom_repo: https://server.domain.com/ceph-custom-repo
+
 
 ######################
 # CEPH CONFIGURATION #
index 92b8c3cc97882aae3d52793e54bdd23758198e41..48eb7d5793c89ba6614f5f9c87ec2b152be42d0d 100644 (file)
     state: present
   changed_when: false
   when: ceph_stable_uca
+
+- name: add custom repo
+  apt_repository:
+    repo: "deb {{ ceph_custom_repo }} {{ ansible_lsb.codename }} main"
+    state: present
+  changed_when: false
+  when: ceph_custom
+
index 3e5e91f32f8ea8ce570194e3658f708ada93ce51..60a2d0afaaee9d267793bde799d6b123712cfa31 100644 (file)
@@ -46,6 +46,7 @@
     - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
       or ceph_dev
       or ceph_origin == "distro"
+      or ceph_custom
 
 - name: install distro or red hat storage ceph mon
   dnf:
@@ -57,6 +58,7 @@
     - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
       or ceph_origin == "distro"
       or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph osd
   yum:
@@ -68,6 +70,7 @@
     - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
       or ceph_origin == "distro"
       or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph osd
   dnf:
     - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
       or ceph_origin == "distro"
       or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph mds
   yum:
     name: "ceph-mds"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_dev or
-     (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
-    mds_group_name in group_names and
-    ansible_pkg_mgr == "yum"
+    - mds_group_name in group_names
+    - ansible_pkg_mgr == "yum"
+    - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
+      or ceph_origin == "distro"
+      or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph mds
   dnf:
     name: "ceph-mds"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_dev or
-     (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
-    mds_group_name in group_names and
-    ansible_pkg_mgr == "dnf"
+    - mds_group_name in group_names
+    - ansible_pkg_mgr == "dnf"
+    - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
+      or ceph_origin == "distro"
+      or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph base
   yum:
     name: "ceph-base"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_dev or
-     (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
-    client_group_name in group_names and
-    ansible_pkg_mgr == "yum"
+    - client_group_name in group_names
+    - ansible_pkg_mgr == "yum"
+    - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
+      or ceph_origin == "distro"
+      or ceph_dev
+      or ceph_custom
 
 - name: install distro or red hat storage ceph base
   dnf:
     name: "ceph-base"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_dev or
-     (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
-    client_group_name in group_names and
-    ansible_pkg_mgr == "dnf"
+    - client_group_name in group_names
+    - ansible_pkg_mgr == "dnf"
+    - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
+      or ceph_origin == "distro"
+      or ceph_dev
+      or ceph_custom
 
 - name: install ceph-test
   yum:
index 049818eda0738ed6eb96a78f9a6eeaadce1edaee..f02bbf9962209d65b661763dcdd8e0ac8ceabac6 100644 (file)
     group: root
     mode: 0644
   when: ceph_stable_ice
+
+- name: add custom repo
+  get_url:
+    url: "{{ ceph_custom_repo }}"
+    dest: /etc/yum.repos.d
+    owner: root
+    group: root
+  when: ceph_custom