-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
P:wmcs::prometheus: fix openstack-exporter
The openstack exporter logic was relying on the fact that the openstack. endpoint was hosted on a cloudcontrol host. We still want to scrape it from a single cloudcontrol, so add a hiera variable to control which one is used. Bug: T346439 Change-Id: I6cd147e024ddb273eee18a64f2bf2cea9a51ebe0
- Loading branch information
1 parent
bba817e
commit 268e18c
Showing
3 changed files
with
14 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
profile::wmcs::prometheus::openstack_exporter_host: cloudcontrol1006.wikimedia.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
class profile::openstack::eqiad1::metrics ( | ||
Stdlib::Fqdn $controller = lookup('profile::openstack::eqiad1::keystone_api_fqdn'), | ||
Stdlib::Fqdn $active_host = lookup('profile::wmcs::prometheus::openstack_exporter_host'), | ||
) { | ||
$this_ip = ipresolve($::fqdn, 4) | ||
$controller_ip = ipresolve($controller, 4) | ||
|
||
if $this_ip == $controller_ip { | ||
class { '::profile::prometheus::openstack_exporter': | ||
listen_port => 12345, | ||
cloud => 'eqiad1', | ||
} | ||
contain '::profile::prometheus::openstack_exporter' | ||
} else { | ||
class { '::profile::prometheus::openstack_exporter': | ||
ensure => absent, | ||
} | ||
class { '::profile::prometheus::openstack_exporter': | ||
ensure => ($active_host == $::facts['networking']['fqdn']).bool2str('present', 'absent'), | ||
listen_port => 12345, | ||
cloud => 'eqiad1', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters