Adding the Ceph Ansible modules

We can use Git to clone the Ceph Ansible repository, as follows:

git clone https://github.com/ceph/ceph-ansible.git
git checkout stable-3.2
sudo cp -a ceph-ansible/* /etc/ansible/

We also need to install a few extra packages that ceph-ansible requires:

sudo apt-get install python-pip

sudo pip install notario netaddr

Let's also explore some key folders in the Git repository:

  • group_vars: We've already covered what lives here and will explore possible configuration options in more detail later
  • infrastructure-playbooks: This directory contains pre-written playbooks to carry out some standard tasks, such as deploying clusters or adding OSDs to an existing one. The comments at the top of the playbooks give a good idea of what they do.
  • roles: This directory contains all the roles that make up the Ceph Ansible modules. You will see that there is a role for each Ceph component; these are called via playbooks to install, configure, and maintain Ceph.

In order to be able to deploy a Ceph cluster with Ansible, a number of key variables need to be set in the group_vars directory. The following variables are required to be set; alternatively, it's recommended you change them from their defaults. For the remaining variables, it suggested that you read the comments in the variable files. Key global variables include the following:

    #mon_group_name: mons
    #osd_group_name: osds
    #rgw_group_name: rgws
    #mds_group_name: mdss
    #nfs_group_name: nfss
    ...
    #iscsi_group_name: iscsigws  

These control what group name modules use to identify the Ceph host types. If you will be using Ansible in a wider setting, it might be advisable to prepend ceph- to the start to make it clear that these groups are related to Ceph:

#ceph_origin: 'upstream' # or 'distro' or 'local'  

Employ the 'upstream' setting to use packages generated by the Ceph team, or distro for packages generated by your distribution maintainer. The former is recommended if you want to be able to upgrade Ceph independently of your distribution:

#fsid: "{{ cluster_uuid.stdout }}"
#generate_fsid: true  

By default, a fsid will be generated for your cluster and stored in a file where it can be referenced again. You shouldn't need to touch this unless you want control over the fsid or you wish to hardcode the fsid in the group variable file:

#monitor_interface: interface
#monitor_address: 0.0.0.0  

One of the preceding commands should be specified. If you are using a variable in group_vars then you probably want to use monitor_interface, which is the interface name in Linux, as they will probably be the same across all mons. Otherwise if you specify monitor_address in host_vars, you can specify the IP of the interface, which obviously will be different across your three or more mons:

#ceph_conf_overrides: {}  

Not every Ceph variable is directly managed by Ansible, but the preceding variable is provided to allow you to pass any extra variables through to the ceph.conf file and its corresponding sections. An example of how this would look follows (notice the indentation):

    ceph_conf_overrides:
      global:
        variable1: value
      mon:
        variable2: value
      osd:
        variable3: value  

Key variables from the OSD variable file are as follows:

    #copy_admin_key: false  

If you want to be able to manage your cluster from your OSD nodes instead of just your monitors, set this to true, which will copy the admin key to your OSD nodes:

 #devices: []
#osd_auto_discovery: false
#journal_collocation: false
#raw_multi_journal: false
#raw_journal_devices: []

These are probably the most crucial set of variables in the entire configuration of Ansible. They control what disks get used as OSDs and how journals are placed. You can either manually specify the devices that you wish to use as OSDs or you can use auto discovery. The examples in this book use static device configuration.

The journal_collocation variable sets whether you want to store the journal on the same disk as the OSD data; a separate partition will be created for it.

raw_journal_devices allows you to specify the devices you wish to use for journals. Quite often, a single SSD will be a journal for several OSDs; in this case, enable raw_multi_journal and simply specify the journal device multiple times; no partition numbers are needed if you want Ansible to instruct ceph-disk to create them for you.

These are the main variables that you should need to consider; it is recommended you read the comments in the variable files to see if there are any others you may need to modify for your environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.74.160