Control when ceph packages get updated

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
pull/508/head
Matt Thompson 2016-01-29 15:54:59 +00:00
parent 2665c43f34
commit a227a50ab2
5 changed files with 27 additions and 9 deletions

View File

@ -34,6 +34,11 @@ dummy:
#mds_group_name: mdss #mds_group_name: mdss
#restapi_group_name: restapis #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 /!\ # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\
#debian_package_dependencies: #debian_package_dependencies:

View File

@ -31,6 +31,11 @@ rgw_group_name: rgws
mds_group_name: mdss mds_group_name: mdss
restapi_group_name: restapis 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 /!\ # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\
debian_package_dependencies: debian_package_dependencies:

View File

@ -14,7 +14,7 @@
- name: install ceph - name: install ceph
apt: apt:
pkg: "{{ item }}" 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 ''}}" default_release: "{{ ansible_distribution_release }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
with_items: with_items:
- ceph - ceph
@ -27,7 +27,7 @@
- name: install rados gateway - name: install rados gateway
apt: apt:
pkg: radosgw pkg: radosgw
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
update_cache: yes update_cache: yes
when: when:
rgw_group_name in group_names rgw_group_name in group_names

View File

@ -20,13 +20,13 @@
- name: install ceph - name: install ceph
yum: yum:
name: ceph name: ceph
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: not ceph_stable_rh_storage when: not ceph_stable_rh_storage
- name: install red hat storage ceph mon - name: install red hat storage ceph mon
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
with_items: with_items:
- ceph - ceph
- ceph-mon - ceph-mon
@ -38,7 +38,7 @@
- name: install red hat storage ceph mon - name: install red hat storage ceph mon
dnf: dnf:
name: "{{ item }}" name: "{{ item }}"
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
with_items: with_items:
- ceph - ceph
- ceph-mon - ceph-mon
@ -50,7 +50,7 @@
- name: install red hat storage ceph osd - name: install red hat storage ceph osd
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
with_items: with_items:
- ceph - ceph
- ceph-osd - ceph-osd
@ -62,7 +62,7 @@
- name: install red hat storage ceph osd - name: install red hat storage ceph osd
dnf: dnf:
name: "{{ item }}" name: "{{ item }}"
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
with_items: with_items:
- ceph - ceph
- ceph-osd - ceph-osd
@ -94,7 +94,7 @@
- name: install rados gateway - name: install rados gateway
yum: yum:
name: ceph-radosgw name: ceph-radosgw
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
rgw_group_name in group_names and rgw_group_name in group_names and
ansible_pkg_mgr == "yum" ansible_pkg_mgr == "yum"
@ -102,7 +102,7 @@
- name: install rados gateway - name: install rados gateway
dnf: dnf:
name: ceph-radosgw name: ceph-radosgw
state: latest state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
rgw_group_name in group_names and rgw_group_name in group_names and
ansible_pkg_mgr == "dnf" ansible_pkg_mgr == "dnf"

View File

@ -16,6 +16,8 @@
- hosts: mons - hosts: mons
serial: 1 serial: 1
sudo: True sudo: True
vars:
upgrade_ceph_packages: True
pre_tasks: pre_tasks:
- name: Compress the store as much as possible - name: Compress the store as much as possible
@ -74,6 +76,8 @@
- hosts: osds - hosts: osds
serial: 1 serial: 1
sudo: True sudo: True
vars:
upgrade_ceph_packages: True
pre_tasks: pre_tasks:
- name: Set OSD flags - name: Set OSD flags
@ -133,6 +137,8 @@
- hosts: mdss - hosts: mdss
serial: 1 serial: 1
sudo: True sudo: True
vars:
upgrade_ceph_packages: True
roles: roles:
- ceph-common - ceph-common
@ -167,6 +173,8 @@
- hosts: rgws - hosts: rgws
serial: 1 serial: 1
sudo: True sudo: True
vars:
upgrade_ceph_packages: True
roles: roles:
- ceph-common - ceph-common