From 7e284920d190b6ae4a58c6def283bc35c6861e9b Mon Sep 17 00:00:00 2001 From: James Saint-Rossy Date: Wed, 24 Aug 2016 00:23:47 -0400 Subject: [PATCH] Fixes for Hammer install and added numerical release checks --- roles/ceph-common/defaults/main.yml | 9 +++++++ .../tasks/installs/install_on_redhat.yml | 14 +++++------ roles/ceph-common/tasks/main.yml | 24 +++++++++++++++++++ roles/ceph-mon/tasks/start_monitor.yml | 20 ++++++++++++---- 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 3e4cc259e..f546538a1 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -115,6 +115,15 @@ ceph_stable_releases: - hammer - infernalis +ceph_release_num: + dumpling: 0.67 + emperor: 0.72 + firefly: 0.80 + giant: 0.87 + hammer: 0.94 + infernalis: 9 + jewel: 10 + # Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions # # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/ # for more info read: https://github.com/ceph/ceph-ansible/issues/305 diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index b3561fdbc..91f40e679 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -3,7 +3,7 @@ yum: name: "{{ item }}" state: present - with_items: redhat_package_dependencies + with_items: "{{ redhat_package_dependencies }}" when: - ansible_distribution == "RedHat" - ansible_pkg_mgr == "yum" @@ -12,7 +12,7 @@ dnf: name: "{{ item }}" state: present - with_items: redhat_package_dependencies + with_items: "{{ redhat_package_dependencies }}" when: - ansible_distribution == "RedHat" - ansible_pkg_mgr == "dnf" @@ -21,7 +21,7 @@ yum: name: "{{ item }}" state: present - with_items: centos_package_dependencies + with_items: "{{ centos_package_dependencies }}" when: - ansible_distribution == "CentOS" - ansible_pkg_mgr == "yum" @@ -30,7 +30,7 @@ dnf: name: "{{ item }}" state: present - with_items: centos_package_dependencies + with_items: "{{ centos_package_dependencies }}" when: - ansible_distribution == "CentOS" - ansible_pkg_mgr == "dnf" @@ -58,7 +58,7 @@ copy: src: "{{ansible_dir}}/rundep" dest: "{{ item }}" - with_items: rundep_location.stdout_lines + with_items: "{{ rundep_location }}.stdout_lines" when: - ceph_origin == 'local' - use_installer @@ -66,7 +66,7 @@ - name: install ceph dependencies script: "{{ ansible_dir }}/rundep_installer.sh {{ item }}" become: true - with_items: rundep_location.stdout_lines + with_items: "{{ rundep_location }}.stdout_lines" when: - ceph_origin == 'local' - use_installer @@ -76,7 +76,7 @@ name: ceph state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - - not use_server_package_split + - ceph_release_num.{{ ceph_stable_release}} <= ceph_release_num.infernalis - ansible_pkg_mgr == "yum" - ceph_origin != 'local' diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 54edb2256..7ae1ac9e3 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -5,9 +5,13 @@ - include: ./checks/check_firewall.yml when: check_firewall + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./misc/system_tuning.yml when: osd_group_name in group_names + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./pre_requisites/prerequisite_rh_storage_iso_install.yml when: @@ -15,6 +19,8 @@ - ceph_rhcs_iso_install tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./pre_requisites/prerequisite_rh_storage_cdn_install.yml when: @@ -23,6 +29,8 @@ - ansible_os_family == "RedHat" tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_on_redhat.yml when: @@ -30,6 +38,8 @@ not ceph_rhcs_iso_install tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_rh_storage_on_redhat.yml when: @@ -37,6 +47,8 @@ - ceph_rhcs tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_on_debian.yml when: @@ -44,6 +56,8 @@ - not ceph_rhcs tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_rh_storage_on_debian.yml when: @@ -51,6 +65,8 @@ - ceph_rhcs tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_rgw_on_redhat.yml when: @@ -59,6 +75,8 @@ - rgw_group_name in group_names tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./installs/install_rgw_on_debian.yml when: @@ -67,16 +85,22 @@ - rgw_group_name in group_names tags: - package-install + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./misc/ntp_redhat.yml when: - ansible_os_family == 'RedHat' - ntp_service_enabled + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: ./misc/ntp_debian.yml when: - ansible_os_family == 'Debian' - ntp_service_enabled + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False - include: facts.yml diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index 846c77392..641461662 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -20,14 +20,26 @@ when: - not use_systemd -# NOTE (leseb): somehow the service ansible module is messing things up -# as a safety measure we run the raw command +# legacy ceph system v init scripts require a mon section in order to work +- name: add mon section into ceph.conf for systemv init scripts + ini_file: + dest: /etc/ceph/ceph.conf + section: mon.{{ ansible_host }} + option: host + value: "{{ ansible_host }}" + state: present + when: + - ansible_os_family == "RedHat" + - ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis + +# NOTE (jsaintrocc): can't use service module because we need to use the +# legacy systemv init for older ceph releases. Even when the os supports systemd - name: start and add that the monitor service to the init sequence command: service ceph start mon changed_when: false when: - - ansible_distribution != "Ubuntu" - - is_before_infernalis + - ansible_os_family == "RedHat" + - ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis - name: start and add that the monitor service to the init sequence (for or after infernalis) command: systemctl enable ceph-mon@{{ monitor_name }} -- 2.47.3