Skip to content

Commit

Permalink
Remove sensu::backend username and password parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Nov 3, 2018
1 parent 300d490 commit efe8073
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ vagrant provision sensu-backend-peer1 sensu-backend-peer2

### Basic Sensu backend

The following example will configure sensu-backend and add a check. It's advisable to not rely on the default password.
The following example will configure sensu-backend and add a check.

```puppet
class { 'sensu::backend':
password => 'P@ssw0rd!',
}
include sensu::backend
sensu_check { 'check-cpu':
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
Expand Down Expand Up @@ -222,6 +220,15 @@ This module does not support adding `sensuctl` resources on a host other than th

The type `sensu_asset` does not at this time support `ensure => absent` due to a limitation with sensuctl, see [sensu-go#988](https://github.com/sensu/sensu-go/issues/988).

The sensuctl username and password can not be configured by this module due to limitations with sensuctl. The checklist at [sensu-puppet#901](https://github.com/sensu/sensu-puppet/issues/901) will be updated as progress is made.

To change the `admin` password used by sensuctl the following steps can be taken:
```
sensuctl user change-password admin --current-password 'P@ssw0rd!' --new-password 'changeme'
sensuctl configure -n --username admin --password 'changeme'
```


### Notes regarding support

This module is built for use with Puppet versions 5 and 6 and the ruby
Expand Down
8 changes: 1 addition & 7 deletions manifests/backend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
# Sensu backend host used to configure sensuctl and verify API access.
# @param url_port
# Sensu backend port used to configure sensuctl and verify API access.
# @param username
# Sensu backend admin username used to confiure sensuctl.
# @param password
# Sensu backend admin password used to confiure sensuctl.
#
class sensu::backend (
Optional[String] $version = undef,
Expand All @@ -41,8 +37,6 @@
Hash $config_hash = {},
String $url_host = '127.0.0.1',
Stdlib::Port $url_port = 8080,
String $username = 'admin',
String $password = 'P@ssw0rd!',
) {

include ::sensu
Expand Down Expand Up @@ -71,7 +65,7 @@
# Ensure sensu-backend is up before starting sensu-agent
Sensu_api_validator['sensu'] -> Service['sensu-agent']

$sensuctl_configure = "sensuctl configure -n --url '${url}' --username '${username}' --password '${password}'"
$sensuctl_configure = "sensuctl configure -n --url '${url}' --username 'admin' --password 'P@ssw0rd!'"
$sensuctl_configure_creates = '/root/.config/sensu/sensuctl/cluster'
exec { 'sensuctl_configure':
command => "${sensuctl_configure} || rm -f ${sensuctl_configure_creates}",
Expand Down

0 comments on commit efe8073

Please sign in to comment.