-
Notifications
You must be signed in to change notification settings - Fork 23
Multinode deploy ceph #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3a46161
feat: update vxlan role version and expand hosts
jackhodgkiss c0b6dba
feat: add cephadm playbooks
jackhodgkiss b8a0e31
feat: update pulp for cephadm
jackhodgkiss cdb882d
feat: enable ceph and ceph related services
jackhodgkiss 849fcc4
fix: add a trailing newline to ceph.conf
jackhodgkiss c7d0ba3
fix: type in unwanted variable
jackhodgkiss 721c189
feat: pull vxlan from ansible galaxy
jackhodgkiss f537f1d
feat: use vxlan role pulled from ansible galaxy
jackhodgkiss dec91c7
fix: requirements.yml
jackhodgkiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Define Ceph CRUSH rules | ||
gather_facts: false | ||
hosts: mons | ||
become: true | ||
tags: | ||
- cephadm | ||
- cephadm-crush-rules | ||
tasks: | ||
- import_role: | ||
name: stackhpc.cephadm.crush_rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Deploy Ceph using Cephadm | ||
any_errors_fatal: true | ||
gather_facts: true | ||
hosts: ceph | ||
tags: | ||
- cephadm | ||
- cephadm-deploy | ||
tasks: | ||
- import_role: | ||
name: stackhpc.cephadm.cephadm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Define Ceph EC profiles | ||
gather_facts: false | ||
hosts: mons | ||
become: true | ||
tags: | ||
- cephadm | ||
- cephadm-ec-profiles | ||
tasks: | ||
- import_role: | ||
name: stackhpc.cephadm.ec_profiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
- name: Gather Ceph configuration and keys and populate kayobe-config | ||
gather_facts: false | ||
hosts: mons | ||
run_once: true | ||
tags: | ||
- cephadm | ||
- cephadm-gather-keys | ||
vars: | ||
# Map from an OpenStack service to the directory in which to store Ceph keys for it. | ||
kolla_service_to_key_dir: | ||
cinder-backup: cinder/cinder-backup | ||
cinder-volume: cinder/cinder-volume | ||
glance: glance | ||
manila: manila | ||
nova: nova | ||
# Map from an OpenStack service to the directory in which to store Ceph configuration for it. | ||
kolla_service_to_conf_dir: | ||
cinder-backup: cinder | ||
cinder-volume: cinder | ||
glance: glance | ||
manila: manila | ||
nova: nova | ||
tasks: | ||
- name: Get Ceph keys | ||
stackhpc.cephadm.cephadm_key: | ||
name: "{{ item }}" | ||
output_format: plain | ||
state: info | ||
register: cephadm_key_info | ||
become: true | ||
loop: "{{ kolla_ceph_services | selectattr('required') | map(attribute='keys') | flatten | unique }}" | ||
|
||
- name: Generate ceph.conf | ||
command: "cephadm shell -- ceph config generate-minimal-conf" | ||
become: true | ||
register: cephadm_ceph_conf | ||
changed_when: false | ||
|
||
- name: Ensure Kolla config directories are present | ||
file: | ||
state: directory | ||
path: "{{ kayobe_env_config_path }}/kolla/config/{{ kolla_service_to_key_dir[item.name] }}" | ||
loop: "{{ kolla_ceph_services | selectattr('required') }}" | ||
loop_control: | ||
label: | ||
service: "{{ item.name }}" | ||
delegate_to: localhost | ||
|
||
- name: Save Ceph keys to Kayobe configuration | ||
vars: | ||
key_info: "{{ cephadm_key_info.results | selectattr('item', 'equalto', item.1) | first }}" | ||
cephadm_key: "{{ key_info.stdout }}" | ||
cephadm_user: "{{ item.1 }}" | ||
copy: | ||
# Include a trailing newline. | ||
content: | | ||
{{ cephadm_key }} | ||
dest: "{{ kayobe_env_config_path }}/kolla/config/{{ kolla_service_to_key_dir[item.0.name] }}/ceph.{{ cephadm_user }}.keyring" | ||
loop: "{{ query('subelements', kolla_ceph_services | selectattr('required'), 'keys') }}" | ||
loop_control: | ||
label: | ||
service: "{{ item.0.name }}" | ||
key: "{{ item.1 }}" | ||
delegate_to: localhost | ||
notify: Please add and commit the Kayobe configuration | ||
|
||
- name: Save ceph.conf to Kayobe configuration | ||
copy: | ||
# Include a trailing newline. | ||
# Kolla Ansible's merge_configs module does not like the leading tabs in ceph.conf. | ||
content: | | ||
{{ cephadm_ceph_conf.stdout | regex_replace('\t') }} | ||
dest: "{{ kayobe_env_config_path }}/kolla/config/{{ kolla_service_to_conf_dir[item.0.name] }}/ceph.conf" | ||
loop: "{{ query('subelements', kolla_ceph_services | selectattr('required'), 'keys') }}" | ||
loop_control: | ||
label: | ||
service: "{{ item.0.name }}" | ||
key: "{{ item.1 }}" | ||
delegate_to: localhost | ||
notify: Please add and commit the Kayobe configuration | ||
|
||
handlers: | ||
- name: Please add and commit the Kayobe configuration | ||
debug: | ||
msg: >- | ||
Please add and commit the Ceph configuration files and keys in Kayobe | ||
configuration. Remember to encrypt the keys using Ansible Vault. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Generate Ceph keys | ||
gather_facts: false | ||
hosts: mons | ||
become: true | ||
tags: | ||
- cephadm | ||
- cephadm-keys | ||
tasks: | ||
- import_role: | ||
name: stackhpc.cephadm.keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Define Ceph pools | ||
gather_facts: false | ||
hosts: mons | ||
become: true | ||
tags: | ||
- cephadm | ||
- cephadm-keys | ||
tasks: | ||
- import_role: | ||
name: stackhpc.cephadm.pools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# Deploy Ceph via Cephadm. Create EC profiles, CRUSH rules, pools and keys. | ||
- import_playbook: cephadm-deploy.yml | ||
- import_playbook: cephadm-ec-profiles.yml | ||
- import_playbook: cephadm-crush-rules.yml | ||
- import_playbook: cephadm-pools.yml | ||
- import_playbook: cephadm-keys.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
--- | ||
############################################################################### | ||
# Cephadm deployment configuration. | ||
|
||
# Ceph release name. | ||
cephadm_ceph_release: "pacific" | ||
|
||
# Ceph FSID. | ||
#cephadm_fsid: | ||
|
||
# Ceph container image. | ||
cephadm_image: "quay.io/ceph/ceph:v16.2.5" | ||
|
||
# Ceph container image tag. | ||
cephadm_image_tag: "v16.2.5" | ||
|
||
# Ceph container image registry URL. | ||
cephadm_registry_url: "{{ stackhpc_docker_registry }}" | ||
|
||
# Ceph container image registry username. | ||
cephadm_registry_username: "{{ stackhpc_docker_registry_username }}" | ||
|
||
# Ceph container image registry password. | ||
cephadm_registry_password: "{{ stackhpc_docker_registry_password }}" | ||
|
||
# Cephadm admin network interface. | ||
cephadm_admin_interface: "{{ admin_oc_net_name | net_interface }}" | ||
|
||
# Ceph public network interface. | ||
cephadm_public_interface: "{{ storage_net_name | net_interface }}" | ||
|
||
# Ceph public network subnet CIDR. | ||
cephadm_public_network: "{{ storage_net_name | net_cidr }}" | ||
|
||
# Ceph cluster network interface. | ||
cephadm_cluster_interface: "{{ storage_mgmt_net_name | net_interface }}" | ||
|
||
# Ceph cluster network subnet CIDR. | ||
cephadm_cluster_network: "{{ storage_mgmt_net_name | net_cidr }}" | ||
|
||
# Whether to enable firewalld for Ceph storage hosts. | ||
#cephadm_enable_firewalld: | ||
|
||
# Ceph OSD specification. | ||
cephadm_osd_spec: | ||
service_type: osd | ||
service_id: osd_spec_default | ||
placement: | ||
host_pattern: "*" | ||
data_devices: | ||
all: true | ||
|
||
############################################################################### | ||
# Ceph post-deployment configuration. | ||
|
||
# List of Ceph erasure coding profiles. See stackhpc.cephadm.ec_profiles role | ||
# for format. | ||
cephadm_ec_profiles: [] | ||
|
||
# List of Ceph CRUSH rules. See stackhpc.cephadm.crush_rules role for format. | ||
cephadm_crush_rules: [] | ||
|
||
# List of Ceph pools. See stackhpc.cephadm.pools role for format. | ||
cephadm_pools: | ||
- name: backups | ||
application: rbd | ||
state: present | ||
- name: images | ||
application: rbd | ||
state: present | ||
- name: volumes | ||
application: rbd | ||
state: present | ||
- name: vms | ||
application: rbd | ||
state: present | ||
|
||
# List of Cephx keys. See stackhpc.cephadm.keys role for format. | ||
cephadm_keys: | ||
- name: client.cinder | ||
caps: | ||
mon: "profile rbd" | ||
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images" | ||
mgr: "profile rbd pool=volumes, profile rbd pool=vms" | ||
state: present | ||
- name: client.cinder-backup | ||
caps: | ||
mon: "profile rbd" | ||
osd: "profile rbd pool=volumes, profile rbd pool=backups" | ||
mgr: "profile rbd pool=volumes, profile rbd pool=backups" | ||
state: present | ||
- name: client.glance | ||
caps: | ||
mon: "profile rbd" | ||
osd: "profile rbd pool=images" | ||
mgr: "profile rbd pool=images" | ||
state: present | ||
|
||
############################################################################### | ||
# Kolla Ceph auto-configuration. | ||
|
||
# List of Kolla Ansible services that require Ceph configuration files. | ||
kolla_ceph_services: | ||
- name: cinder-backup | ||
keys: | ||
- client.cinder | ||
- client.cinder-backup | ||
required: "{{ kolla_ceph_cinder_backup_required | bool }}" | ||
- name: cinder-volume | ||
keys: | ||
- client.cinder | ||
required: "{{ kolla_ceph_cinder_volume_required | bool }}" | ||
- name: glance | ||
keys: | ||
- client.glance | ||
required: "{{ kolla_ceph_glance_required | bool }}" | ||
- name: manila | ||
keys: | ||
- client.manila | ||
required: "{{ kolla_ceph_manila_required | bool }}" | ||
- name: nova | ||
keys: | ||
- client.cinder | ||
required: "{{ kolla_ceph_nova_required | bool }}" | ||
|
||
# Whether to generate Ceph configuration for Cinder volume. | ||
kolla_ceph_cinder_volume_required: "{{ kolla_enable_cinder | bool }}" | ||
|
||
# Whether to generate Ceph configuration for Cinder backup. | ||
kolla_ceph_cinder_backup_required: "{{ kolla_enable_cinder_backup | default(false) | bool }}" | ||
|
||
# Whether to generate Ceph configuration for Glance. | ||
kolla_ceph_glance_required: "{{ kolla_enable_glance | bool }}" | ||
|
||
# Whether to generate Ceph configuration for Manila. | ||
kolla_ceph_manila_required: "{{ kolla_enable_manila | bool }}" | ||
|
||
# Whether to generate Ceph configuration for Nova. | ||
kolla_ceph_nova_required: "{{ kolla_enable_nova | bool }}" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
kolla_enable_cinder: true | ||
kolla_enable_cinder_backup: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.