Allow 'ctlplane' to be used within Net IP Maps
[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   external_network:
23     type: string
24     description: Network to attach floating ips to.
25     default: ext-net
26   flavor:
27     type: string
28     description: What flavor to use for the nagios server.
29     default: m1.small
30   image:
31     type: string
32     description: Image for Nagios.
33     default: nagios
34   key_name:
35     type: string
36     description: What Nova SSH key to use for the nagios server.
37     default: default
38   monitor_networks:
39     type: json
40     description: Neutron networks to monitor.
41     default: []
42   nova_os_auth_url:
43     type: string
44     default: ''
45     description: URL for Keystone to access Nova.
46   nova_os_password:
47     type: string
48     hidden: true
49     description: password to present to nova_host_ip.
50     default: ''
51   nova_os_username:
52     type: string
53     description: username to present to nova_host_ip.
54     default: ''
55   nova_os_tenant_name:
56     type: string
57     description: tenant name to present to nova_host_ip.
58     default: ''
59   server_network:
60     type: string
61     description: Network id for server.
62     default: default-net
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       networks:
109         - network: { get_param: server_network }
110           port: { get_resource: nagios_net_port }
111       user_data_format: SOFTWARE_CONFIG
112       user_data: {get_resource: NodeUserData}
113
114   NodeUserData:
115     type: OS::TripleO::NodeUserData
116
117   nagios_floating_ip:
118     type: OS::Neutron::FloatingIP
119     properties:
120       floating_network_id: { get_param: external_network }
121       port_id: { get_resource: nagios_net_port }
122   nagios_deploy:
123     type: OS::Heat::StructuredDeployment
124     properties:
125       server: { get_resource: nagios_server }
126       config: { get_resource: nagios_config }
127       input_values:
128         adm_web_passwd: { get_param: adm_web_passwd }
129         nova_os_auth_url: { get_param: nova_os_auth_url }
130         nova_os_password: { get_param: nova_os_password }
131         nova_os_username: { get_param: nova_os_username }
132         nova_os_tenant_name: { get_param: nova_os_tenant_name }
133         monitor_networks: { get_param: monitor_networks }
134 outputs:
135   nagios_address:
136     description: Address of Nagios admin interface.
137     value: { get_attr: [ nagios_floating_ip, floating_ip_address ] }