Implement library resource

This commit is contained in:
Dmitry Shulyak 2015-10-09 12:41:13 +03:00
parent 8dfc414bc3
commit 61566b6a66
4 changed files with 55 additions and 17 deletions

View File

@ -20,15 +20,15 @@ NETWORK_SCHEMA = {
}
NETWORK_METADATA = yaml.load("""
node-1:
solar-dev1:
uid: '1'
fqdn: node-1
fqdn: solar-dev1
network_roles:
ceph/public: 10.0.0.3
ceph/replication: 10.0.0.3
node_roles:
- ceph-mon
name: node-1
name: solar-dev1
""")
@ -38,17 +38,20 @@ def deploy():
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 1})
first_node = next(x for x in resources if x.name.startswith('node'))
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': 'controller',
})[0]
first_node.connect(ceph_mon)
first_node.connect(ceph_mon, {'ip': 'public_vip'})
first_node.connect(ceph_mon, {'ip': 'management_vip'})
library = vr.create('library1', 'resources/fuel_library', {})[0]
first_node.connect(library)
# TODO(use library resource)
# 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': 'controller',
# })[0]
# first_node.connect(ceph_mon,
# {'ip': ['ip', 'public_vip', 'management_vip']})
if __name__ == '__main__':

View File

@ -1,8 +1,6 @@
id: ceph_mon
handler: puppet
version: 1.0.0
input:
library:
schema: {repository: str!, branch: str!, puppet_modules: str}
@ -39,5 +37,4 @@ input:
role:
schema: str!
value:
tags: []

View File

@ -0,0 +1,20 @@
#!/bin/bash
mkdir -p {{temp_directory}}
pushd {{temp_directory}}
if [ ! -d fuel-library ]
then
git clone -b {{ git['branch'] }} {{ git['repository'] }}
else
pushd ./fuel-library
git pull
popd
fi
pushd ./fuel-library/deployment
./update_modules.sh
popd
mkdir -p {{puppet_modules}}
cp -r ./fuel-library/deployment/puppet/* {{puppet_modules}}
popd

View File

@ -0,0 +1,18 @@
id: fuel_library
handler: shell
version: 1.0.0
input:
ip:
schema: str!
value:
git:
schema: {repository: str!, branch: str!}
value: {repository: 'https://github.com/stackforge/fuel-library',
branch: 'stable/7.0'}
temp_directory:
schema: str!
value: /tmp/solar
puppet_modules:
schema: str!
value: /etc/fuel/modules
tags: []