/* A configuration file provided by Jean-François Larvoire
   in his presentation of the SML alternative format for
   presenting XML, to argue why a more human readable presentation
   of XML is needed for configuration files.

   https://www.youtube.com/watch?v=Roll8STCkWE */
cib(admin_epoch = 0
    epoch       = 0
    num_updates = 0)
{
    configuration {
        crm_config {
            cluster_property_set(id = cib-bootstrap-options)
            {
                attributes {
                    nvpair(id    = cib-bootstrap-options-symmetric-cluster
                           name  = symmetric-cluster
                           value = true)
                    nvpair(id    = cib-bootstrap-options-no-quorum-policy
                           name  = no-quorum-policy
                           value = stop)
                    nvpair(id    = cib-bootstrap-options-default-resource-stickiness
                           name  = default-resource-stickiness
                           value = 0)
                    nvpair(id    = cib-bootstrap-options-default-resource-failure-stickiness
                           name  = default-resource-failure-stickiness
                           value = 0)
                    nvpair(id    = cib-bootstrap-options-stonith-enabled
                           name  = stonith-enabled
                           value = true)
                    nvpair(id    = cib-bootstrap-options-stonith-action
                           name  = stonith-action
                           value = reboot)
                    nvpair(id    = cib-bootstrap-options-startup-fencing
                           name  = startup-fencing
                           value = true)
                    nvpair(id    = cib-bootstrap-options-stop-orphan-resources
                           name  = stop-orphan-resources
                           value = true)
                    nvpair(id    = cib-bootstrap-options-stop-orphan-actions
                           name  = stop-orphan-actions
                           value = true)
                    nvpair(id    = cib-bootstrap-options-remove-after-stop
                           name  = remove-after-stop
                           value = false)
                    nvpair(id    = cib-bootstrap-options-short-resource-names
                           name  = short-resource-names
                           value = true)
                    nvpair(id    = cib-bootstrap-options-transition-idle-timeout
                           name  = transition-idle-timeout
                           value = 5min)
                    nvpair(id    = cib-bootstrap-options-default-action-timeout
                           name  = default-action-timeout
                           value = 600s)
                    nvpair(id    = cib-bootstrap-options-is-managed-default
                           name  = is-managed-default
                           value = true)
                    nvpair(id    = cib-bootstrap-options-cluster-delay
                           name  = cluster-delay
                           value = 60s)
                    nvpair(id    = cib-bootstrap-options-pe-error-series-max
                           name  = pe-error-series-max
                           value = -1)
                    nvpair(id    = cib-bootstrap-options-pe-warn-series-max
                           name  = pe-warn-series-max
                           value = -1)
                    nvpair(id    = cib-bootstrap-options-pe-input-series-max
                           name  = pe-input-series-max
                           value = -1)
                }
            }
        }
        nodes
        resources {
            primitive(class    = ocf
                      id       = ost1
                      provider = heartbeat
                      type     = Filesystem)
            {
                operations {
                    op(id       = ost1_mon
                       interval = 120s
                       name     = monitor
                       timeout  = 60s)
                }
                instance_attributes(id = ost1_inst_attr)
                {
                    attributes {
                        nvpair(id    = ost1_attr_0
                               name  = device
                               value = /etc/sfs/luns/lun8)
                        nvpair(id    = ost1_attr_1
                               name  = directory
                               value = /mnt/ost1)
                        nvpair(id    = ost1_attr_2
                               name  = fstype
                               value = lustre)
                    }
                }
            }
            primitive(class    = ocf
                      id       = ost2
                      provider = heartbeat
                      type     = Filesystem)
            {
                operations {
                    op(id       = ost2_mon
                       interval = 120s
                       name     = monitor
                       timeout  = 60s)
                }
                instance_attributes(id = ost2_inst_attr)
                {
                    attributes {
                        nvpair(id    = ost2_attr_0
                               name  = device
                               value = /etc/sfs/luns/lun10)
                        nvpair(id    = ost2_attr_1
                               name  = directory
                               value = /mnt/ost2)
                        nvpair(id    = ost2_attr_2
                               name  = fstype
                               value = lustre)
                    }
                }
            }
            clone(id = stonith_quincy3)
            {
                instance_attributes(id = stonith_quincy3_inst_attr)
                {
                    attributes {
                        nvpair(id    = stonith_quincy3_attr_1
                               name  = clone_max
                               value = 2)
                        nvpair(id    = stonith_quincy3_attr_2
                               name  = clone_node_max
                               value = 1)
                    }
                }
                primitive(class    = stonith
                          id       = stonith_hb_quincy3
                          provider = heartbeat
                          type     = external/riloe)
                {
                    operations {
                        op(id       = stonith_hb_quincy3_mon
                           interval = 30s
                           name     = monitor
                           prereq   = nothing
                           timeout  = 20s)
                        op(id      = stonith_hb_quincy3_start
                           name    = start
                           prereq  = nothing
                           timeout = 20s)
                    }
                    instance_attributes(id = stonith_hb_quincy3_inst_attr)
                    {
                        attributes {
                            nvpair(id    = stonith_hb_quincy3_attr_2
                                   name  = hostlist
                                   value = quincy3)
                            nvpair(id    = stonith_hb_quincy3_attr_3
                                   name  = ilo_hostname
                                   value = 192.168.16.153)
                            nvpair(id    = stonith_hb_quincy3_attr_4
                                   name  = ilo_user
                                   value = jimi)
                            nvpair(id    = stonith_hb_quincy3_attr_5
                                   name  = ilo_password
                                   value = 'secret:-)')
                            nvpair(id    = stonith_hb_quincy3_attr_6
                                   name  = ilo_can_reset
                                   value = 1)
                            nvpair(id    = stonith_hb_quincy3_attr_7
                                   name  = ilo_protocol
                                   value = 2.0)
                            nvpair(id    = stonith_hb_quincy3_attr_8
                                   name  = ilo_powerdown_method
                                   value = off)
                        }
                    }
                }
            }
            clone(id = stonith_quincy4)
            {
                instance_attributes(id = stonith_quincy4_inst_attr)
                {
                    attributes {
                        nvpair(id    = stonith_quincy4_attr_1
                               name  = clone_max
                               value = 2)
                        nvpair(id    = stonith_quincy4_attr_2
                               name  = clone_node_max
                               value = 1)
                    }
                }
                primitive(class    = stonith
                          id       = stonith_hb_quincy4
                          provider = heartbeat
                          type     = external/riloe)
                {
                    operations {
                        op(id       = stonith_hb_quincy4_mon
                           interval = 30s
                           name     = monitor
                           prereq   = nothing
                           timeout  = 20s)
                        op(id      = stonith_hb_quincy4_start
                           name    = start
                           prereq  = nothing
                           timeout = 20s)
                    }
                    instance_attributes(id = stonith_hb_quincy4_inst_attr)
                    {
                        attributes {
                            nvpair(id    = stonith_hb_quincy4_attr_2
                                   name  = hostlist
                                   value = quincy4)
                            nvpair(id    = stonith_hb_quincy4_attr_3
                                   name  = ilo_hostname
                                   value = 192.168.16.154)
                            nvpair(id    = stonith_hb_quincy4_attr_4
                                   name  = ilo_user
                                   value = jimi)
                            nvpair(id    = stonith_hb_quincy4_attr_5
                                   name  = ilo_password
                                   value = 'secret:-)')
                            nvpair(id    = stonith_hb_quincy4_attr_6
                                   name  = ilo_can_reset
                                   value = 1)
                            nvpair(id    = stonith_hb_quincy4_attr_7
                                   name  = ilo_protocol
                                   value = 2.0)
                            nvpair(id    = stonith_hb_quincy4_attr_8
                                   name  = ilo_powerdown_method
                                   value = off)
                        }
                    }
                }
            }
        }
        constraints {
            rsc_location(id  = rsc_location_ost1
                         rsc = ost1)
            {
                rule(id    = prefered_location_ost1
                     score = 100)
                {
                    expression(attribute = #uname
                               id        = prefered_location_ost1_expr
                               operation = eq
                               value     = quincy3)
                }
            }
            rsc_location(id  = rsc_location_ost2
                         rsc = ost2)
            {
                rule(id    = prefered_location_ost2
                     score = 100)
                {
                    expression(attribute = #uname
                               id        = prefered_location_ost2_expr
                               operation = eq
                               value     = quincy4)
                }
            }
        }
    }
    status
}