Skip to content

Instantly share code, notes, and snippets.

@majormoses
Last active April 26, 2019 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save majormoses/45a285540c213e975fb9ec42c899a830 to your computer and use it in GitHub Desktop.
Save majormoses/45a285540c213e975fb9ec42c899a830 to your computer and use it in GitHub Desktop.
test-sensu-go-chef
$ KITCHEN_LOCAL_YAML=.kitchen.dokken.yml bundle exec kitchen converge default-ubuntu-1604
-----> Starting Kitchen (v1.21.2)
-----> Creating <default-ubuntu-1604>...
Creating kitchen sandbox at /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1604
Creating verifier sandbox at /home/babrams/.dokken/verifier_sandbox/c488ee9495-default-ubuntu-1604
Building work image..
Creating container c488ee9495-default-ubuntu-1604
Finished creating <default-ubuntu-1604> (0m17.72s).
-----> Converging <default-ubuntu-1604>...
Creating kitchen sandbox in /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1604
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 7.0.4...
Removing non-cookbook files before transfer
Preparing data_bags
Preparing validation.pem
Preparing client.rb
Starting Chef Client, version 14.5.0
Creating a new client identity for default-ubuntu-1604 using the validator key.
resolving cookbooks for run list: ["sensu_test::default"]
Synchronizing Cookbooks:
- sensu_test (0.0.1)
- sensu-go (0.0.3)
- packagecloud (1.0.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 19 resources
Recipe: sensu_test::default
* sensu_backend[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create
- create new file /etc/apt/sources.list.d/sensu_stable.list
- update content in file /etc/apt/sources.list.d/sensu_stable.list from none to e60704
--- /etc/apt/sources.list.d/sensu_stable.list 2019-04-26 01:50:45.207014733 +0000
+++ /etc/apt/sources.list.d/.chef-sensu_stable20190426-128-1emrg20.list 2019-04-26 01:50:45.207014733 +0000
@@ -1 +1,3 @@
+deb https://packagecloud.io/sensu/stable/ubuntu xenial main
+deb-src https://packagecloud.io/sensu/stable/ubuntu xenial main
- change mode from '' to '0644'
* execute[apt-key-add-sensu_stable] action run
- execute wget --auth-no-challenge -qO - https://packagecloud.io/sensu/stable/gpgkey | apt-key add -
* execute[apt-get-update-sensu_stable] action run
- execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/sensu_stable.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
* apt_package[sensu-go-backend] action upgrade
- upgrade package sensu-go-backend from uninstalled to 5.5.1-1756
* file[/etc/sensu/backend.yml] action create
- create new file /etc/sensu/backend.yml
- update content in file /etc/sensu/backend.yml from none to 65e23e
--- /etc/sensu/backend.yml 2019-04-26 01:50:51.214955055 +0000
+++ /etc/sensu/.chef-backend20190426-128-1h6arms.yml 2019-04-26 01:50:51.214955055 +0000
@@ -1 +1,3 @@
+---
+state-dir: "/var/lib/sensu/sensu-backend"
* service[sensu-backend] action enable
- enable service service[sensu-backend]
* service[sensu-backend] action start
- start service service[sensu-backend]
* sensu_agent[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create (up to date)
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
(up to date)
* apt_package[sensu-go-agent] action upgrade
- upgrade package sensu-go-agent from uninstalled to 5.5.1-1756
* file[/etc/sensu/agent.yml] action create
- create new file /etc/sensu/agent.yml
- update content in file /etc/sensu/agent.yml from none to 1aa655
--- /etc/sensu/agent.yml 2019-04-26 01:50:57.714913064 +0000
+++ /etc/sensu/.chef-agent20190426-128-1wiivo2.yml 2019-04-26 01:50:57.714913064 +0000
@@ -1 +1,6 @@
+---
+name: dokken
+namespace: default
+backend-url:
+- ws://127.0.0.1:8081
* service[sensu-agent] action enable
- enable service service[sensu-agent]
* service[sensu-agent] action start
- start service service[sensu-agent]
* sensu_ctl[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create (up to date)
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
(up to date)
* apt_package[sensu-go-cli] action install
- install version 5.5.1-1756 of package sensu-go-cli
* sensu_ctl[default] action configure
- Reconfiguring sensuctl
* execute[configure sensuctl] action run
- execute sensitive resource
* sensu_namespace[test-org] action create
* directory[/etc/sensu/namespaces] action create
- create new directory /etc/sensu/namespaces
* file[/etc/sensu/namespaces/test-org.json] action create
- create new file /etc/sensu/namespaces/test-org.json
- update content in file /etc/sensu/namespaces/test-org.json from none to 70ab98
--- /etc/sensu/namespaces/test-org.json 2019-04-26 01:51:04.846884703 +0000
+++ /etc/sensu/namespaces/.chef-test-org20190426-128-hgh9wh.json 2019-04-26 01:51:04.846884703 +0000
@@ -1 +1,2 @@
+{"type":"namespace","spec":{"name":"test-org"}}
* execute[sensuctl create -f /etc/sensu/namespaces/test-org.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/namespaces/test-org.json] action run
- execute sensuctl create -f /etc/sensu/namespaces/test-org.json
* sensu_check[cron] action create
* directory[/etc/sensu/checks] action create
- create new directory /etc/sensu/checks
* file[/etc/sensu/checks/cron.json] action create
- create new file /etc/sensu/checks/cron.json
- update content in file /etc/sensu/checks/cron.json from none to 3271c6
--- /etc/sensu/checks/cron.json 2019-04-26 01:51:04.882884591 +0000
+++ /etc/sensu/checks/.chef-cron20190426-128-icsunm.json 2019-04-26 01:51:04.882884591 +0000
@@ -1 +1,2 @@
+{"type":"check","spec":{"command":"/bin/true","cron":"@hourly","metadata":{"name":"cron","namespace":"default","labels":{"environment":"production","region":"us-west-2"},"annotations":{"runbook":"https://www.xkcd.com/378/"}},"handlers":["pagerduty","email"],"high_flap_threshold":60,"low_flap_threshold":20,"stdin":false,"subdue":{"days":{"all":[{"begin":"12:00 AM","end":"11:59 PM"},{"begin":"11:00 PM","end":"1:00 AM"}]}},"subscriptions":["dad_jokes","production"],"ttl":100}}
* execute[sensuctl create -f /etc/sensu/checks/cron.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/checks/cron.json] action run
- execute sensuctl create -f /etc/sensu/checks/cron.json
* sensu_asset[sensu-plugins-http] action create
* directory[/etc/sensu/assets] action create
- create new directory /etc/sensu/assets
* file[/etc/sensu/assets/sensu-plugins-http.json] action create
- create new file /etc/sensu/assets/sensu-plugins-http.json
- update content in file /etc/sensu/assets/sensu-plugins-http.json from none to 869540
--- /etc/sensu/assets/sensu-plugins-http.json 2019-04-26 01:51:04.914884492 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-http20190426-128-hdesjm.json 2019-04-26 01:51:04.914884492 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-http","namespace":"default"},"sha512":"b57cacd2b479f41b5d002c037ac3005e7a655d1dfae93c457f0c19dde21fc992771b5d290a2cce9255578d9bd2fc88075646e3e0e02e3c01d8e1e274ae0b7376","url":"https://github.com/sensu-plugins/sensu-plugins-http/archive/2.9.0.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json
* sensu_asset[sensu-plugins-docker] action create
* directory[/etc/sensu/assets] action create (up to date)
* file[/etc/sensu/assets/sensu-plugins-docker.json] action create
- create new file /etc/sensu/assets/sensu-plugins-docker.json
- update content in file /etc/sensu/assets/sensu-plugins-docker.json from none to 8da084
--- /etc/sensu/assets/sensu-plugins-docker.json 2019-04-26 01:51:04.942884405 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-docker20190426-128-1smvzb8.json 2019-04-26 01:51:04.942884405 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-docker","namespace":"default"},"sha512":"96f71be5824ae50db8992ffdd1a94076170457cd9ca4f8563d739ffb07d65aca06c1d2ff5590b10f73089b300a74a3c5c255dcd9a4649487aa81a29e4f81c85c","url":"https://github.com/sensu-plugins/sensu-plugins-docker/archive/3.0.0.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json
* sensu_asset[sensu-plugins-postgres] action create
* directory[/etc/sensu/assets] action create (up to date)
* file[/etc/sensu/assets/sensu-plugins-postgres.json] action create
- create new file /etc/sensu/assets/sensu-plugins-postgres.json
- update content in file /etc/sensu/assets/sensu-plugins-postgres.json from none to 65f3eb
--- /etc/sensu/assets/sensu-plugins-postgres.json 2019-04-26 01:51:04.970884319 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-postgres20190426-128-ggvg5d.json 2019-04-26 01:51:04.970884319 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-postgres","namespace":"default"},"sha512":"b4369e69f3e3247b6f48596733da2f1a3c66fceebb60e6b00c70f404324876696fc8d2381206c47bd9d09227b2d6d3802f359e2ae349d71930bd0d45c0b3d554","url":"https://github.com/sensu-plugins/sensu-plugins-postgres/archive/1.4.6.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json
* sensu_handler[slack] action create
* directory[/etc/sensu/handlers] action create
- create new directory /etc/sensu/handlers
* file[/etc/sensu/handlers/slack.json] action create
- create new file /etc/sensu/handlers/slack.json
- update content in file /etc/sensu/handlers/slack.json from none to b8c7e4
--- /etc/sensu/handlers/slack.json 2019-04-26 01:51:05.002884220 +0000
+++ /etc/sensu/handlers/.chef-slack20190426-128-goxek1.json 2019-04-26 01:51:05.002884220 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"command":"handler-slack --webhook-url https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX --channel monitoring","metadata":{"name":"slack","namespace":"default"},"type":"pipe"}}
* execute[sensuctl create -f /etc/sensu/handlers/slack.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/slack.json] action run
- execute sensuctl create -f /etc/sensu/handlers/slack.json
* sensu_handler[tcp_handler] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/tcp_handler.json] action create
- create new file /etc/sensu/handlers/tcp_handler.json
- update content in file /etc/sensu/handlers/tcp_handler.json from none to f25cfd
--- /etc/sensu/handlers/tcp_handler.json 2019-04-26 01:51:05.038884115 +0000
+++ /etc/sensu/handlers/.chef-tcp_handler20190426-128-ek3vul.json 2019-04-26 01:51:05.038884115 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"tcp_handler","namespace":"default"},"socket":{"host":"127.0.0.1","port":4444},"timeout":30,"type":"tcp"}}
* execute[sensuctl create -f /etc/sensu/handlers/tcp_handler.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/tcp_handler.json] action run
- execute sensuctl create -f /etc/sensu/handlers/tcp_handler.json
* sensu_handler[udp_handler] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/udp_handler.json] action create
- create new file /etc/sensu/handlers/udp_handler.json
- update content in file /etc/sensu/handlers/udp_handler.json from none to 0f2da0
--- /etc/sensu/handlers/udp_handler.json 2019-04-26 01:51:05.074884012 +0000
+++ /etc/sensu/handlers/.chef-udp_handler20190426-128-1g1f11m.json 2019-04-26 01:51:05.074884012 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"udp_handler","namespace":"default"},"socket":{"host":"127.0.0.1","port":4444},"timeout":30,"type":"udp"}}
* execute[sensuctl create -f /etc/sensu/handlers/udp_handler.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/udp_handler.json] action run
- execute sensuctl create -f /etc/sensu/handlers/udp_handler.json
* sensu_handler[notify_the_world] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/notify_the_world.json] action create
- create new file /etc/sensu/handlers/notify_the_world.json
- update content in file /etc/sensu/handlers/notify_the_world.json from none to 350bba
--- /etc/sensu/handlers/notify_the_world.json 2019-04-26 01:51:05.106883920 +0000
+++ /etc/sensu/handlers/.chef-notify_the_world20190426-128-tni44r.json 2019-04-26 01:51:05.106883920 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"notify_the_world","namespace":"default"},"handlers":["slack","tcp_handler","udp_handler"],"type":"set"}}
* execute[sensuctl create -f /etc/sensu/handlers/notify_the_world.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/notify_the_world.json] action run
- execute sensuctl create -f /etc/sensu/handlers/notify_the_world.json
* sensu_filter[production_filter] action create
* directory[/etc/sensu/filters] action create
- create new directory /etc/sensu/filters
* file[/etc/sensu/filters/production_filter.json] action create
- create new file /etc/sensu/filters/production_filter.json
- update content in file /etc/sensu/filters/production_filter.json from none to 91009b
--- /etc/sensu/filters/production_filter.json 2019-04-26 01:51:05.142883818 +0000
+++ /etc/sensu/filters/.chef-production_filter20190426-128-zy9dza.json 2019-04-26 01:51:05.138883829 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"production_filter","namespace":"default"},"expressions":["event.Entity.Environment == 'production'"]}}
* execute[sensuctl create -f /etc/sensu/filters/production_filter.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/production_filter.json] action run
- execute sensuctl create -f /etc/sensu/filters/production_filter.json
* sensu_filter[development_filter] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/development_filter.json] action create
- create new file /etc/sensu/filters/development_filter.json
- update content in file /etc/sensu/filters/development_filter.json from none to ff4313
--- /etc/sensu/filters/development_filter.json 2019-04-26 01:51:05.178883714 +0000
+++ /etc/sensu/filters/.chef-development_filter20190426-128-1grb4lf.json 2019-04-26 01:51:05.178883714 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"deny","metadata":{"name":"development_filter","namespace":"default"},"expressions":["event.Entity.Environment == 'production'"]}}
* execute[sensuctl create -f /etc/sensu/filters/development_filter.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/development_filter.json] action run
- execute sensuctl create -f /etc/sensu/filters/development_filter.json
* sensu_filter[state_change_only] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/state_change_only.json] action create
- create new file /etc/sensu/filters/state_change_only.json
- update content in file /etc/sensu/filters/state_change_only.json from none to 6491ff
--- /etc/sensu/filters/state_change_only.json 2019-04-26 01:51:05.222883588 +0000
+++ /etc/sensu/filters/.chef-state_change_only20190426-128-k88hti.json 2019-04-26 01:51:05.222883588 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"state_change_only","namespace":"default"},"expressions":["event.Check.Occurrences == 1"]}}
* execute[sensuctl create -f /etc/sensu/filters/state_change_only.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/state_change_only.json] action run
- execute sensuctl create -f /etc/sensu/filters/state_change_only.json
* sensu_filter[filter_interval_60_hourly] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/filter_interval_60_hourly.json] action create
- create new file /etc/sensu/filters/filter_interval_60_hourly.json
- update content in file /etc/sensu/filters/filter_interval_60_hourly.json from none to a4680c
--- /etc/sensu/filters/filter_interval_60_hourly.json 2019-04-26 01:51:05.258883485 +0000
+++ /etc/sensu/filters/.chef-filter_interval_60_hourly20190426-128-163bwx1.json 2019-04-26 01:51:05.258883485 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"filter_interval_60_hourly","namespace":"default"},"expressions":["event.Check.Interval == 60","event.Check.Occurrences == 1 || event.Check.Occurrences % 60 == 0"]}}
* execute[sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json] action run
- execute sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json
* sensu_filter[nine_to_fiver] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/nine_to_fiver.json] action create
- create new file /etc/sensu/filters/nine_to_fiver.json
- update content in file /etc/sensu/filters/nine_to_fiver.json from none to 8d9fed
--- /etc/sensu/filters/nine_to_fiver.json 2019-04-26 01:51:05.306883348 +0000
+++ /etc/sensu/filters/.chef-nine_to_fiver20190426-128-ref9jb.json 2019-04-26 01:51:05.306883348 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"nine_to_fiver","namespace":"default"},"expressions":["weekday(event.Timestamp) >= 1 && weekday(event.Timestamp) <= 5","hour(event.Timestamp) >= 9 && hour(event.Timestamp) <= 17"]}}
* execute[sensuctl create -f /etc/sensu/filters/nine_to_fiver.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/nine_to_fiver.json] action run
- execute sensuctl create -f /etc/sensu/filters/nine_to_fiver.json
* sensu_mutator[example-mutator] action create
* directory[/etc/sensu/mutators] action create
- create new directory /etc/sensu/mutators
* file[/etc/sensu/mutators/example-mutator.json] action create
- create new file /etc/sensu/mutators/example-mutator.json
- update content in file /etc/sensu/mutators/example-mutator.json from none to 83fdf6
--- /etc/sensu/mutators/example-mutator.json 2019-04-26 01:51:05.338883256 +0000
+++ /etc/sensu/mutators/.chef-example-mutator20190426-128-1nb44da.json 2019-04-26 01:51:05.338883256 +0000
@@ -1 +1,2 @@
+{"type":"mutator","spec":{"command":"example_mutator.rb","metadata":{"name":"example-mutator","namespace":"default"},"timeout":60}}
* execute[sensuctl create -f /etc/sensu/mutators/example-mutator.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/mutators/example-mutator.json] action run
- execute sensuctl create -f /etc/sensu/mutators/example-mutator.json
* sensu_entity[example-entity] action create
* directory[/etc/sensu/entitys] action create
- create new directory /etc/sensu/entitys
* file[/etc/sensu/entitys/example-entity.json] action create
- create new file /etc/sensu/entitys/example-entity.json
- update content in file /etc/sensu/entitys/example-entity.json from none to 17e203
--- /etc/sensu/entitys/example-entity.json 2019-04-26 01:51:05.370883164 +0000
+++ /etc/sensu/entitys/.chef-example-entity20190426-128-1tquj44.json2019-04-26 01:51:05.370883164 +0000
@@ -1 +1,2 @@
+{"type":"entity","spec":{"subscriptions":["example-entity"],"metadata":{"name":"example-entity","namespace":"default","labels":{"environment":"production","region":"us-west-2"},"annotations":{"runbook":"https://www.xkcd.com/378/"}},"entity_class":"proxy"}}
* execute[sensuctl create -f /etc/sensu/entitys/example-entity.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/entitys/example-entity.json] action run
- execute sensuctl create -f /etc/sensu/entitys/example-entity.json
Running handlers:
Running handlers complete
Chef Client finished, 73/120 resources updated in 25 seconds
Finished converging <default-ubuntu-1604> (0m29.22s).
-----> Kitchen is finished. (0m48.74s)
$ KITCHEN_LOCAL_YAML=.kitchen.dokken.yml bundle exec kitchen converge default-ubuntu-1804
-----> Starting Kitchen (v1.21.2)
-----> Creating <default-ubuntu-1804>...
Creating kitchen sandbox at /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1804
Creating verifier sandbox at /home/babrams/.dokken/verifier_sandbox/c488ee9495-default-ubuntu-1804
Building work image..
Creating container c488ee9495-default-ubuntu-1804
Finished creating <default-ubuntu-1804> (0m9.56s).
-----> Converging <default-ubuntu-1804>...
Creating kitchen sandbox in /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1804
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 7.0.4...
Removing non-cookbook files before transfer
Preparing data_bags
Preparing validation.pem
Preparing client.rb
Starting Chef Client, version 14.5.0
Creating a new client identity for default-ubuntu-1804 using the validator key.
resolving cookbooks for run list: ["sensu_test::default"]
Synchronizing Cookbooks:
- sensu_test (0.0.1)
- sensu-go (0.0.3)
- packagecloud (1.0.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 19 resources
Recipe: sensu_test::default
* sensu_backend[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create
- create new file /etc/apt/sources.list.d/sensu_stable.list
- update content in file /etc/apt/sources.list.d/sensu_stable.list from none to 0c5ca9
--- /etc/apt/sources.list.d/sensu_stable.list 2019-04-26 01:47:38.918467165 +0000
+++ /etc/apt/sources.list.d/.chef-sensu_stable20190426-89-ozvpe4.list 2019-04-26 01:47:38.918467165 +0000
@@ -1 +1,3 @@
+deb https://packagecloud.io/sensu/stable/ubuntu bionic main
+deb-src https://packagecloud.io/sensu/stable/ubuntu bionic main
- change mode from '' to '0644'
* execute[apt-key-add-sensu_stable] action run
- execute wget --auth-no-challenge -qO - https://packagecloud.io/sensu/stable/gpgkey | apt-key add -
* execute[apt-get-update-sensu_stable] action run
- execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/sensu_stable.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
* apt_package[sensu-go-backend] action upgrade
- upgrade package sensu-go-backend from uninstalled to 5.5.1-1756
* file[/etc/sensu/backend.yml] action create
- create new file /etc/sensu/backend.yml
- update content in file /etc/sensu/backend.yml from none to 65e23e
--- /etc/sensu/backend.yml 2019-04-26 01:47:44.894411465 +0000
+++ /etc/sensu/.chef-backend20190426-89-xsjtj8.yml 2019-04-26 01:47:44.894411465 +0000
@@ -1 +1,3 @@
+---
+state-dir: "/var/lib/sensu/sensu-backend"
* service[sensu-backend] action enable
- enable service service[sensu-backend]
* service[sensu-backend] action start
- start service service[sensu-backend]
* sensu_agent[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create (up to date)
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
(up to date)
* apt_package[sensu-go-agent] action upgrade
- upgrade package sensu-go-agent from uninstalled to 5.5.1-1756
* file[/etc/sensu/agent.yml] action create
- create new file /etc/sensu/agent.yml
- update content in file /etc/sensu/agent.yml from none to 1aa655
--- /etc/sensu/agent.yml 2019-04-26 01:47:51.962370512 +0000
+++ /etc/sensu/.chef-agent20190426-89-z5sjzn.yml 2019-04-26 01:47:51.962370512 +0000
@@ -1 +1,6 @@
+---
+name: dokken
+namespace: default
+backend-url:
+- ws://127.0.0.1:8081
* service[sensu-agent] action enable
- enable service service[sensu-agent]
* service[sensu-agent] action start
- start service service[sensu-agent]
* sensu_ctl[default] action install
* packagecloud_repo[sensu/stable] action add
* apt_package[wget] action install (up to date)
* apt_package[apt-transport-https] action install (up to date)
* apt_package[lsb-release] action install (up to date)
* ohai[reload-lsb-sensu_stable] action nothing (skipped due to action :nothing)
* template[/etc/apt/sources.list.d/sensu_stable.list] action create (up to date)
* execute[apt-key-add-sensu_stable] action nothing (skipped due to action :nothing)
* execute[apt-get-update-sensu_stable] action nothing (skipped due to action :nothing)
(up to date)
* apt_package[sensu-go-cli] action install
- install version 5.5.1-1756 of package sensu-go-cli
* sensu_ctl[default] action configure
- Reconfiguring sensuctl
* execute[configure sensuctl] action run
- execute sensitive resource
* sensu_namespace[test-org] action create
* directory[/etc/sensu/namespaces] action create
- create new directory /etc/sensu/namespaces
* file[/etc/sensu/namespaces/test-org.json] action create
- create new file /etc/sensu/namespaces/test-org.json
- update content in file /etc/sensu/namespaces/test-org.json from none to 70ab98
--- /etc/sensu/namespaces/test-org.json 2019-04-26 01:47:59.398346309 +0000
+++ /etc/sensu/namespaces/.chef-test-org20190426-89-1ujx0yh.json 2019-04-26 01:47:59.398346309 +0000
@@ -1 +1,2 @@
+{"type":"namespace","spec":{"name":"test-org"}}
* execute[sensuctl create -f /etc/sensu/namespaces/test-org.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/namespaces/test-org.json] action run
- execute sensuctl create -f /etc/sensu/namespaces/test-org.json
* sensu_check[cron] action create
* directory[/etc/sensu/checks] action create
- create new directory /etc/sensu/checks
* file[/etc/sensu/checks/cron.json] action create
- create new file /etc/sensu/checks/cron.json
- update content in file /etc/sensu/checks/cron.json from none to 3271c6
--- /etc/sensu/checks/cron.json 2019-04-26 01:47:59.470346144 +0000
+++ /etc/sensu/checks/.chef-cron20190426-89-4poug9.json 2019-04-26 01:47:59.470346144 +0000
@@ -1 +1,2 @@
+{"type":"check","spec":{"command":"/bin/true","cron":"@hourly","metadata":{"name":"cron","namespace":"default","labels":{"environment":"production","region":"us-west-2"},"annotations":{"runbook":"https://www.xkcd.com/378/"}},"handlers":["pagerduty","email"],"high_flap_threshold":60,"low_flap_threshold":20,"stdin":false,"subdue":{"days":{"all":[{"begin":"12:00 AM","end":"11:59 PM"},{"begin":"11:00 PM","end":"1:00 AM"}]}},"subscriptions":["dad_jokes","production"],"ttl":100}}
* execute[sensuctl create -f /etc/sensu/checks/cron.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/checks/cron.json] action run
- execute sensuctl create -f /etc/sensu/checks/cron.json
* sensu_asset[sensu-plugins-http] action create
* directory[/etc/sensu/assets] action create
- create new directory /etc/sensu/assets
* file[/etc/sensu/assets/sensu-plugins-http.json] action create
- create new file /etc/sensu/assets/sensu-plugins-http.json
- update content in file /etc/sensu/assets/sensu-plugins-http.json from none to 869540
--- /etc/sensu/assets/sensu-plugins-http.json 2019-04-26 01:47:59.514346042 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-http20190426-89-165f2er.json 2019-04-26 01:47:59.514346042 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-http","namespace":"default"},"sha512":"b57cacd2b479f41b5d002c037ac3005e7a655d1dfae93c457f0c19dde21fc992771b5d290a2cce9255578d9bd2fc88075646e3e0e02e3c01d8e1e274ae0b7376","url":"https://github.com/sensu-plugins/sensu-plugins-http/archive/2.9.0.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-http.json
* sensu_asset[sensu-plugins-docker] action create
* directory[/etc/sensu/assets] action create (up to date)
* file[/etc/sensu/assets/sensu-plugins-docker.json] action create
- create new file /etc/sensu/assets/sensu-plugins-docker.json
- update content in file /etc/sensu/assets/sensu-plugins-docker.json from none to 8da084
--- /etc/sensu/assets/sensu-plugins-docker.json 2019-04-26 01:47:59.554345951 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-docker20190426-89-2hsm6q.json 2019-04-26 01:47:59.554345951 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-docker","namespace":"default"},"sha512":"96f71be5824ae50db8992ffdd1a94076170457cd9ca4f8563d739ffb07d65aca06c1d2ff5590b10f73089b300a74a3c5c255dcd9a4649487aa81a29e4f81c85c","url":"https://github.com/sensu-plugins/sensu-plugins-docker/archive/3.0.0.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-docker.json
* sensu_asset[sensu-plugins-postgres] action create
* directory[/etc/sensu/assets] action create (up to date)
* file[/etc/sensu/assets/sensu-plugins-postgres.json] action create
- create new file /etc/sensu/assets/sensu-plugins-postgres.json
- update content in file /etc/sensu/assets/sensu-plugins-postgres.json from none to 65f3eb
--- /etc/sensu/assets/sensu-plugins-postgres.json 2019-04-26 01:47:59.614345813 +0000
+++ /etc/sensu/assets/.chef-sensu-plugins-postgres20190426-89-1efjdx8.json 2019-04-26 01:47:59.614345813 +0000
@@ -1 +1,2 @@
+{"type":"asset","spec":{"metadata":{"name":"sensu-plugins-postgres","namespace":"default"},"sha512":"b4369e69f3e3247b6f48596733da2f1a3c66fceebb60e6b00c70f404324876696fc8d2381206c47bd9d09227b2d6d3802f359e2ae349d71930bd0d45c0b3d554","url":"https://github.com/sensu-plugins/sensu-plugins-postgres/archive/1.4.6.tar.gz"}}
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json] action run
- execute sensuctl create -f /etc/sensu/assets/sensu-plugins-postgres.json
* sensu_handler[slack] action create
* directory[/etc/sensu/handlers] action create
- create new directory /etc/sensu/handlers
* file[/etc/sensu/handlers/slack.json] action create
- create new file /etc/sensu/handlers/slack.json
- update content in file /etc/sensu/handlers/slack.json from none to b8c7e4
--- /etc/sensu/handlers/slack.json 2019-04-26 01:47:59.658345712 +0000
+++ /etc/sensu/handlers/.chef-slack20190426-89-1xpmfu3.json 2019-04-26 01:47:59.658345712 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"command":"handler-slack --webhook-url https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX --channel monitoring","metadata":{"name":"slack","namespace":"default"},"type":"pipe"}}
* execute[sensuctl create -f /etc/sensu/handlers/slack.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/slack.json] action run
- execute sensuctl create -f /etc/sensu/handlers/slack.json
* sensu_handler[tcp_handler] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/tcp_handler.json] action create
- create new file /etc/sensu/handlers/tcp_handler.json
- update content in file /etc/sensu/handlers/tcp_handler.json from none to f25cfd
--- /etc/sensu/handlers/tcp_handler.json 2019-04-26 01:47:59.710345592 +0000
+++ /etc/sensu/handlers/.chef-tcp_handler20190426-89-18ubdp4.json 2019-04-26 01:47:59.710345592 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"tcp_handler","namespace":"default"},"socket":{"host":"127.0.0.1","port":4444},"timeout":30,"type":"tcp"}}
* execute[sensuctl create -f /etc/sensu/handlers/tcp_handler.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/tcp_handler.json] action run
- execute sensuctl create -f /etc/sensu/handlers/tcp_handler.json
* sensu_handler[udp_handler] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/udp_handler.json] action create
- create new file /etc/sensu/handlers/udp_handler.json
- update content in file /etc/sensu/handlers/udp_handler.json from none to 0f2da0
--- /etc/sensu/handlers/udp_handler.json 2019-04-26 01:47:59.794345400 +0000
+++ /etc/sensu/handlers/.chef-udp_handler20190426-89-ud2m5a.json 2019-04-26 01:47:59.790345409 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"udp_handler","namespace":"default"},"socket":{"host":"127.0.0.1","port":4444},"timeout":30,"type":"udp"}}
* execute[sensuctl create -f /etc/sensu/handlers/udp_handler.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/udp_handler.json] action run
- execute sensuctl create -f /etc/sensu/handlers/udp_handler.json
* sensu_handler[notify_the_world] action create
* directory[/etc/sensu/handlers] action create (up to date)
* file[/etc/sensu/handlers/notify_the_world.json] action create
- create new file /etc/sensu/handlers/notify_the_world.json
- update content in file /etc/sensu/handlers/notify_the_world.json from none to 350bba
--- /etc/sensu/handlers/notify_the_world.json 2019-04-26 01:47:59.854345263 +0000
+++ /etc/sensu/handlers/.chef-notify_the_world20190426-89-1vua1lb.json 2019-04-26 01:47:59.854345263 +0000
@@ -1 +1,2 @@
+{"type":"handler","spec":{"metadata":{"name":"notify_the_world","namespace":"default"},"handlers":["slack","tcp_handler","udp_handler"],"type":"set"}}
* execute[sensuctl create -f /etc/sensu/handlers/notify_the_world.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/handlers/notify_the_world.json] action run
- execute sensuctl create -f /etc/sensu/handlers/notify_the_world.json
* sensu_filter[production_filter] action create
* directory[/etc/sensu/filters] action create
- create new directory /etc/sensu/filters
* file[/etc/sensu/filters/production_filter.json] action create
- create new file /etc/sensu/filters/production_filter.json
- update content in file /etc/sensu/filters/production_filter.json from none to 91009b
--- /etc/sensu/filters/production_filter.json 2019-04-26 01:47:59.962345014 +0000
+++ /etc/sensu/filters/.chef-production_filter20190426-89-1ml5k3s.json 2019-04-26 01:47:59.962345014 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"production_filter","namespace":"default"},"expressions":["event.Entity.Environment == 'production'"]}}
* execute[sensuctl create -f /etc/sensu/filters/production_filter.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/production_filter.json] action run
- execute sensuctl create -f /etc/sensu/filters/production_filter.json
* sensu_filter[development_filter] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/development_filter.json] action create
- create new file /etc/sensu/filters/development_filter.json
- update content in file /etc/sensu/filters/development_filter.json from none to ff4313
--- /etc/sensu/filters/development_filter.json 2019-04-26 01:48:00.106344705 +0000
+++ /etc/sensu/filters/.chef-development_filter20190426-89-15w00j.json 2019-04-26 01:48:00.106344705 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"deny","metadata":{"name":"development_filter","namespace":"default"},"expressions":["event.Entity.Environment == 'production'"]}}
* execute[sensuctl create -f /etc/sensu/filters/development_filter.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/development_filter.json] action run
- execute sensuctl create -f /etc/sensu/filters/development_filter.json
* sensu_filter[state_change_only] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/state_change_only.json] action create
- create new file /etc/sensu/filters/state_change_only.json
- update content in file /etc/sensu/filters/state_change_only.json from none to 6491ff
--- /etc/sensu/filters/state_change_only.json 2019-04-26 01:48:00.174344563 +0000
+++ /etc/sensu/filters/.chef-state_change_only20190426-89-iieb55.json2019-04-26 01:48:00.174344563 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"state_change_only","namespace":"default"},"expressions":["event.Check.Occurrences == 1"]}}
* execute[sensuctl create -f /etc/sensu/filters/state_change_only.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/state_change_only.json] action run
- execute sensuctl create -f /etc/sensu/filters/state_change_only.json
* sensu_filter[filter_interval_60_hourly] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/filter_interval_60_hourly.json] action create
- create new file /etc/sensu/filters/filter_interval_60_hourly.json
- update content in file /etc/sensu/filters/filter_interval_60_hourly.json from none to a4680c
--- /etc/sensu/filters/filter_interval_60_hourly.json 2019-04-26 01:48:00.234344438 +0000
+++ /etc/sensu/filters/.chef-filter_interval_60_hourly20190426-89-1lz3ps9.json 2019-04-26 01:48:00.234344438 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"filter_interval_60_hourly","namespace":"default"},"expressions":["event.Check.Interval == 60","event.Check.Occurrences == 1 || event.Check.Occurrences % 60 == 0"]}}
* execute[sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json] action run
- execute sensuctl create -f /etc/sensu/filters/filter_interval_60_hourly.json
* sensu_filter[nine_to_fiver] action create
* directory[/etc/sensu/filters] action create (up to date)
* file[/etc/sensu/filters/nine_to_fiver.json] action create
- create new file /etc/sensu/filters/nine_to_fiver.json
- update content in file /etc/sensu/filters/nine_to_fiver.json from none to 8d9fed
--- /etc/sensu/filters/nine_to_fiver.json 2019-04-26 01:48:00.298344304 +0000
+++ /etc/sensu/filters/.chef-nine_to_fiver20190426-89-1ljzpp9.json 2019-04-26 01:48:00.298344304 +0000
@@ -1 +1,2 @@
+{"type":"event_filter","spec":{"action":"allow","metadata":{"name":"nine_to_fiver","namespace":"default"},"expressions":["weekday(event.Timestamp) >= 1 && weekday(event.Timestamp) <= 5","hour(event.Timestamp) >= 9 && hour(event.Timestamp) <= 17"]}}
* execute[sensuctl create -f /etc/sensu/filters/nine_to_fiver.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/filters/nine_to_fiver.json] action run
- execute sensuctl create -f /etc/sensu/filters/nine_to_fiver.json
* sensu_mutator[example-mutator] action create
* directory[/etc/sensu/mutators] action create
- create new directory /etc/sensu/mutators
* file[/etc/sensu/mutators/example-mutator.json] action create
- create new file /etc/sensu/mutators/example-mutator.json
- update content in file /etc/sensu/mutators/example-mutator.json from none to 83fdf6
--- /etc/sensu/mutators/example-mutator.json 2019-04-26 01:48:00.362344171 +0000
+++ /etc/sensu/mutators/.chef-example-mutator20190426-89-zhg9x2.json2019-04-26 01:48:00.362344171 +0000
@@ -1 +1,2 @@
+{"type":"mutator","spec":{"command":"example_mutator.rb","metadata":{"name":"example-mutator","namespace":"default"},"timeout":60}}
* execute[sensuctl create -f /etc/sensu/mutators/example-mutator.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/mutators/example-mutator.json] action run
- execute sensuctl create -f /etc/sensu/mutators/example-mutator.json
* sensu_entity[example-entity] action create
* directory[/etc/sensu/entitys] action create
- create new directory /etc/sensu/entitys
* file[/etc/sensu/entitys/example-entity.json] action create
- create new file /etc/sensu/entitys/example-entity.json
- update content in file /etc/sensu/entitys/example-entity.json from none to 17e203
--- /etc/sensu/entitys/example-entity.json 2019-04-26 01:48:00.406344079 +0000
+++ /etc/sensu/entitys/.chef-example-entity20190426-89-p6kums.json 2019-04-26 01:48:00.406344079 +0000
@@ -1 +1,2 @@
+{"type":"entity","spec":{"subscriptions":["example-entity"],"metadata":{"name":"example-entity","namespace":"default","labels":{"environment":"production","region":"us-west-2"},"annotations":{"runbook":"https://www.xkcd.com/378/"}},"entity_class":"proxy"}}
* execute[sensuctl create -f /etc/sensu/entitys/example-entity.json] action nothing (skipped due to action :nothing)
* execute[sensuctl create -f /etc/sensu/entitys/example-entity.json] action run
- execute sensuctl create -f /etc/sensu/entitys/example-entity.json
Running handlers:
Running handlers complete
Chef Client finished, 73/120 resources updated in 25 seconds
Finished converging <default-ubuntu-1804> (0m40.61s).
-----> Kitchen is finished. (0m51.65s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment