人偶资源排序不起作用

Puppet Resource Ordering not working

我有一个大型清单,它设置了一个 OpenStack 控制器节点,该节点还具有位于同一主机上的 HAProxy、Galera 和 RabbitMQ。我 运行 遇到了问题,因为 HAProxy 服务似乎总是最后才启动。这会产生一个问题,因为我想通过 HAProxies VIP 连接到 Galera DB 集群。因此各种 OpenStack 服务的所有尝试都无法建立它们的关系数据库表。如果 HAProxy 服务先启动,这将不是问题。我已经尝试了各种方法来让我的人偶清单强制应用我的 HAProxy 配置文件。这是我尝试过的几件事:

    #Service <|name=='haproxy' or name=='keepalived'|> -> Exec <| |>
    #Exec<| title == 'nova-db-sync' |> ~> Service<| title == $nova_title |>
    #Service<| title == 'haproxy' |> ~> Exec<| title == 'nova-db-sync' |>
    #Service<| title == 'haproxy' |> ~> Exec<| title == 'Exec[apic-ml2-db-manage --config-file /etc/neutron/neutron.conf upgrade head]' |>

     Service['haproxy'] -> Exec['keystone-manage db_sync']
    #Class ['wraphaproxy'] -> Class ['wrapgalera'] -> Class['wraprabbitmq'] -> Class['keystone']
# -> Class['wraprabbitmq'] -> Class['keystone']
#
#   setup HAproxy
notify { "This host ${ipaddress} is in ${haproxy_ipaddress}":}
    if ( $ipaddress in $haproxy_ipaddress ) {
notify { "This host is an haproxy host ${ipaddress} is in ${haproxy_ipaddress}":}
       require wraphaproxy
#       class { 'wraphaproxy':
#           before => [
#              Class['wrapgalera'],
#              Class['wraprabbitmq'],
#              Class['keystone'],
#              Class['glance'],
#              Class['cinder'],
#              Class['neutron'],
#              Class['nova'],
#              Class['ceilometer'],
#              Class['horizon'],
#              Class['heat'],
#           ]
#       }
    }

classwraphaproxy是配置和启动HAProxy服务的class。似乎无论我做什么,OpenStack Puppet 模块都会尝试在 HAProxy 服务准备好之前执行它们的 "db sync's"。

好的。事实证明我需要使用 HAProxy::Service['haproxy'] 而不是 Service['haproxy']。所以我的代码中有这个:

 Haproxy::Service['haproxy'] -> Exec['keystone-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['glance-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['nova-db-sync']
 Haproxy::Service['haproxy'] -> Exec['glance-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['neutron-db-sync']
 Haproxy::Service['haproxy'] -> Exec['heat-dbsync']
 Haproxy::Service['haproxy'] -> Exec['ceilometer-dbsync']
 Haproxy::Service['haproxy'] -> Exec['cinder-manage db_sync']

如果有人知道使用锚点或资源收集器的更好方法,请回复。