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

Purging sensu bonsai assets deletes all assets #1321

Open
elfranne opened this issue Mar 31, 2022 · 0 comments
Open

Purging sensu bonsai assets deletes all assets #1321

elfranne opened this issue Mar 31, 2022 · 0 comments

Comments

@elfranne
Copy link

elfranne commented Mar 31, 2022

Asset resources are created with a suffix in default, this cause purge to delete all assets:

When adding assets, for example:

  $bonsai_assets = [
    'sensu-plugins/sensu-plugins-process-checks',
    'sensu-plugins/sensu-plugins-puppet',
    'sensu-plugins/sensu-plugins-ssl',
    'sensu-plugins/sensu-plugins-systemd',
    'sensu-plugins/sensu-plugins-uptime-checks',
    'sensu/http-checks',
  ]
  sensu_bonsai_asset { $bonsai_assets:
    ensure  => present,
    version => latest,
  }

Puppet creates the assets:

[...]
Notice: /Stage[main]/Profile::Sensu::Backend/Sensu_bonsai_asset[sensu-plugins/sensu-plugins-puppet]/ensure: created (corrective)
[...]

and check the ressource:

puppet resource Sensu_bonsai_asset
[...]
sensu_bonsai_asset { 'sensu-plugins/sensu-plugins-puppet in default':
  ensure   => 'present',
  provider => 'sensuctl',
  version  => '3.0.0',
}
[...]

But if we went to ensure all the assets are managed and add:

  sensu_resources { 'sensu_bonsai_asset':
    purge => true,
  }

We then see that all assets are removed:

[...]
Notice: /Stage[main]/Profile::Sensu::Backend/Sensu_bonsai_asset[sensu/sensu-plugins-puppet in default]/ensure: removed
[...]

Ubuntu 20.04
Default Ruby from the repo: 2.7.4p191
puppet agent: 7.15.0
sensu puppet module: 5.8.0 (latest)
sensu-backend: 6.4.3

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

No branches or pull requests

1 participant