Add Aodh configs for rocky and update kitchen

Change-Id: Ieca4a1f16aa3715554cba4f953b1d85bda123c16
Related-Prod: PROD-23721 (PROD:23721)
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..5218fbb
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.mcp.mirantis.com
+port=29418
+project=salt-formulas/aodh.git
+
diff --git a/.kitchen.yml b/.kitchen.yml
index 1d34f62..a1a7ae9 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -21,6 +21,9 @@
     - name: apache
       repo: git
       source: https://gerrit.mcp.mirantis.com/salt-formulas/apache
+    - name: oslo_templates
+      repo: git
+      source: https://gerrit.mcp.mirantis.com/salt-formulas/oslo-templates
   state_top:
     base:
       "*":
@@ -88,59 +91,36 @@
       platform: ubuntu
 
 suites:
-
-  - name: server_cluster_ocata
+<% for os_version in ['ocata','pike','queens','rocky'] %>
+  - name: server_cluster_<%=os_version%>
     provisioner:
       pillars:
         release.sls:
           aodh:
             server:
-              version: ocata
+              version: <%=os_version%>
       pillars-from-files:
         aodh.sls: tests/pillar/server_cluster.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_ocata.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
 
-  - name: server_cluster_pike
+  - name: server_single_<%=os_version%>
     provisioner:
       pillars:
         release.sls:
           aodh:
             server:
-              version: pike
-      pillars-from-files:
-        aodh.sls: tests/pillar/server_cluster.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
-
-  - name: server_single_ocata
-    provisioner:
-      pillars:
-        release.sls:
-          aodh:
-            server:
-              version: ocata
+              version: <%=os_version%>
       pillars-from-files:
         aodh.sls: tests/pillar/server_single.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_ocata.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
 
-  - name: server_single_pike
+  - name: server_cluster_ssl_<%=os_version%>
     provisioner:
       pillars:
         release.sls:
           aodh:
             server:
-              version: pike
-      pillars-from-files:
-        aodh.sls: tests/pillar/server_single.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
-
-
-  - name: server_cluster_ssl_pike
-    provisioner:
-      pillars:
-        release.sls:
-          aodh:
-            server:
-              version: pike
+              version: <%=os_version%>
         top.sls:
           base:
             "*":
@@ -150,15 +130,15 @@
               - ssl
       pillars-from-files:
         aodh.sls: tests/pillar/server_cluster.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
 
-  - name: server_single_ssl_pike
+  - name: server_single_ssl_<%=os_version%>
     provisioner:
       pillars:
         release.sls:
           aodh:
             server:
-              version: pike
+              version: <%=os_version%>
         top.sls:
           base:
             "*":
@@ -168,6 +148,6 @@
               - ssl
       pillars-from-files:
         aodh.sls: tests/pillar/server_single.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
-
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
+<% end %>
 # vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/aodh/files/rocky/aodh.conf.Debian b/aodh/files/rocky/aodh.conf.Debian
new file mode 100644
index 0000000..ef79a30
--- /dev/null
+++ b/aodh/files/rocky/aodh.conf.Debian
@@ -0,0 +1,268 @@
+{%- from "aodh/map.jinja" import server with context -%}
+[DEFAULT]
+
+#
+# From aodh
+#
+
+# Record alarm change events. (boolean value)
+#record_history = true
+
+# TTL of event alarm caches, in seconds. Set to 0 to disable caching. (integer
+# value)
+#event_alarm_cache_ttl = 60
+
+# The number of seconds to extend the evaluation windows to compensate the
+# reporting/ingestion lag. (integer value)
+# Minimum value: 0
+#additional_ingestion_lag = 0
+
+# SSL Client certificate file for REST notifier. (string value)
+#rest_notifier_certificate_file =
+
+# SSL Client private key file for REST notifier. (string value)
+#rest_notifier_certificate_key =
+
+# SSL CA_BUNDLE certificate for REST notifier (string value)
+#rest_notifier_ca_bundle_certificate_path = <None>
+
+# Whether to verify the SSL Server certificate when calling alarm action.
+# (boolean value)
+#rest_notifier_ssl_verify = true
+
+# Number of retries for REST notifier (integer value)
+#rest_notifier_max_retries = 0
+
+# The topic that aodh uses for alarm notifier messages. (string value)
+#notifier_topic = alarming
+
+# Timeout seconds for HTTP requests. Set it to None to disable timeout.
+# (integer value)
+#http_timeout = 600
+
+# Period of evaluation cycle, should be >= than configured pipeline interval
+# for collection of underlying meters. (integer value)
+#evaluation_interval = 60
+
+{%- set _data = server.message_queue %}
+{%- include "oslo_templates/files/rocky/oslo/messaging/_default.conf" %}
+
+{%- if server.logging is defined %}
+{%- set _data = server.logging %}
+{%- include "oslo_templates/files/rocky/oslo/_log.conf" %}
+{%- endif %}
+
+[api]
+
+#
+# From aodh
+#
+
+port = {{ server.bind.port }}
+
+host = {{ server.bind.host }}
+
+# Configuration file for WSGI definition of API. (string value)
+#paste_config = /build/aodh-rFNLA3/aodh-7.0.0/aodh/api/api-paste.ini
+
+# Authentication mode to use. Unset to disable authentication (string value)
+#auth_mode = keystone
+
+# Project name of resources creator in Gnocchi. (For example the Ceilometer
+# project name (string value)
+#gnocchi_external_project_owner = service
+
+# Domain name of resources creator in Gnocchi. (For example, default or
+# service_domain (string value)
+#gnocchi_external_domain_name = Default
+
+# Maximum number of alarms defined for a user. (integer value)
+#user_alarm_quota = <None>
+
+# Maximum number of alarms defined for a project. (integer value)
+#project_alarm_quota = <None>
+
+# Maximum count of actions for each state of an alarm, non-positive number
+# means no limit. (integer value)
+#alarm_max_actions = -1
+
+
+[coordination]
+
+#
+# From aodh
+#
+
+# The backend URL to use for distributed coordination. If left empty, alarm
+# evaluation won't do workload partitioning and will only function correctly if
+# a single instance of the service is running. (string value)
+#backend_url = <None>
+{%- if server.coordination_backend is defined %}
+backend_url = {{ server.coordination_backend.url }}
+{%-  endif %}
+
+# Number of seconds between heartbeats for distributed coordination. (floating
+# point value)
+#heartbeat = 1.0
+
+# Number of seconds between checks to see if group membership has changed
+# (floating point value)
+#check_watchers = 10.0
+
+# Retry backoff factor when retrying to connect with coordination backend
+# (integer value)
+#retry_backoff = 1
+
+# Maximum number of seconds between retry to join partitioning group (integer
+# value)
+#max_retry_interval = 30
+
+
+[database]
+
+#
+# From aodh
+#
+
+# Number of seconds that alarm histories are kept in the database for (<= 0
+# means forever). (integer value)
+#alarm_history_time_to_live = -1
+alarm_history_time_to_live = {{ server.ttl }}
+
+{%- set _data = server.database %}
+{%- if _data.ssl is defined and 'cacert_file' not in _data.get('ssl', {}).keys() %}{% do _data['ssl'].update({'cacert_file': server.cacert_file}) %}{% endif %}
+{%- include "oslo_templates/files/rocky/oslo/_database.conf" %}
+
+
+[evaluator]
+
+#
+# From aodh
+#
+
+# Number of workers for evaluator service. default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+
+[listener]
+
+#
+# From aodh
+#
+
+# Number of workers for listener service. default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+# The topic that aodh uses for event alarm evaluation. (string value)
+#event_alarm_topic = alarm.all
+
+# Number of notification messages to wait before dispatching them. (integer
+# value)
+#batch_size = 1
+
+# Number of seconds to wait before dispatching samples when batch_size is not
+# reached (None means indefinitely). (integer value)
+#batch_timeout = <None>
+
+
+[notifier]
+
+#
+# From aodh
+#
+
+# Number of workers for notifier service. default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+# Number of notification messages to wait before dispatching them. (integer
+# value)
+#batch_size = 1
+
+# Number of seconds to wait before dispatching samples when batch_size is not
+# reached (None means indefinitely). (integer value)
+#batch_timeout = <None>
+
+
+[service_credentials]
+
+#
+# From aodh
+#
+
+# Region name to use for OpenStack service endpoints. (string value)
+# Deprecated group/name - [service_credentials]/os_region_name
+#region_name = <None>
+
+# Type of endpoint in Identity service catalog to use for communication with
+# OpenStack services. (string value)
+# Possible values:
+# public - <No description provided>
+# internal - <No description provided>
+# admin - <No description provided>
+# auth - <No description provided>
+# publicURL - <No description provided>
+# internalURL - <No description provided>
+# adminURL - <No description provided>
+# Deprecated group/name - [service_credentials]/os_endpoint_type
+#interface = public
+
+#
+# From aodh-auth
+#
+
+{%- set _data = server.identity %}
+{%- if 'cacert_file' not in _data.keys() %}{% do _data.update({'cacert_file': server.cacert_file}) %}{% endif %}
+{%- set auth_type = _data.get('auth_type', 'password') %}
+{%- include "oslo_templates/files/rocky/keystoneauth/_type_" + auth_type + ".conf" %}
+
+[service_types]
+
+#
+# From aodh
+#
+
+# Message queue service type. (string value)
+#zaqar = messaging
+
+[cors]
+{%- if server.cors is defined %}
+{%- set _data = server.cors %}
+{%- include "oslo_templates/files/rocky/oslo/_cors.conf" %}
+{%- endif %}
+
+[oslo_middleware]
+{%- set _data = server %}
+{%- include "oslo_templates/files/rocky/oslo/_middleware.conf" %}
+
+[healthcheck]
+{%- include "oslo_templates/files/rocky/oslo/_healthcheck.conf" %}
+
+{%- if server.message_queue is defined %}
+{%- set _data = server.message_queue %}
+{%- if _data.engine == 'rabbitmq' %}
+    {%- set messaging_engine = 'rabbit' %}
+{%- else %}
+    {%- set messaging_engine = _data.engine %}
+{%- endif %}
+[oslo_messaging_{{ messaging_engine }}]
+{%- if _data.ssl is defined and 'cacert_file' not in _data.get('ssl', {}).keys() %}{% do _data['ssl'].update({'cacert_file': server.cacert_file}) %}{% endif %}
+{%- include "oslo_templates/files/rocky/oslo/messaging/_" + messaging_engine + ".conf" %}
+{%- endif %}
+
+[oslo_policy]
+{%- if server.oslo_policy is defined %}
+{%- set _data = server.oslo_policy %}
+{%- include "oslo_templates/files/rocky/oslo/_policy.conf" %}
+{%- endif %}
+
+[keystone_authtoken]
+{%- set _data = server.identity %}
+{%- set auth_type = _data.get('auth_type', 'password') %}
+{%- if server.get('cache',{}).members is defined and 'cache' not in _data.keys() %}
+{% do _data.update({'cache': server.cache}) %}
+{%- endif %}
+{%- include "oslo_templates/files/rocky/keystonemiddleware/_auth_token.conf" %}
+{%- include "oslo_templates/files/rocky/keystoneauth/_type_" + auth_type + ".conf" %}
diff --git a/aodh/files/rocky/apache-aodh.apache2.conf.Debian b/aodh/files/rocky/apache-aodh.apache2.conf.Debian
new file mode 100644
index 0000000..2bc4ee1
--- /dev/null
+++ b/aodh/files/rocky/apache-aodh.apache2.conf.Debian
@@ -0,0 +1,14 @@
+{%- from "aodh/map.jinja" import server with context %}
+Listen {{ server.bind.host }}:{{ server.bind.port }}
+
+<VirtualHost *:{{ server.bind.port }}>
+    WSGIDaemonProcess aodh-api processes=2 threads=10 user=aodh group=aodh display-name=%{GROUP}
+    WSGIProcessGroup aodh-api
+    WSGIScriptAlias / /usr/share/aodh/app.wsgi
+    WSGIApplicationGroup %{GLOBAL}
+    <IfVersion >= 2.4>
+        ErrorLogFormat "%{cu}t %M"
+    </IfVersion>
+    ErrorLog /var/log/apache2/aodh_error.log
+    CustomLog /var/log/apache2/aodh_access.log "%v:%p %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\""
+</VirtualHost>
diff --git a/tests/pillar/repo_mcp_openstack_queens.sls b/tests/pillar/repo_mcp_openstack_queens.sls
new file mode 100644
index 0000000..a8c7e77
--- /dev/null
+++ b/tests/pillar/repo_mcp_openstack_queens.sls
@@ -0,0 +1,12 @@
+linux:
+  system:
+    enabled: true
+    repo:
+      mirantis_openstack_repo:
+        source: "deb http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }} {{ grains.get('oscodename') }} main"
+        architectures: amd64
+        key_url: "http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }}/archive-queens.key"
+        pin:
+        - pin: 'release l=queens'
+          priority: 1050
+          package: '*'
\ No newline at end of file
diff --git a/tests/pillar/repo_mcp_openstack_rocky.sls b/tests/pillar/repo_mcp_openstack_rocky.sls
new file mode 100644
index 0000000..026ac5c
--- /dev/null
+++ b/tests/pillar/repo_mcp_openstack_rocky.sls
@@ -0,0 +1,12 @@
+linux:
+  system:
+    enabled: true
+    repo:
+      mirantis_openstack_repo:
+        source: "deb http://mirror.mirantis.com/nightly/openstack-rocky/{{ grains.get('oscodename') }} {{ grains.get('oscodename') }} main"
+        architectures: amd64
+        key_url: "http://mirror.mirantis.com/nightly/openstack-rocky/{{ grains.get('oscodename') }}/archive-openstack-rocky.key"
+        pin:
+        - pin: 'release l=rocky'
+          priority: 1050
+          package: '*'
\ No newline at end of file