Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensu_enterprise_dashboard_api_config purge #883

Closed
cdenneen opened this issue Mar 28, 2018 · 3 comments · Fixed by #885
Closed

sensu_enterprise_dashboard_api_config purge #883

cdenneen opened this issue Mar 28, 2018 · 3 comments · Fixed by #885
Assignees
Labels

Comments

@cdenneen
Copy link
Contributor

v0.50.0

So following the README the following should work but still yields the 2 api1,api2 datacenters that come with install and get purged after a "second" puppet run:

  resources { 'sensu_enterprise_dashboard_api_config':
    purge   => true,
  }

  sensu::enterprise::dashboard::api { '127.0.0.1':
    ensure     => present,
    datacenter => 'My Datacenter',
  }

I even tried to make sure the purge happened after the Package install

  resources { 'sensu_enterprise_dashboard_api_config':
    purge   => true,
    require => Package['sensu'],
  }

  sensu::enterprise::dashboard::api { '127.0.0.1':
    ensure     => present,
    datacenter => 'My Datacenter',
  }

If I do another puppet apply run it works fine... but the first run doesn't delete those...
I'm going to guess it has something to do with the resource purging has to happen after service is started and on first run it's happening before?
If that's the case then resource purge should have to subscribe to Service['sensu']? But even this won't work because the resources to purge aren't available on first run so they remove on second run only... any ideas?

  resources { 'sensu_enterprise_dashboard_api_config':
    purge     => true,
    subscribe => Service['sensu'],
  }

  sensu::enterprise::dashboard::api { '127.0.0.1':
    ensure     => present,
    datacenter => 'My Datacenter',
  }

I know there was some work previously done by @alvagante @glarizza @ghoneycutt so wasn't sure if this was related to that?

@cdenneen
Copy link
Contributor Author

Because of the resource purging not working on first run the only way around this ended up being the following (but I'm open to suggestions to make it better)...

  resources { 'sensu_enterprise_dashboard_api_config':
    purge     => true,
  }

  sensu_enterprise_dashboard_api_config { 'api1.example.com':
    ensure     => absent,
  }

  sensu_enterprise_dashboard_api_config { 'api2.example.com':
    ensure     => absent,
  }

  sensu::enterprise::dashboard::api { '127.0.0.1':
    ensure     => present,
    datacenter => 'My Datacenter',
  }

Maybe update README for the removal of the apis?

  sensu_enterprise_dashboard_api_config { 'api1.example.com':
    ensure     => absent,
  }

  sensu_enterprise_dashboard_api_config { 'api2.example.com':
    ensure     => absent,
  }

@ghoneycutt
Copy link
Collaborator

ghoneycutt commented Mar 29, 2018

We could add the following as the default

# This would prevent future things the installer added,
# but this is unlikely since Sensu v2 is out and would be
# a surprising change for people.

#resources { 'sensu_enterprise_dashboard_api_config':
# purge => true,
#}

sensu_enterprise_dashboard_api_config { 'api1.example.com':
  ensure => absent,
}

sensu_enterprise_dashboard_api_config { 'api2.example.com':
  ensure => absent,
}

@ghoneycutt ghoneycutt added the bug label Mar 29, 2018
@ghoneycutt ghoneycutt assigned ghoneycutt and treydock and unassigned ghoneycutt Mar 29, 2018
treydock added a commit to treydock/sensu-puppet that referenced this issue Mar 31, 2018
treydock added a commit to treydock/sensu-puppet that referenced this issue Mar 31, 2018
ghoneycutt added a commit that referenced this issue Apr 5, 2018
(GH-883) Remove example sensu_enterprise_dashboard_api_config resources by default
@ghoneycutt
Copy link
Collaborator

Released in v2.50.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants