Change remote_file to use transports
This commit is contained in:
parent
2d57c49be3
commit
588bfe83f8
@ -35,20 +35,22 @@ 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'))
|
||||
ssh = next(x for x in resources if x.name.startswith('ssh'))
|
||||
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)
|
||||
|
||||
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]
|
||||
first_node.connect(keys)
|
||||
second_node.connect(remote_file)
|
||||
keys.connect(remote_file, {'ip': 'remote_ip', 'path': 'remote_path'})
|
||||
ssh.connect(remote_file,
|
||||
{'ssh_key': 'remote_key', 'ssh_user': 'remote_user'})
|
||||
first_node.connect(remote_file)
|
||||
first_transp.connect(remote_file, {'transports': 'remote'})
|
||||
|
||||
|
||||
ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
|
||||
{'storage': STORAGE,
|
||||
|
@ -1,3 +1,10 @@
|
||||
mkdir -p {{remote_path}}
|
||||
mkdir -p {{dest}}
|
||||
|
||||
scp -i {{remote_key}} -r {{remote_user}}@{{remote_ip}}:/{{remote_path}} {{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
|
||||
|
@ -5,18 +5,15 @@ input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
remote:
|
||||
schema: {}
|
||||
value:
|
||||
remote_ip:
|
||||
schema: str!
|
||||
value:
|
||||
remote_user:
|
||||
schema: {}
|
||||
value:
|
||||
remote_path:
|
||||
schema: str!
|
||||
value:
|
||||
remote_key:
|
||||
schema: str!
|
||||
value:
|
||||
dest:
|
||||
schema: str!
|
||||
value:
|
||||
|
Loading…
Reference in New Issue
Block a user