Open kmf opened 3 years ago
@kmf thanks for opening this feature request. I want to make sure I understand the request and the value it brings before I dive too much into the feasability. I see we already have a generic sensu_asset
resource: https://github.com/sensu/sensu-go-chef/blob/1.3.0/resources/asset.rb
Internally at my org we use it like so:
node['CUSTOM_NAMESPACE']['sensu-go']['namespaces'].each do |namespace|
# do non asset things across all namespace
...
# create assets from attributes
node['CUSTOM_NAMESPACE']['sensu-go']['assets'].each do |asset, property|
sensu_asset asset do
url property['url']
sha512 property['checksum']
namespace namespace
end
end
end
We could probably create a "wrapper" resource that could build the asset but I suspect that we would need to realistically force each of the same bits but could construct the URL.
For example to use sensu-deregistration-handler
we need to specify:
bonsai_asset 'sensu-deregistration-handler' do
version '0.1.0'
platform 'linux'
arch 'amd64'
end
It's tempting to assume we can use ohai
data to tell us some of the answers of that I do not think that is a good stance as we are likely creating assets for multiple systems/platforms on the backend which may not represent all the required clients to support.
This functionality sensuctl asset add sensu/sensu-influxdb-handler
is what I was looking for
Gotch, from what I read here https://docs.sensu.io/sensu-go/latest/plugins/assets/ it seems the URL is a required field in the spec. I suspect the sensuctl
command itself is providing that sugar. I think its doable but we can't be idempotent because we won't know when we need to run it again. I will see if I can do some additional digging.
Bumping this since it seems really useful. It's a lot to keep track of all the URLs/SHAs especially if an asset has multiple builds.
Also pointing out it seems there's a bonsai_asset
in the sensu-go Ansible collection.
Would love to use an asset like this