Puppet Class: tripleo::profile::pacemaker::ovn_northd

Defined in:
manifests/profile/pacemaker/ovn_northd.pp

Overview

Parameters:

  • pacemaker_master (Any) (defaults to: lookup('ovn_dbs_short_bootstrap_node_name'))
  • step (Any) (defaults to: Integer(lookup('step')))
  • pcs_tries (Any) (defaults to: lookup('pcs_tries', undef, undef, 20))
  • ovn_dbs_vip (Any) (defaults to: lookup('ovn_dbs_vip'))
  • nb_db_port (Any) (defaults to: 6641)
  • sb_db_port (Any) (defaults to: 6642)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'manifests/profile/pacemaker/ovn_northd.pp', line 48

class tripleo::profile::pacemaker::ovn_northd (
  $pacemaker_master = lookup('ovn_dbs_short_bootstrap_node_name'),
  $step             = Integer(lookup('step')),
  $pcs_tries        = lookup('pcs_tries', undef, undef, 20),
  $ovn_dbs_vip      = lookup('ovn_dbs_vip'),
  $nb_db_port       = 6641,
  $sb_db_port       = 6642
) {

  if $step >= 2 {
      pacemaker::property { 'ovndb-role-node-property':
      property => 'ovndb-role',
      value    => true,
      tries    => $pcs_tries,
      node     => $::hostname,
    }
  }

  if $step >= 3 and downcase($::hostname) == $pacemaker_master {
    $ovndb_servers_resource_name = 'ovndb_servers'
    $ovndb_servers_ocf_name      = 'ovn:ovndb-servers'
    $ovndb_vip_resource_name     = "ip-${ovn_dbs_vip}"
    $ovn_dbs_vip_norm = normalize_ip_for_uri($ovn_dbs_vip)
    # By step 3, all the VIPs would have been created.
    # After creating ovn ocf resource, colocate it with the
    # VIP - ip-${ovn_dbs_vip}.
    pacemaker::resource::ocf { "${ovndb_servers_resource_name}":
      ocf_agent_name  => "${ovndb_servers_ocf_name}",
      master_params   => '',
      op_params       => 'start timeout=200s stop timeout=200s',
      resource_params => "master_ip=${ovn_dbs_vip_norm} nb_master_port=${nb_db_port} \
sb_master_port=${sb_db_port} manage_northd=yes inactive_probe_interval=180000",
      tries           => $pcs_tries,
      location_rule   => {
        resource_discovery => 'exclusive',
        score              => 0,
        expression         => ['ovndb-role eq true'],
      },
      meta_params     => 'notify=true'
    }

    pacemaker::constraint::colocation { "${ovndb_vip_resource_name}-with-${ovndb_servers_resource_name}":
      source       => "${ovndb_vip_resource_name}",
      target       => "${ovndb_servers_resource_name}-master",
      master_slave => true,
      score        => 'INFINITY',
      tries        => $pcs_tries,
    }

    Pacemaker::Resource::Ocf["${ovndb_servers_resource_name}"]
      -> Pacemaker::Constraint::Colocation["${ovndb_vip_resource_name}-with-${ovndb_servers_resource_name}"]
  }
}