Implement library resource
This commit is contained in:
parent
8dfc414bc3
commit
61566b6a66
@ -20,15 +20,15 @@ NETWORK_SCHEMA = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NETWORK_METADATA = yaml.load("""
|
NETWORK_METADATA = yaml.load("""
|
||||||
node-1:
|
solar-dev1:
|
||||||
uid: '1'
|
uid: '1'
|
||||||
fqdn: node-1
|
fqdn: solar-dev1
|
||||||
network_roles:
|
network_roles:
|
||||||
ceph/public: 10.0.0.3
|
ceph/public: 10.0.0.3
|
||||||
ceph/replication: 10.0.0.3
|
ceph/replication: 10.0.0.3
|
||||||
node_roles:
|
node_roles:
|
||||||
- ceph-mon
|
- ceph-mon
|
||||||
name: node-1
|
name: solar-dev1
|
||||||
|
|
||||||
""")
|
""")
|
||||||
|
|
||||||
@ -38,17 +38,20 @@ def deploy():
|
|||||||
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 1})
|
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 1})
|
||||||
first_node = next(x for x in resources if x.name.startswith('node'))
|
first_node = next(x for x in resources if x.name.startswith('node'))
|
||||||
|
|
||||||
ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
|
library = vr.create('library1', 'resources/fuel_library', {})[0]
|
||||||
{'storage': STORAGE,
|
first_node.connect(library)
|
||||||
'keystone': KEYSTONE,
|
|
||||||
'network_scheme': NETWORK_SCHEMA,
|
# TODO(use library resource)
|
||||||
'ceph_monitor_nodes': NETWORK_METADATA,
|
# ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
|
||||||
'ceph_primary_monitor_node': NETWORK_METADATA,
|
# {'storage': STORAGE,
|
||||||
'role': 'controller',
|
# 'keystone': KEYSTONE,
|
||||||
})[0]
|
# 'network_scheme': NETWORK_SCHEMA,
|
||||||
first_node.connect(ceph_mon)
|
# 'ceph_monitor_nodes': NETWORK_METADATA,
|
||||||
first_node.connect(ceph_mon, {'ip': 'public_vip'})
|
# 'ceph_primary_monitor_node': NETWORK_METADATA,
|
||||||
first_node.connect(ceph_mon, {'ip': 'management_vip'})
|
# 'role': 'controller',
|
||||||
|
# })[0]
|
||||||
|
# first_node.connect(ceph_mon,
|
||||||
|
# {'ip': ['ip', 'public_vip', 'management_vip']})
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
id: ceph_mon
|
id: ceph_mon
|
||||||
handler: puppet
|
handler: puppet
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
||||||
|
|
||||||
input:
|
input:
|
||||||
library:
|
library:
|
||||||
schema: {repository: str!, branch: str!, puppet_modules: str}
|
schema: {repository: str!, branch: str!, puppet_modules: str}
|
||||||
@ -39,5 +37,4 @@ input:
|
|||||||
role:
|
role:
|
||||||
schema: str!
|
schema: str!
|
||||||
value:
|
value:
|
||||||
|
|
||||||
tags: []
|
tags: []
|
||||||
|
20
resources/fuel_library/actions/run.sh
Normal file
20
resources/fuel_library/actions/run.sh
Normal 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
|
18
resources/fuel_library/meta.yaml
Normal file
18
resources/fuel_library/meta.yaml
Normal 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: []
|
Loading…
Reference in New Issue
Block a user