diff --git a/examples/library_ceph/ceph.py b/examples/library_ceph/ceph.py index a59de74..0e0f736 100644 --- a/examples/library_ceph/ceph.py +++ b/examples/library_ceph/ceph.py @@ -35,8 +35,9 @@ NETWORK_METADATA = yaml.load(""" def deploy(): db.clear() - resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 1}) - first_node = next(x for x in resources if x.name.startswith('node')) + resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 2}) + first_node, second_node = [x for x in resources if x.name.startswith('node')] + first_transp = next(x for x in resources if x.name.startswith('transport')) library = vr.create('library1', 'resources/fuel_library', {})[0] first_node.connect(library) @@ -44,6 +45,13 @@ def deploy(): keys = vr.create('ceph_key', 'resources/ceph_keys', {})[0] first_node.connect(keys) + remote_file = vr.create('ceph_key2', 'resources/remote_file', + {'dest': '/var/lib/astute/'})[0] + second_node.connect(remote_file) + keys.connect(remote_file, {'ip': 'remote_ip', 'path': 'remote_path'}) + first_transp.connect(remote_file, {'transports': 'remote'}) + + ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon', {'storage': STORAGE, 'keystone': KEYSTONE, diff --git a/resources/ceph_keys/meta.yaml b/resources/ceph_keys/meta.yaml index 4a61d4f..43a2d25 100644 --- a/resources/ceph_keys/meta.yaml +++ b/resources/ceph_keys/meta.yaml @@ -11,4 +11,7 @@ input: key_name: schema: str! value: ceph + path: + schema: str! + value: /var/lib/astute/ceph/ tags: [] diff --git a/resources/remote_file/actions/run.sh b/resources/remote_file/actions/run.sh new file mode 100644 index 0000000..212bdfb --- /dev/null +++ b/resources/remote_file/actions/run.sh @@ -0,0 +1,10 @@ +mkdir -p {{dest}} + +{% for transport in remote %} + {% if transport.name == 'ssh' %} +scp -i {{transport.key}} -r {{transport.user}}@{{remote_ip}}:/{{remote_path}} {{dest}} +exit 0 + {% endif %} +{% endfor %} +echo 'No suitable transport.' +exit 2 diff --git a/resources/remote_file/meta.yaml b/resources/remote_file/meta.yaml new file mode 100644 index 0000000..6e319bd --- /dev/null +++ b/resources/remote_file/meta.yaml @@ -0,0 +1,20 @@ +id: remote_file +handler: shell +version: 1.0.0 +input: + ip: + schema: str! + value: + remote: + schema: {} + value: + remote_ip: + schema: str! + value: + remote_path: + schema: str! + value: + dest: + schema: str! + value: +tags: []