sensu / sensu-go-chef

Chef Library Cookbook for Sensu Go
https://sensu.io
MIT License
11 stars 22 forks source link

Add support for recent Sensu features #105

Closed calebhailey closed 4 years ago

calebhailey commented 4 years ago

Compare the output of sensuctl describe-type all with the resources we have support for managing via the cookbook.

As of 6.0.0, the types are as follows:

$ sensuctl describe-type all
      Fully Qualified Name           Short Name           API Version             Type          Namespaced  
 ────────────────────────────── ───────────────────── ─────────────────── ──────────────────── ──────────── 
  authentication/v2.Provider                           authentication/v2   Provider             false       
  licensing/v2.LicenseFile                             licensing/v2        LicenseFile          false       
  store/v1.PostgresConfig                              store/v1            PostgresConfig       false       
  federation/v1.EtcdReplicator                         federation/v1       EtcdReplicator       false       
  secrets/v1.Secret                                    secrets/v1          Secret               true        
  secrets/v1.Provider                                  secrets/v1          Provider             false       
  searches/v1.Search                                   searches/v1         Search               true        
  web/v1.GlobalConfig                                  web/v1              GlobalConfig         false       
  core/v2.Namespace              namespaces            core/v2             Namespace            false       
  core/v2.ClusterRole            clusterroles          core/v2             ClusterRole          false       
  core/v2.ClusterRoleBinding     clusterrolebindings   core/v2             ClusterRoleBinding   false       
  core/v2.User                   users                 core/v2             User                 false       
  core/v2.APIKey                 apikeys               core/v2             APIKey               false       
  core/v2.TessenConfig           tessen                core/v2             TessenConfig         false       
  core/v2.Asset                  assets                core/v2             Asset                true        
  core/v2.CheckConfig            checks                core/v2             CheckConfig          true        
  core/v2.Entity                 entities              core/v2             Entity               true        
  core/v2.Event                  events                core/v2             Event                true        
  core/v2.EventFilter            filters               core/v2             EventFilter          true        
  core/v2.Handler                handlers              core/v2             Handler              true        
  core/v2.Hook                   hooks                 core/v2             Hook                 true        
  core/v2.Mutator                mutators              core/v2             Mutator              true        
  core/v2.Role                   roles                 core/v2             Role                 true        
  core/v2.RoleBinding            rolebindings          core/v2             RoleBinding          true        
  core/v2.Silenced               silenced              core/v2             Silenced             true

Compare with https://github.com/sensu/sensu-go-chef#resource-overview

webframp commented 4 years ago

Updating this list as resources are implemented and merged to master. Resource name is hypothetical if not yet implemented.

Sensu Type Cookbook Resource Implemented?
authentication/v2.Provider sensuct_auth_provider :white_check_mark:
licensing/v2.LicenseFile sensuctl_license_file :x:
store/v1.PostgresConfig sensuctl_postgres_config :white_check_mark:
federation/v1.EtcdReplicator sensuctl_etcd_replicator :white_check_mark:
secrets/v1.Secret sensuctl_secret :white_check_mark:
secrets/v1.Provider sensuctl_secrets_provider :white_check_mark:
searches/v1.Search sensuctl_search :white_check_mark:
web/v1.GlobalConfig sensuctl_global_config :white_check_mark:
core/v2.Namespace sensuctl_namespace :white_check_mark:
core/v2.ClusterRole sensuctl_cluster_role :white_check_mark:
core/v2.ClusterRoleBinding sensuctl_cluster_role_binding :white_check_mark:
core/v2.User sensuctl_user :white_check_mark:
core/v2.APIKey sensuctl_api_key :x:
core/v2.TessenConfig sensuctl_tessen_config :white_check_mark:
core/v2.Asset sensuctl_asset :white_check_mark:
core/v2.CheckConfig sensuctl_check :white_check_mark:
core/v2.Entity sensuctl_entity :white_check_mark:
core/v2.Event sensuctl_event :x:
core/v2.EventFilter sensuctl_filter :white_check_mark:
core/v2.Handler sensuctl_handler :white_check_mark:
core/v2.Hook sensuctl_hook :white_check_mark:
core/v2.Mutator sensuctl_mutator :white_check_mark:
core/v2.Role sensuctl_role :white_check_mark:
core/v2.RoleBinding sensuctl_role_binding :white_check_mark:
core/v2.Silenced sensuctl_silenced :x:
webframp commented 4 years ago

authentication/v2.Provider types will be fully supported by 3 custom resources once #81 is closed

webframp commented 4 years ago

I'm not sure it makes much sense to manage Silenced, LicenseFile and APIKey types via chef resources, but I can test a few ideas if that is really needed by users.

My thinking for license is: It's unique per user and possibly sensitive data, api key is definitely sensitive and unique GUID per api key. Silenced should be an ad-hoc item created using sensuctl and not a chef resource in most cases that I can think of.

@calebhailey if you have ideas or feedback for these types let me know.

webframp commented 4 years ago

Also question the value of a sensu_event custom resource. Should scope it's usage to a few user stories in some way since an Event in sensu can be a pretty complex composite type.

webframp commented 4 years ago

As mentioned earlier: Silenced, LicenseFile, APIKey and Event types are odd candidate to manage via chef resources so they've been skipped for now.

If there are user needs to have these as chef resources they can definitely be worked on in the future.