Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add salt cloud support for block device tagging or root devices and such #48716

Merged
merged 11 commits into from Jul 25, 2018

Conversation

Projects
None yet
3 participants
@thetoolsmith
Copy link
Contributor

commented Jul 23, 2018

This pull request adds the ability to set block device tags in salt cloud configuration for root volumes and such.

Currently, it seems that this is not supported in salt-cloud.
ref: #47097

This change allows for configuration of block_device_mappings in cloud configuration to support a tag dictionary like so:

  block_device_mappings:
    - DeviceName: /dev/sda1
       Ebs.VolumeSize: 10
       Ebs.VolumeType: gp2
       tag:    
         tag1: value
         tag2: value
    - DeviceName: /dev/sdb
       Ebs.VolumeSize: 35
       Ebs.VolumeType: gp2
       tag:    
         tag3: value
         tag4: value

Tests written?

No

Commits signed with GPG?

No

Additional notes:
I also have another implementation that does not use the existing block_device_mappings configuration. Instead it would add a new cloud configuration block_device_tags. However, this change separates the mappings from the tags and might not be ideal.
I'm thinking this pr is the best approach, but will look for feedback from the core Salt team.

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@salt-jenkins salt-jenkins requested a review from saltstack/team-cloud Jul 23, 2018

Paul Bruno
@thetoolsmith

This comment has been minimized.

Copy link
Contributor Author

commented Jul 23, 2018

build kicked off before I committed the corrected code.

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2018

Paul Bruno
@thetoolsmith

This comment has been minimized.

Copy link
Contributor Author

commented Jul 23, 2018

yeah, sorry about that. I pasted the code into the salt branch from my test system and missed the closing bracket. should have re-checked the code.
fix is committed.

Paul Bruno and others added some commits Jul 23, 2018

Paul Bruno
Paul Bruno
Paul Bruno
Paul Bruno
@rallytime
Copy link
Contributor

left a comment

In addition to the inline requests, can you also document this new behavior?

Thanks @thetoolsmith!

block_device_volume_id_map = {}

if ex_blockdevicetags:
for k, v in six.iteritems(ret['blockDeviceMapping']):

This comment has been minimized.

Copy link
@rallytime

rallytime Jul 24, 2018

Contributor

Can you switch these variables (and others below) to use 3 or more letters? That would be nice and match our Style Guide rules.

This comment has been minimized.

Copy link
@thetoolsmith

thetoolsmith Jul 24, 2018

Author Contributor

sure thing

transport=__opts__['transport']
)

salt.utils.cloud.wait_for_fun(

This comment has been minimized.

Copy link
@rallytime

rallytime Jul 24, 2018

Contributor

This can be the __utils__['cloud.x'] notation like you have above.

@thetoolsmith

This comment has been minimized.

Copy link
Contributor Author

commented Jul 24, 2018

changes have been comitted

@rallytime rallytime requested a review from gtmanfred Jul 25, 2018

@rallytime rallytime merged commit 816f7ed into saltstack:develop Jul 25, 2018

7 of 9 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has failed
Details
WIP ready for review
Details
codeclimate All good!
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.