StyleBook configuration

Components reference

In the components construct, you refer to a top-level component in the StyleBook by using the $components.<componentname> notation. If there are nested components within a top-level component, then the notation used is $components.<componentname>.components.<component-name> to refer to them, and so on.

Example:

components:

 -

     name: my-lbvserver-comp

     type: ns::lbvserver

     properties:

        name: $parameters.name + "-lb"

        servicetype: HTTP

        ipv46: $parameters.ip

        port: 80

        lbmethod: $parameters.lb-alg

  -

     name: my-svcg-comp

     type: ns::servicegroup

     properties:

        name: $parameters.name + "-svcgrp"

        servicetype: HTTP

 -

     name: members-svcg-comp

     type: ns::servicegroup_servicegroupmember_binding

     repeat: $parameters.svc-servers

     repeat-item: srv

     properties:

        ip: $srv

        port: str($parameters.svc-port)

        servicegroupname: $components.my-svcg-comp.properties.name

 -

     name: lbvserver-svg-binding-comp

     type: ns::lbvserver_servicegroup_binding

     properties:

         name: $components.my-lbvserver-comp.properties.name

         servicegroupname: $components.my-svcg-comp.properties.name
<!--NeedCopy-->

In this example, the components my-svcg-comp and my-lbvserver-comp have to be built before building the last component lbvserver-svg-binding-comp because there are references to these components in this last component. These references are provided by using the components references denoted by $components.<componentname>.

Components reference

In this article