Adding the Ceph Ansible modules

We can use git to clone the Ceph Ansible repository:

    git clone https://github.com/ceph/ceph-ansible.git

sudo cp -a ceph-ansible/* /etc/ansible/

The preceding commands gives the following output:

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

  • group_vars: We've already covered what lives in here and will explore the possible configuration options in more detail later.
  • infrastructure-playbooks: This directory contains prewritten playbooks to carry out some standard tasks, such as deploying cluster 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 what are called via the 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 either are required to set or are advised to be changed from their defaults. For the remaining variables, it is suggested that you read the comments in the variable files.

The following are the key variables from global:

#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 the modules use to identify the types of Ceph hosts. 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'

Set to upstream to use the packages generated by the Ceph team, or distro for packages generated by your distribution maintainer. Setting to upstream is recommended if you want to be able to upgrade Ceph independently of your distribution.

By default a fsid will be generated for your cluster and stored in a file where it can be referenced again:

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

You shouldn't need to touch this unless you want control over the fsid or you wish to hard code the fsid in the group variable file.

#monitor_interface: interface
#monitor_address: 0.0.0.0

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

#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 is (notice the indentation):

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

Key variables from OSD variable file:

#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 whole configuration of Ansible. They control what disks get used as OSDs and how the 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 will use the 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 that 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
18.119.159.178