ceph/ceph-deploy — pull request #233 by alfredodeza (2014-08-19 21:05:36+00:00)
Title: write public and cluster networks to ceph.conf

And attempt to do some very minor validation if we are passed in those values.

Validation:
ceph-deploy new --public-network=0/0/0/0 node2
usage: ceph-deploy new [-h] [--no-ssh-copykey] [--fsid FSID]
[--cluster-network CLUSTER_NETWORK]
[--public-network PUBLIC_NETWORK]
MON [MON ...]
ceph-deploy new: error: subnet must have at least 4 numbers separated by dots like x.x.x.x/xx, but got: 0/0/0/0

Public network works:
(ceph-deploy)papaya ~/tmp/foo ᓆ ceph-deploy new --public-network=0.0.0.0/0 node2
[ceph_deploy.conf][DEBUG ] found configuration file at: /Users/alfredo/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (1.5.11): /Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy new --public-network=0.0.0.0/0 node2
[ceph_deploy.new][DEBUG ] Creating new cluster named ceph
[ceph_deploy.new][DEBUG ] Resolving host node2
[ceph_deploy.new][DEBUG ] Monitor node2 at 192.168.111.101
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[node2][DEBUG ] connected to host: papaya.local
[node2][INFO ] Running command: ssh -CT -o BatchMode=yes node2
[ceph_deploy.new][DEBUG ] Monitor initial members are ['node2']
[ceph_deploy.new][DEBUG ] Monitor addrs are ['192.168.111.101']
[ceph_deploy.new][DEBUG ] Creating a random mon key...
[ceph_deploy.new][DEBUG ] Writing initial config to ceph.conf...
[ceph_deploy.new][DEBUG ] Writing monitor keyring to ceph.mon.keyring...
(ceph-deploy)papaya ~/tmp/foo ᓆ cat ceph.conf
[global]
fsid = 02c59437-40e8-4f98-afa8-3758bc64c3fd
public_network = 0.0.0.0/0
mon_initial_members = node2
mon_host = 192.168.111.101
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true

Both public and cluster network works:
(ceph-deploy)papaya ~/tmp/foo ᓆ ceph-deploy new --cluster-network=192.168.1.0/24 --public-network=0.0.0.0/0 node2
^[[6~[ceph_deploy.conf][DEBUG ] found configuration file at: /Users/alfredo/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (1.5.11): /Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy new --cluster-network=192.168.1.0/24 --public-network=0.0.0.0/0 node2
[ceph_deploy.new][DEBUG ] Creating new cluster named ceph
[ceph_deploy.new][DEBUG ] Resolving host node2
[ceph_deploy.new][DEBUG ] Monitor node2 at 192.168.111.101
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[node2][DEBUG ] connected to host: papaya.local
[node2][INFO ] Running command: ssh -CT -o BatchMode=yes node2
[ceph_deploy.new][DEBUG ] Monitor initial members are ['node2']
[ceph_deploy.new][DEBUG ] Monitor addrs are ['192.168.111.101']
[ceph_deploy.new][DEBUG ] Creating a random mon key...
[ceph_deploy.new][DEBUG ] Writing initial config to ceph.conf...
[ceph_deploy.new][DEBUG ] Writing monitor keyring to ceph.mon.keyring...
(ceph-deploy)papaya ~/tmp/foo ᓆ cat ceph.conf
[global]
fsid = 549e3af9-a416-40ad-b08d-c6ddbbce5a46
public_network = 0.0.0.0/0
cluster_network = 192.168.1.0/24
mon_initial_members = node2
mon_host = 192.168.111.101
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true