Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Resource definitions in YAML

#173

Resource (Nodes) should be defined in YAML for better readability and manipulation through mainstream sysadmin tools.

Hypothetical node definitions

#

Multi line format


strongbad:

type: Node
description: "Rundeck server node" 
hostname: "strongbad" 
osArch: "x86_64" 
osFamily: "unix" 
osName: "Mac OS X" 
osVersion: "10.6.5" 
username: "alexh" 
editUrl: "" 
remoteUrl: "" 
tags: "rundeck"

-or -

#

single line format

ubuntu: {description: "Ubuntu server node", hostname: "192.168.1.101", osFamily: "unix", osName: "Linux", username: "demo", tags: "dev"}

Reported by Alex-SF · January 14th, 2011 @ 12:04 PM

State: resolved
Milestone: Rundeck 1.2
Assigned to: Greg Schueler Greg Schueler

Activity

  1. Greg Schueler
    Greg Schueler
    • Assigned user set to Greg Schueler

    question: should the node name only be specified via the top level map's key? if so, should a "nodename" value in the node data be ignored?

    January 20th, 2011 @ 11:40 AM

  2. Deleted User
    Deleted User

    I think it should. I don't know if we have plans for a lint checker, but that would be a good rule to add to resource lint.

    January 20th, 2011 @ 11:51 AM

  3. Greg Schueler
    Greg Schueler

    an alternate format would be like this: https://gist.github.com/27b46f8fd8cd67750d8e

    so the nodename is a data element in the map, and nodes are just maps in a sequence

    January 20th, 2011 @ 12:03 PM

  4. Deleted User
    Deleted User

    What would it look like in block mode?

    January 20th, 2011 @ 12:11 PM

  5. Greg Schueler
    Greg Schueler

    sequence based in flow mode would be like this:

    [{nodename: x, hostname, y}, {nodename: z, hostname, w} .. ]

    as opposed to map based:

    { x: {hostname:y}, z: {hostname:w}}

    it is more compact in that mode.

    January 20th, 2011 @ 01:17 PM

  6. Deleted User
    Deleted User

    Ah...how about this, lets say I have a list of IP address. 10.168.0.1, 10.168.0.2, 10.168.0.3.

    What if instead of making the nodename the map name, we made it the hostname.

    Then converting a list would be as easy as:

    - 10.168.0.1
    - 10.168.0.2
    - 10.168.0.3
    

    (Easily append the '- ' with sed -i -e '/^/- /' filelist.txt)

    And adding metadata would be:

    - 10.168.0.1: {nodename: foobar}
    - 10.168.0.2: {nodename: barbaz}
    - 10.168.0.3: {nodename: bazfoo}
    

    Just a thought.

    January 20th, 2011 @ 01:30 PM

  7. Greg Schueler
    Greg Schueler

    hmm I see the utility. Even ideally you could just do

    - 10.168.0.1
    - 10.168.0.2
    

    and have it be valid. i suppose using hostname as default for the node name
    (and vice-versa?) is useful.

    but it makes the data structure awkward: a sequence of maps of maps. in
    block mode it seems more awkward:

    -
      10.168.0.1:
          nodename: blah
          username: x
    

    sequence of name based maps is a little better, but not as easy to get from
    just hostnames:

    name1: { hostname: 10.168.0.1 }
    name2: { hostname: 10.168.0.2 }
    

    I will push what I have (original requested format) to dev and we can play
    with it

    January 20th, 2011 @ 02:07 PM

  8. Deleted User
  9. Greg Schueler
    Greg Schueler

    pushed initial version. this supports the nodename keyed map, as well as a sequence of maps (for comparison).

    to use, modify project.properties and change the project.resources.file to use a ".yaml" extension

    e.g.

    project.resources.file = /Users/greg/rundeck11/projects/test/etc/resources.yaml
    

    January 20th, 2011 @ 05:05 PM

  10. Greg Schueler
    Greg Schueler
    • State changed from new to open

    January 21st, 2011 @ 03:03 PM

  11. Deleted User
  12. Greg Schueler
    Greg Schueler
    • State changed from open to resolved
    • Milestone order changed from 15 to 0

    February 25th, 2011 @ 11:15 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.