Merge pull request #1499 from ceph/fix_1494

Common: Do not install ceph-mgr packages on jewel
pull/1500/head
Andrew Schoen 2017-05-04 17:49:53 -05:00 committed by GitHub
commit b7b63fe52b
10 changed files with 28 additions and 8 deletions

View File

@ -62,4 +62,6 @@
pkg: ceph-mgr
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
default_release: "{{ ceph_stable_release_uca | default(ansible_distribution_release) }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
when: mgr_group_name in group_names
when:
- mgr_group_name in group_names
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel

View File

@ -147,4 +147,6 @@
package:
name: ceph-mgr
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: mgr_group_name in group_names
when:
- mgr_group_name in group_names
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel

View File

@ -95,4 +95,6 @@
apt:
pkg: ceph-mgr
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: mgr_group_name in group_names
when:
- mgr_group_name in group_names
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel

View File

@ -75,4 +75,6 @@
package:
name: ceph-mgr
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: mgr_group_name in group_names
when:
- mgr_group_name in group_names
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel

View File

@ -52,6 +52,7 @@
- cephx
- groups.get(mgr_group_name, []) | length > 0
- inventory_hostname == groups[mon_group_name]|last
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel
with_items: "{{ groups.get(mgr_group_name, []) }}"
- include: set_osd_pool_default_pg_num.yml

View File

@ -125,3 +125,4 @@
- item.stat.exists == true
when:
- inventory_hostname == groups[mon_group_name]|last
- ceph_release_num.{{ ceph_stable_release }} > ceph_release_num.jewel

View File

@ -55,4 +55,4 @@
- hosts: mgrs
become: True
roles:
- ceph-mgr
- { role: ceph-mgr, when: "ceph_release_num.{{ ceph_stable_release }} > ceph_release_num.jewel" }

View File

@ -103,4 +103,4 @@
gather_facts: false
become: True
roles:
- ceph-mgr
- { role: ceph-mgr, when: "ceph_release_num.{{ ceph_stable_release }} > ceph_release_num.jewel" }

View File

@ -1,4 +1,5 @@
import pytest
import os
@pytest.fixture()
@ -12,6 +13,10 @@ def node(Ansible, Interface, Command, request):
because it contains the logic to manage which tests a node should run.
"""
ansible_vars = Ansible.get_variables()
# tox will pass in this environment variable. we need to do it this way
# because testinfra does not collect and provide ansible config passed in
# from using --extra-vars
ceph_stable_release = os.environ.get("CEPH_STABLE_RELEASE", "kraken")
node_type = ansible_vars["group_names"][0]
docker = ansible_vars.get("docker")
if not request.node.get_marker(node_type) and not request.node.get_marker('all'):
@ -23,6 +28,9 @@ def node(Ansible, Interface, Command, request):
if request.node.get_marker("docker") and not docker:
pytest.skip("Not a valid test for non-containerized deployments or atomic hosts")
if node_type == "mgrs" and ceph_stable_release == "jewel":
pytest.skip("mgr nodes can not be tested with ceph release jewel")
journal_collocation_test = ansible_vars.get("journal_collocation") or ansible_vars.get("dmcrypt_journal_collocation")
if request.node.get_marker("journal_collocation") and not journal_collocation_test:
pytest.skip("Scenario is not using journal collocation")
@ -66,6 +74,7 @@ def node(Ansible, Interface, Command, request):
cluster_address=cluster_address,
docker=docker,
osds=osds,
ceph_stable_release=ceph_stable_release,
)
return data

View File

@ -1,11 +1,12 @@
import pytest
class TestInstall(object):
def test_ceph_dir_exists(self, File):
def test_ceph_dir_exists(self, File, node):
assert File('/etc/ceph').exists
def test_ceph_dir_is_a_directory(self, File):
def test_ceph_dir_is_a_directory(self, File, node):
assert File('/etc/ceph').is_directory
def test_ceph_conf_exists(self, File, node):