Skip to content

Commit

Permalink
Add installation support for ceph-mds (metadata server).
Browse files Browse the repository at this point in the history
This patch provides support for CephFS filesystems to be used within the
openstack cloud.  The ceph-ansible playbooks in use currently have
support for ceph-mds, this patch allows for creating a service container
to utilize the support.
  • Loading branch information
RedKrieg committed Jul 29, 2019
1 parent c8d05df commit 9c34c2d
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 0 deletions.
5 changes: 5 additions & 0 deletions etc/openstack_deploy/conf.d/ceph.yml.aio
Expand Up @@ -3,6 +3,11 @@ ceph-mon_hosts:
aio1:
ip: 172.29.236.100

# The infra nodes where the Ceph metadata service will run
ceph-mds_hosts:
aio1:
ip: 172.29.236.100

# The nodes that the Ceph OSD disks will be running on
ceph-osd_hosts:
aio1:
Expand Down
3 changes: 3 additions & 0 deletions etc/openstack_deploy/env.d/aio_metal.yml.example
Expand Up @@ -15,6 +15,9 @@ container_skel:
ceph-mon_container:
properties:
is_metal: true
ceph-mds_container:
properties:
is_metal: true
cinder_api_container:
properties:
is_metal: true
Expand Down
Expand Up @@ -106,6 +106,9 @@ shared-infra_hosts: *infrastructure_hosts
# ceph-mon containers
ceph-mon_hosts: *infrastructure_hosts

# ceph-mds containers
ceph-mds_hosts: *infrastructure_hosts

# repository (apt cache, python packages, etc)
repo-infra_hosts: *infrastructure_hosts

Expand Down
1 change: 1 addition & 0 deletions inventory/group_vars/all/ceph.yml
Expand Up @@ -20,6 +20,7 @@ mon_group_name: ceph-mon
mgr_group_name: "{{ mon_group_name }}"
osd_group_name: ceph-osd
rgw_group_name: ceph-rgw
mds_group_name: ceph-mds
ceph_origin: "{{ (ansible_pkg_mgr == 'zypper') | ternary('distro', 'repository') }}"
ceph_repository: community
# The _stable_release var is used by both the OSA ceph_client role and the
Expand Down
99 changes: 99 additions & 0 deletions playbooks/ceph-install.yml
Expand Up @@ -235,3 +235,102 @@
tags:
- ceph
- ceph-osd

- name: Install ceph mdss
hosts: ceph-mds
user: root
vars_files:
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- include: common-tasks/os-log-dir-setup.yml
vars:
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-ceph"
dest: "/var/log/ceph"
- include: common-tasks/unbound-clients.yml
static: no
when:
- hostvars['localhost']['resolvconf_enabled'] | bool
#TODO: mgariepy, revisit to use include_role when https://github.com/ansible/ansible/issues/20077 is fixed
- name: install the ceph stable repository key
rpm_key:
key: "{{ ceph_stable_key }}"
state: present
when:
- ceph_origin == 'repository'
- ceph_repository == 'community'
- ansible_pkg_mgr in ['yum', 'dnf']
- name: add ceph stable repository
package:
name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
state: present
changed_when: false
when:
- ceph_origin == 'repository'
- ceph_repository == 'community'
- ansible_pkg_mgr in ['yum', 'dnf']
- name: Purge yum/dnf cache
command: "{{ ansible_pkg_mgr }} clean all"
when:
- ansible_pkg_mgr in ['yum', 'dnf']
tags:
- skip_ansible_lint
- name: Set default priority for Ceph repos
command: >
yum-config-manager
--enable Ceph
--setopt="Ceph.priority=99"
--enable Ceph-noarch
--setopt="Ceph-noarch.priority=99"
when:
- ansible_pkg_mgr in ['yum', 'dnf']
- name: Gather ceph-mon facts
action: setup
delegate_to: "{{ item }}"
delegate_facts: yes
with_items: "{{ groups[mon_group_name] }}"
when:
- inventory_hostname == ansible_play_hosts[0]
tags:
- ceph-mds
- ceph-mon-facts

# Set the priority of the ceph community apt repo either above or below that of UCA or distro sources
- name: Set apt package pins
include_role:
name: apt_package_pinning
vars:
apt_package_pinning_file_name: "ceph_community_pin.pref"
apt_package_pinning_priority: "{{ (ceph_repository == 'community') | ternary(1000, 100) }}"
apt_pinned_packages: [{ package: '*', release: 'ceph.com' }]
when:
- ansible_pkg_mgr == 'apt'

roles:
- role: ceph-defaults
tags:
- skip_ansible_lint
- role: ceph-common
tags:
- skip_ansible_lint
- role: ceph-config
tags:
- skip_ansible_lint
- role: ceph-mds
tags:
- skip_ansible_lint
- role: system_crontab_coordination
tags:
- crontab

post_tasks:
- include_tasks: "common-tasks/rsyslog-client.yml"
vars:
rsyslog_client_log_rotate_file: ceph_log_rotate
rsyslog_client_log_dir: "/var/log/ceph"
rsyslog_client_config_name: "99-ceph-rsyslog-client.conf"

environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- ceph
- ceph-mds

0 comments on commit 9c34c2d

Please sign in to comment.