used with puppetmaster

Bug #1803957 reported by Klavs Klavsen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-ceph
New
Undecided
Unassigned

Bug Description

You could consider improving the module (and guides) to work with a puppet master..

f.ex. using something like this - to make sure puppet does not do anything, until it has 3 registered mon servers:
    $pdbquery_res = ["from", "resources",
      ["and",
        ["=", "type", "Class"],
        ["=", "title", "Role::Storage::Ceph"]]]
    $pdbquery_facts = ["from", "facts",
      ["and",
        ["=", "name", "ipaddress"],
        ["in", "certname",
          ["extract", "certname",
            ["select_resources",
              ["and",
                ["=", "type", "Class"],
                ["=", "title", "Role::Storage::Ceph"]]]]]]]
    $cephmon_res = puppetdb_query($pdbquery_res)
    $cephmon_facts = puppetdb_query($pdbquery_facts)
    $cephmon = delete_undef_values($cephmon_facts.map |$nfacts| {
      $node_res = delete_undef_values($cephmon_res.map |$res| {
        if ( $res['parameters']['cluster_name'] == $cluster_name and $res['parameters']['role'] =~ /(colocated|mon)/ and $res['certname'] == $nfacts['certname'] ) {
          $res['certname']
        }
      })
      if ( size($node_res) > 0 ) {
        { certname => regsubst($nfacts['certname'],'\.[^.]+\.[^.]+$','','E'), ip => $nfacts['value'] }
      }
    })
    if ( size($cephmon) == 3 ) {
     actually try to setup config files..
    }

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.