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

Gabe extra provision attributes #154

Merged

Conversation

byxorna
Copy link
Contributor

@byxorna byxorna commented Apr 30, 2014

This PR adds support for collins to add/remove arbitrary attributes on an asset at provision time, on a per-nodeclass basis. I.e. lets say you want to tag all nodes that are development hosts with DEVELOPMENT_MODE=true, you could put this in profiles.yaml to have that attribute automatically set at provision time.


---
profiles:
    devdbnode:
        label: "Dev DB Node"
        prefix: "devdb"
        attributes:
            development_mode: true
    devnode:
        label: "Dev Node"
        prefix: "dev"
        attributes:
            development_mode: true

Similarly, you can clear specific attributes on specific nodeclasses, if you want to ensure there are no undesirable effects at provision time. (i.e. DEVELOPMENT_MODE attribute creates undesirable behavior on your production DB nodes):


---
profiles:
    proddbnode:
        label: "Prod DB Node"
        prefix: "db"
        clear_attributes:
          - development_mode
          - some_attribute_that_most_nodes_want_but_not_proddbs

The was this is written such that attributes specified in clear_attributes wont clobber any more important attrs set by collins (i.e. nodeclass). The ordering of what trumps what is, in order of trumpiness:

  1. attrs set explicitly by collins during provision (nodeclass, build_contact, pool, etc) from the profile
  2. attributes set in the attributes map in profile
  3. attributes to clear on a nodeclass from clear_attributes in profile
  4. attributes collins will clear on all assets (Feature.deleteSomeMetaOnRepurpose)

Let me know what you guys think!

@byxorna
Copy link
Contributor Author

byxorna commented Apr 30, 2014

@maddalab @dallasmarlow @Primer42

@william-richard
Copy link
Contributor

🚋 🚆 🚅 🚄

william-richard pushed a commit that referenced this pull request May 2, 2014
@william-richard william-richard merged commit 0ae4606 into tumblr:master May 2, 2014
dalehamel pushed a commit to Shopify/collins that referenced this pull request Jun 10, 2014
dalehamel pushed a commit to Shopify/collins that referenced this pull request Jun 10, 2014
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