forked from ceph/ceph-ansible
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ceph-mgr package installation
The code for installing the ceph-mgr packages had several conditionals which mean that certain features are only available on specific operating systems and any OS specific packaging differences must be expressed entirely in ansible tasks. This patch takes a design pattern used extensively in openstack-ansible and uses it for the ceph-mgr installation. The packages to install are specificed in OS specific vars files which are loaded as required at runtime and referenced through the role defaults. This means that the OS specific conditionals are removed from the ansible tasks, and the deployer can now override the package lists supplied in the ceph-mgr vars if required. This patch fixes two install failures, Centos-8 does not have python3-saml [1] so this package is commented out as it is not generally available, and all debian derivative OS are assumed to be running python3, so python3-routes is preferred instead of python-routes which fixes installs on Ubuntu Focal. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1819302
- Loading branch information
Jonathan Rosser
committed
Jun 18, 2020
1 parent
d677596
commit e925910
Showing
6 changed files
with
42 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,17 @@ | ||
--- | ||
- name: set_fact ceph_mgr_packages for sso | ||
set_fact: | ||
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['python3-saml' if ansible_distribution_major_version | int == 8 else 'python-saml']) }}" | ||
when: | ||
- dashboard_enabled | bool | ||
- ansible_distribution == 'RedHat' | ||
|
||
- name: set_fact ceph_mgr_packages for dashboard | ||
set_fact: | ||
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['ceph-mgr-dashboard']) }}" | ||
when: dashboard_enabled | bool | ||
|
||
- name: set_fact ceph_mgr_packages for non el7 distribution | ||
set_fact: | ||
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['ceph-mgr-diskprediction-local']) }}" | ||
when: | ||
- ansible_os_family != 'RedHat' | ||
- ansible_distribution_major_version | int != 7 | ||
|
||
- name: install ceph-mgr packages on RedHat or SUSE | ||
package: | ||
name: '{{ ceph_mgr_packages }}' | ||
name: '{{ ceph_mgr_all_packages }}' | ||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" | ||
register: result | ||
until: result is succeeded | ||
when: ansible_os_family in ['RedHat', 'Suse'] | ||
|
||
- name: install ceph-mgr packages for debian | ||
apt: | ||
name: '{{ ceph_mgr_packages }}' | ||
name: '{{ ceph_mgr_all_packages }}' | ||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" | ||
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else ''}}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}" | ||
register: result | ||
until: result is succeeded | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: install routes python library for dashboard module | ||
apt: | ||
name: python-routes | ||
register: result | ||
until: result is succeeded | ||
when: | ||
- ansible_os_family == 'Debian' | ||
- "'ceph-mgr-dashboard' in ceph_mgr_packages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
_ceph_mgr_packages: | ||
- ceph_mgr | ||
This comment has been minimized.
Sorry, something went wrong. |
||
- ceph-mgr-diskprediction-local | ||
|
||
_ceph_mgr_dashboard_packages: | ||
- ceph_mgr_dashboard | ||
- python3-routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
_ceph_mgr_packages: | ||
- ceph_mgr | ||
|
||
_ceph_mgr_dashboard_packages: | ||
- ceph_mgr_dashboard | ||
# python-saml does not appear to be available outside of RHEL subscriptions | ||
# - python-saml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
_ceph_mgr_packages: | ||
- ceph_mgr | ||
- ceph_mgr_diskprediction-local | ||
|
||
_ceph_mgr_dashboard_packages: | ||
- ceph_mgr_dashboard | ||
# python3-saml does not appear to be available outside of RHEL subscriptions | ||
# - python3-saml |
ceph-mgr