Skip to content

Add/keypair#8

Open
victorsndvg wants to merge 9 commits intomasterfrom
add/keypair
Open

Add/keypair#8
victorsndvg wants to merge 9 commits intomasterfrom
add/keypair

Conversation

@victorsndvg
Copy link
Member

Isolate keypair from image

This was referenced Nov 22, 2018
Copy link
Contributor

@emepetres emepetres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!! I put some minor comments before merging.

I'm working with the hybrid opm flow blueprint. It would be nice if we could run it with EOSC-Hub!

name: Credentials
config:
id: 'user@laptop'
public_key: 'ssh-rsa ...' # Optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of optional, I understand that both keys doesn't have to be provided if use_existing_resource: False, and are mandatory if use_existing_resource: True.

Is that right? If so, please modify the docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use_existing_resource is inherited from the template you provided at the begining. I was reading about it and I think is an OpenStack-plugin (and othe plugins) feature, but nothing I had implemented. I think it is not working and we can remove this property all along the plugin.

The plugin generates the keypair if public_key or private_key is not defined. As I explained before, use_existing_resource is not taked into account.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then remove use_existing_resource, because it seems that it is implemented.

Also, the generation of the keys if they are not defined should be reflected somehow in the README.

simulate property is implemented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, simulate is implemented. If it's True it does nothing during the operation

password = get_child(dictionary=config, key='password', required=True)
public_key = get_child(dictionary=config, key='public_key', required=True)
private_key = get_child(dictionary=config, key='private_key', required=True)
username = get_child(dictionary=config, key='username') or 'user'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said, this should always be defined in the dictionary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think to provide a default user could help to simplify the plugin user experience by means of the blueprints

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very unlikely that, if you left the username empty, the user in the image will be 'user'. So leaving it blank would lead to an error.

The idea is that, when you define an image, you need to know the default user that the image defines.

Therefore it should be mandatory (and reflect that on the README), unless you say that the plugin is creating the user when deploying the virtual machine. If it is the second case, that behaviour should be explained in the README as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the second assumption is the right case. The user is created during contextualization

@victorsndvg
Copy link
Member Author

I took into account your commit to update the status of add/keypair branch. Everything is ready to merge, but to do the final merge is in your hand. Let me know any other comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants