Merge "Make BlockStorage deployment dependent on controller0AllNodes"
[apex-tripleo-heat-templates.git] / nagios3.yaml
1 # Copyright 2014 Hewlett-Packard Development Company, L.P.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14 #
15 heat_template_version: 2013-05-23
16 description: Deploy Nagios
17 parameters:
18   adm_web_passwd:
19     type: string
20     description: Password for initial admin user
21     hidden: true
22   nova_os_auth_url:
23     type: string
24     default: ''
25     description: URL for Keystone to access Nova.
26   nova_os_password:
27     type: string
28     hidden: true
29     description: password to present to nova_host_ip.
30     default: ''
31   nova_os_username:
32     type: string
33     description: username to present to nova_host_ip.
34     default: ''
35   nova_os_tenant_name:
36     type: string
37     description: tenant name to present to nova_host_ip.
38     default: ''
39   monitor_networks:
40     type: json
41     description: Neutron networks to monitor.
42     default: []
43   image:
44     type: string
45     description: Image for Nagios.
46     default: nagios
47   server_network:
48     type: string
49     description: Network id for server.
50     default: default-net
51   external_network:
52     type: string
53     description: Network to attach floating ips to.
54     default: ext-net
55   flavor:
56     type: string
57     description: What flavor to use for the nagios server.
58     default: m1.small
59   key_name:
60     type: string
61     description: What Nova SSH key to use for the nagios server.
62     default: default
63 resources:
64   nagios_config:
65     type: OS::Heat::StructuredConfig
66     properties:
67       config:
68         nagios3:
69           adm_web_passwd: { get_input: adm_web_passwd }
70           os_auth_url: { get_input: nova_os_auth_url }
71           os_password: { get_input: nova_os_password }
72           os_username: { get_input: nova_os_username }
73           os_tenant_name: { get_input: nova_os_tenant_name }
74           monitor_networks: { get_input: monitor_networks }
75         completion-signal: { get_input: deploy_signal_id }
76   nagios_security_group:
77     type: OS::Neutron::SecurityGroup
78     properties:
79       name: monitoring
80       rules:
81         - direction: ingress
82           port_range_max: 22
83           port_range_min: 22
84           protocol: tcp
85         - direction: ingress
86           port_range_max: 80
87           port_range_min: 80
88           protocol: tcp
89         - direction: ingress
90           protocol: icmp
91         - direction: egress
92           protocol: tcp
93         - direction: egress
94           protocol: udp
95         - direction: egress
96           protocol: icmp
97   nagios_net_port:
98     type: OS::Neutron::Port
99     properties:
100       network_id: { get_param: server_network }
101       security_groups: [ { get_resource: nagios_security_group } ]
102   nagios_server:
103     type: OS::Nova::Server
104     properties:
105       flavor: { get_param: flavor }
106       image: { get_param: image }
107       key_name: { get_param: key_name }
108       user_data_format: SOFTWARE_CONFIG
109       networks:
110         - network: { get_param: server_network }
111           port: { get_resource: nagios_net_port }
112   nagios_floating_ip:
113     type: OS::Neutron::FloatingIP
114     properties:
115       floating_network_id: { get_param: external_network }
116       port_id: { get_resource: nagios_net_port }
117   nagios_deploy:
118     type: OS::Heat::StructuredDeployment
119     properties:
120       server: { get_resource: nagios_server }
121       config: { get_resource: nagios_config }
122       input_values:
123         adm_web_passwd: { get_param: adm_web_passwd }
124         nova_os_auth_url: { get_param: nova_os_auth_url }
125         nova_os_password: { get_param: nova_os_password }
126         nova_os_username: { get_param: nova_os_username }
127         nova_os_tenant_name: { get_param: nova_os_tenant_name }
128         monitor_networks: { get_param: monitor_networks }
129 outputs:
130   nagios_address:
131     description: Address of Nagios admin interface.
132     value: { get_attr: [ nagios_floating_ip, floating_ip_address ] }