-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add possibility to use puppet-librarian-simple in library - add fuel main repo - add disk configuration for osd - add osds - add mons - change node names to solar-dev
- Loading branch information
Showing
22 changed files
with
331 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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 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,5 @@ | ||
# Prepare disk for ceph osd deployment | ||
|
||
Takes only one parameter as disk name and configure it for osd deploy: | ||
- make label | ||
- set guid |
This file contains 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,19 @@ | ||
- hosts: [{{ host }}] | ||
sudo: yes | ||
tasks: | ||
- name: check if disk has gpt | ||
shell: "parted {{disk_name}} print | grep 'Partition Table: gpt'" | ||
register: gpt_created | ||
ignore_errors: True | ||
- name: set gpt label | ||
shell: "echo yes | parted {{disk_name}} mklabel gpt" | ||
ignore_errors: True | ||
when: gpt_created|failed | ||
- name: check if guid set | ||
shell: "sgdisk -i1 {{disk_name}} | grep 'Partition GUID code: 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D'" | ||
register: guid_set | ||
ignore_errors: True | ||
- name: set guid | ||
shell: "sgdisk -n 1:0:9G -t 1:4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D -p {{disk_name}}" | ||
ignore_errors: True | ||
when: guid_set|failed |
This file contains 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 @@ | ||
id: ceph_disk | ||
handler: ansible | ||
version: 1.0.0 | ||
input: | ||
disk_name: | ||
schema: str | ||
value: '/dev/vdb' |
This file contains 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,9 @@ | ||
# Prepare ceph keys | ||
|
||
This resource prepare ceph keys for future ceph cluster deployment. | ||
|
||
Takes 3 parameters: | ||
- target_directory, default - '/var/lib/astute/' | ||
- key_name, default - 'ceph' | ||
- path, default - '/var/lib/astute/ceph/' | ||
|
This file contains 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 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,42 @@ | ||
# Deploy ceph mon | ||
|
||
This resource deploy ceph mon. | ||
|
||
Example: | ||
|
||
``` | ||
STORAGE = {'objects_ceph': True, | ||
'osd_pool_size': 2, | ||
'pg_num': 128} | ||
KEYSTONE = {'admin_token': 'abcde'} | ||
NETWORK_SCHEMA = { | ||
'endpoints': {'eth1': {'IP': ['10.0.0.3/24']}}, | ||
'roles': {'ceph/replication': 'eth1', | ||
'ceph/public': 'eth1'} | ||
} | ||
NETWORK_METADATA = yaml.load(""" | ||
solar-dev1: | ||
uid: '1' | ||
fqdn: solar-dev1 | ||
network_roles: | ||
ceph/public: 10.0.0.3 | ||
ceph/replication: 10.0.0.3 | ||
node_roles: | ||
- ceph-mon | ||
name: solar-dev1 | ||
""") | ||
ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon', | ||
{'storage': STORAGE, | ||
'keystone': KEYSTONE, | ||
'network_scheme': NETWORK_SCHEMA, | ||
'ceph_monitor_nodes': NETWORK_METADATA, | ||
'ceph_primary_monitor_node': NETWORK_METADATA, | ||
'role': 'primary-controller', | ||
})[0] | ||
``` |
This file contains 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 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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
id: ceph_mon | ||
handler: puppetv2 | ||
version: 1.0.0 | ||
actions: | ||
run: run.pp | ||
update: run.pp | ||
input: | ||
ip: | ||
schema: str! | ||
|
This file contains 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,42 @@ | ||
# Deploy ceph osd | ||
|
||
This resource deploy ceph osd with preprepaired disk drives. | ||
|
||
Example: | ||
|
||
``` | ||
STORAGE = {'objects_ceph': True, | ||
'osd_pool_size': 2, | ||
'pg_num': 128} | ||
KEYSTONE = {'admin_token': 'abcde'} | ||
NETWORK_SCHEMA = { | ||
'endpoints': {'eth1': {'IP': ['10.0.0.3/24']}}, | ||
'roles': {'ceph/replication': 'eth1', | ||
'ceph/public': 'eth1'} | ||
} | ||
NETWORK_METADATA = yaml.load(""" | ||
solar-dev1: | ||
uid: '1' | ||
fqdn: solar-dev1 | ||
network_roles: | ||
ceph/public: 10.0.0.3 | ||
ceph/replication: 10.0.0.3 | ||
node_roles: | ||
- ceph-mon | ||
name: solar-dev1 | ||
""") | ||
ceph_osd = vr.create('ceph_osd2', 'resources/ceph_osd', | ||
{'storage': STORAGE, | ||
'keystone': KEYSTONE, | ||
'network_scheme': NETWORK_SCHEMA, | ||
'ceph_monitor_nodes': NETWORK_METADATA, | ||
'ceph_primary_monitor_node': NETWORK_METADATA, | ||
'role': 'ceph-osd', | ||
})[0] | ||
``` |
This file contains 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,59 @@ | ||
notice('MODULAR: ceph-osd.pp') | ||
|
||
# Pulling hiera | ||
$storage_hash = hiera('storage', {}) | ||
$public_vip = hiera('public_vip') | ||
$management_vip = hiera('management_vip') | ||
$use_neutron = hiera('use_neutron', false) | ||
#$mp_hash = hiera('mp') | ||
$verbose = pick($storage_hash['verbose'], true) | ||
$debug = pick($storage_hash['debug'], hiera('debug', true)) | ||
$use_monit = false | ||
$auto_assign_floating_ip = hiera('auto_assign_floating_ip', false) | ||
$keystone_hash = hiera('keystone', {}) | ||
$access_hash = hiera('access', {}) | ||
$network_scheme = hiera_hash('network_scheme') | ||
$neutron_mellanox = hiera('neutron_mellanox', false) | ||
$syslog_hash = hiera('syslog', {}) | ||
$use_syslog = hiera('use_syslog', true) | ||
$mon_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('ceph_monitor_nodes'), 'ceph/public') | ||
$ceph_primary_monitor_node = hiera('ceph_primary_monitor_node') | ||
$primary_mons = keys($ceph_primary_monitor_node) | ||
$primary_mon = $ceph_primary_monitor_node[$primary_mons[0]]['name'] | ||
prepare_network_config($network_scheme) | ||
$ceph_cluster_network = get_network_role_property('ceph/replication', 'network') | ||
$ceph_public_network = get_network_role_property('ceph/public', 'network') | ||
|
||
class {'firewall': } -> | ||
|
||
class {'ceph': | ||
primary_mon => $primary_mon, | ||
mon_hosts => keys($mon_address_map), | ||
mon_ip_addresses => values($mon_address_map), | ||
cluster_node_address => $public_vip, | ||
osd_pool_default_size => $storage_hash['osd_pool_size'], | ||
osd_pool_default_pg_num => $storage_hash['pg_num'], | ||
osd_pool_default_pgp_num => $storage_hash['pg_num'], | ||
use_rgw => $storage_hash['objects_ceph'], | ||
glance_backend => $glance_backend, | ||
rgw_pub_ip => $public_vip, | ||
rgw_adm_ip => $management_vip, | ||
rgw_int_ip => $management_vip, | ||
cluster_network => $ceph_cluster_network, | ||
public_network => $ceph_public_network, | ||
use_syslog => $use_syslog, | ||
syslog_log_level => hiera('syslog_log_level_ceph', 'info'), | ||
syslog_log_facility => hiera('syslog_log_facility_ceph','LOG_LOCAL0'), | ||
rgw_keystone_admin_token => $keystone_hash['admin_token'], | ||
ephemeral_ceph => $storage_hash['ephemeral_ceph'], | ||
} | ||
|
||
$osd_devices = split($::osd_devices_list, ' ') | ||
#Class Ceph is already defined so it will do it's thing. | ||
notify {"ceph_osd: ${osd_devices}": } | ||
notify {"osd_devices: ${::osd_devices_list}": } | ||
# TODO(bogdando) add monit ceph-osd services monitoring, if required | ||
|
||
################################################################# | ||
|
||
# vim: set ts=2 sw=2 et : |
Oops, something went wrong.