]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Control when ceph packages get updated 508/head
authorMatt Thompson <mattt@defunct.ca>
Fri, 29 Jan 2016 15:54:59 +0000 (15:54 +0000)
committerMatt Thompson <mattt@defunct.ca>
Tue, 2 Feb 2016 09:56:40 +0000 (09:56 +0000)
Currently, all the ceph package installation resources use
"state=latest", which means subsequent runs of the ceph playbooks
could result in ceph being upgraded if there are package updates
available in the selected repo.

This commit adds a new variable to ceph-common called
'upgrade_ceph_packages' which defaults to False.  This variable is used
in the package installation resources for ceph packages to determine if
the resource should use "state=present" or "state=latest".  If the
variable gets set to True, "state=latest" will be used.

Additionally, we update rolling_update.yml to override
upgrade_ceph_packages to true to permit package upgrades in this
context specifically.

Closes issue #506

group_vars/all.sample
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/installs/install_on_debian.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
rolling_update.yml

index 626a7a4297f023e8902a6fdef26b73a9eed6adeb..8d4d101194e2901b2c157f0f0467f21adfa34dea 100644 (file)
@@ -34,6 +34,11 @@ dummy:
 #mds_group_name: mdss
 #restapi_group_name: restapis
 
+# This variable determines if ceph packages can be updated.  If False, the
+# package resources will use "state=present".  If True, they will use
+# "state=latest".
+#upgrade_ceph_packages: False
+
 # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\
 
 #debian_package_dependencies:
index fb31aa8365876a4599907c8d83fd0b54fb7544ff..d8bb1f3806c87cdcf39ddbcbdea101067ffd46da 100644 (file)
@@ -31,6 +31,11 @@ rgw_group_name: rgws
 mds_group_name: mdss\r
 restapi_group_name: restapis\r
 \r
+# This variable determines if ceph packages can be updated.  If False, the
+# package resources will use "state=present".  If True, they will use
+# "state=latest".
+upgrade_ceph_packages: False
+
 # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\\r
 \r
 debian_package_dependencies:\r
index 7a88310c72f0bff1e7a91b8634a9ba5158f69ce0..5f9157e3cd80dca7b785c4e4563d13f93b09d32f 100644 (file)
@@ -14,7 +14,7 @@
 - name: install ceph
   apt:
     pkg: "{{ item }}"
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
     default_release: "{{ ansible_distribution_release }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
   with_items:
     - ceph
@@ -27,7 +27,7 @@
 - name: install rados gateway
   apt:
     pkg: radosgw
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
     update_cache: yes
   when:
     rgw_group_name in group_names
index 0eacdb733f3f7bd589821fa018105d3c9105b615..5e7018d51d2b328ebd24088fc64cb4669d8191eb 100644 (file)
 - name: install ceph
   yum:
     name: ceph
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when: not ceph_stable_rh_storage
 
 - name: install red hat storage ceph mon
   yum:
     name: "{{ item }}"
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   with_items:
     - ceph
     - ceph-mon
@@ -38,7 +38,7 @@
 - name: install red hat storage ceph mon
   dnf:
     name: "{{ item }}"
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   with_items:
     - ceph
     - ceph-mon
@@ -50,7 +50,7 @@
 - name: install red hat storage ceph osd
   yum:
     name: "{{ item }}"
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   with_items:
     - ceph
     - ceph-osd
@@ -62,7 +62,7 @@
 - name: install red hat storage ceph osd
   dnf:
     name: "{{ item }}"
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   with_items:
     - ceph
     - ceph-osd
@@ -94,7 +94,7 @@
 - name: install rados gateway
   yum:
     name: ceph-radosgw
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
     rgw_group_name in group_names and
     ansible_pkg_mgr == "yum"
 - name: install rados gateway
   dnf:
     name: ceph-radosgw
-    state: latest
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
     rgw_group_name in group_names and
     ansible_pkg_mgr == "dnf"
index eb9c12792d36e134b98400b218702f66a2574214..7e89c4b43d59cf8979c896553dafdab3f4df4d48 100644 (file)
@@ -16,6 +16,8 @@
 - hosts: mons
   serial: 1
   sudo: True
+  vars:
+    upgrade_ceph_packages: True
 
   pre_tasks:
     - name: Compress the store as much as possible
@@ -74,6 +76,8 @@
 - hosts: osds
   serial: 1
   sudo: True
+  vars:
+    upgrade_ceph_packages: True
 
   pre_tasks:
     - name: Set OSD flags
 - hosts: mdss
   serial: 1
   sudo: True
+  vars:
+    upgrade_ceph_packages: True
 
   roles:
     - ceph-common
 - hosts: rgws
   serial: 1
   sudo: True
+  vars:
+    upgrade_ceph_packages: True
 
   roles:
     - ceph-common