cookbook 'icinga2_api', '~> 1.0.3'
icinga2_api (14) Versions 1.0.3 Follow1
Chef LWRPs to interact with Icinga2 API
cookbook 'icinga2_api', '~> 1.0.3', :supermarket
knife supermarket install icinga2_api
knife supermarket download icinga2_api
icinga2_api Cookbook
Created by gh-md-toc
Description
Chef cookbook with LWRPs used to interact with icinga2 API.
Requirements
Cookbooks
Chef
- Chef 12 or higher
Platforms
- Debian => 6
- Ubuntu => 14.04
- RHEL => 6
Notes: This cookbook has been tested on the listed platforms. It may work on other platforms with or without modification.
Recipes
- 
default- installing icinga2 gem for LWRPs.
Usage
The main use case is to create icinga2 objects on the node bootstrap time. Thus you don't need to create any autodiscovery tools that will describe all nodes in icinga2 setup.
Please refer to integration cookbook for examples.
icinga2_api_host
LWRP host creates an icinga Host object.
LWRP Environment Host example
# Set connection to icinga2 API
icinga2_api = {
    host: '127.0.0.1',
    username: 'admin',
    password: 'mysecret',
    node_name: 'master',
    cluster: true,
    satellite: 'master',
}
icinga2_api_host 'host1' do
  attributes 'address' => '127.0.0.1',
         'templates' => ['check-host-tmpl-30s'],
         'vars' => {
        'myvar' => 'mygroup',
          }
  connection icinga2_api
end
LWRP Options
- name (name_attribute, String) - chef resource name and icinga2 host name.
- attributes (optional, Hash) - icinga2 host object attributes.
- connection (optional, Hash) - icinga2 API connection settings.
- action (optional) - options: [:create, :delete], default :create.
icinga2_api_service
LWRP service creates an icinga Service object.
LWRP Environment Service example
# Set connection to icinga2 API
icinga2_api = {
    host: '127.0.0.1',
    username: 'admin',
    password: 'mysecret',
    node_name: 'master',
    cluster: true,
    satellite: 'master',
}
icinga2_api_service 'host1_ping1' do
  host_name 'host1'
  attributes 'templates' => ['check-service-tmpl-30s'],
             'display_name' => 'PING1',
             'check_command' => 'hostalive'
  connection icinga2_api
end
LWRP Options
- name (name_attribute, String) - chef resource name and icinga2 service name. Should be unique in icinga2 setup.
- host_name (required, Hash) - icinga2 host name object attributes.
- attributes (optional, Hash) - icinga2 service object attributes.
- connection (optional, Hash) - icinga2 API connection settings.
- action (optional) - options: [:create, :delete], default :create.
License & Authors
- Author:: Andrei Skopenko andrei@skopenko.net
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
| build-essential >= 0.0.0 | 
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
icinga2_api CHANGELOG
1.0.3 (2018-04-5)
- Add cascade:true for removing host/service
1.0.2 (2018-04-3)
- Improve removing host object
1.0.1 (2018-03-26)
- Decrease debuging
- Support strings/symbols in arguments
1.0.0 (2018-03-23)
- Switch to the new style custom resource
0.3.1 (2018-03-20)
- Fix build-essential setup
0.3.0 (2018-03-08)
- Fix API calls
- Update teskitchen env
0.2.1 (2017-11-21)
- Fix docs
0.2.0 (2017-11-21)
- Add icinga2_api_service LWRP
- Update docs
0.1.5 (2017-11-19)
- Add TESTING.md
- Add CONTRIBUTING.md
0.1.4 (2017-11-17)
- Fix readme
0.1.3 (2017-11-17)
- Fix rubocop
- Update email info
0.1.2 (2017-11-17)
- Fix integration tests
- Add build-essential dep
0.1.1 (2017-11-16)
- Update docs
0.1.0 (2017-11-16)
- Initial release
Collaborator Number Metric
        
            1.0.3 failed this metric
            Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
        
      Contributing File Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
        
      Foodcritic Metric
        
            1.0.3 failed this metric
            FC066: Ensure chef_version is set in metadata: icinga2_api/metadata.rb:1
FC117: Do not use kind_of in custom resource properties: icinga2_api/resources/service.rb:23
FC121: Cookbook depends on cookbook made obsolete by Chef 14: icinga2_api/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: icinga2_api/recipes/default.rb:21
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
        
      No Binaries Metric
        
            1.0.3 passed this metric
        
      Testing File Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
1.0.3 failed this metric
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
        
            1.0.3 failed this metric
            FC066: Ensure chef_version is set in metadata: icinga2_api/metadata.rb:1
FC117: Do not use kind_of in custom resource properties: icinga2_api/resources/service.rb:23
FC121: Cookbook depends on cookbook made obsolete by Chef 14: icinga2_api/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: icinga2_api/recipes/default.rb:21
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
        
      No Binaries Metric
        
            1.0.3 passed this metric
        
      Testing File Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
1.0.3 failed this metric
FC117: Do not use kind_of in custom resource properties: icinga2_api/resources/service.rb:23
FC121: Cookbook depends on cookbook made obsolete by Chef 14: icinga2_api/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: icinga2_api/recipes/default.rb:21
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
            1.0.3 passed this metric
        
      Testing File Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
1.0.3 failed this metric
            1.0.3 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
