diff --git a/devstack/solum.conf.sample b/devstack/solum.conf.sample index 3d3efb109..c7a616322 100644 --- a/devstack/solum.conf.sample +++ b/devstack/solum.conf.sample @@ -462,6 +462,9 @@ # Image id (string value) #image = coreos +#keypairs name (string value) +#key_name = mykey + # Deployer logs location (string value) #deployer_log_dir = /var/log/solum/deployer diff --git a/etc/solum/templates/coreos.yaml b/etc/solum/templates/coreos.yaml index 9cb17bfae..94a5aba4c 100644 --- a/etc/solum/templates/coreos.yaml +++ b/etc/solum/templates/coreos.yaml @@ -16,6 +16,10 @@ parameters: type: string image: type: string + key_name: + type: string + description: Name of keypair to assign to servers + default: 'mykey' location: type: string du: @@ -27,6 +31,7 @@ resources: properties: config_drive: "true" flavor: {get_param: flavor} + key_name: { get_param: key_name } image: {get_param: image} name: {get_param: name} user_data: @@ -50,4 +55,4 @@ resources: timeout: 600 wait_handle: - type: OS::Heat::SwiftSignalHandle \ No newline at end of file + type: OS::Heat::SwiftSignalHandle diff --git a/solum/deployer/handlers/heat.py b/solum/deployer/handlers/heat.py index 74251a584..4048163dd 100644 --- a/solum/deployer/handlers/heat.py +++ b/solum/deployer/handlers/heat.py @@ -74,6 +74,9 @@ SERVICE_OPTS = [ cfg.StrOpt('image', default="coreos", help='Image id'), + cfg.StrOpt('key_name', + default="mykey", + help='keypair name'), cfg.StrOpt('deployer_log_dir', default="/var/log/solum/deployer", help='Deployer logs location'), @@ -640,6 +643,7 @@ class Handler(object): elif image_format == 'vm': parameters = {'name': str(assem.uuid), 'flavor': cfg.CONF.deployer.flavor, + 'key_name': cfg.CONF.deployer.key_name, 'image': cfg.CONF.deployer.image} ports_str = '' for port in ports: diff --git a/solum/tests/deployer/handlers/test_heat.py b/solum/tests/deployer/handlers/test_heat.py index 637d098d2..5b1a0f641 100644 --- a/solum/tests/deployer/handlers/test_heat.py +++ b/solum/tests/deployer/handlers/test_heat.py @@ -130,6 +130,7 @@ class HandlerTest(base.BaseTestCase): parameters = {'name': fake_assembly.uuid, 'flavor': "flavor", 'image': "coreos", + 'key_name': "mykey", 'location': img, 'du': 'tenant-name-ts-commit', 'publish_ports': '-p 80:80'}