first commit
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
new file mode 100644
index 0000000..5a075fb
--- /dev/null
+++ b/CHANGELOG.rst
@@ -0,0 +1,6 @@
+gerrit formula
+=========================================
+
+0.1 (2015-08-22)
+
+- Initial formula setup
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6f2b42f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2014-2015 tcp cloud a.s.
+
+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.
\ No newline at end of file
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..35cc392
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,23 @@
+
+==================================
+gerrit
+==================================
+
+Service gerrit description
+
+Sample pillars
+==============
+
+Single gerrit service
+
+.. code-block:: yaml
+
+ gerrit:
+ server:
+ enabled: true
+ version: icehouse
+
+Read more
+=========
+
+* links
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..49d5957
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..029e1ee
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+salt-formula-gerrit (0.1) trusty; urgency=medium
+
+ * Initial release
+
+ -- Ales Komarek <ales.komarek@tcpcloud.eu> Thu, 13 Aug 2015 23:23:41 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..3f726d9
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,15 @@
+Source: salt-formula-gerrit
+Maintainer: Ales Komarek <ales.komarek@tcpcloud.eu>
+Section: admin
+Priority: optional
+Build-Depends: debhelper (>= 9)
+Standards-Version: 3.9.6
+Homepage: http://www.tcpcloud.eu
+Vcs-Browser: https://github.com/tcpcloud/salt-formula-gerrit
+Vcs-Git: https://github.com/tcpcloud/salt-formula-gerrit.git
+
+Package: salt-formula-gerrit
+Architecture: all
+Depends: ${misc:Depends}, salt-master, reclass
+Description: gerrit salt formula
+ Install and configure gerrit system.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..7da50f7
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,15 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: salt-formula-gerrit
+Upstream-Contact:
+Source: https://github.com/tcpcloud/salt-formula-gerrit
+
+Files: *
+Copyright: 2014-2015 tcp cloud a.s.
+License: Apache-2.0
+ Copyright (C) 2014-2015 tcp cloud a.s.
+ .
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ .
+ On a Debian system you can find a copy of this license in
+ /usr/share/common-licenses/Apache-2.0.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..d585829
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+README.rst
+CHANGELOG.rst
+VERSION
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..a015c7d
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,6 @@
+gerrit/* /usr/share/salt-formulas/env/gerrit/
+metadata/service/* /usr/share/salt-formulas/reclass/service/gerrit/
+# Not all salt formulas has custom states and modules,
+# uncomment to install them
+# _modules/* /usr/share/salt-formulas/env/_modules/
+# _states/* /usr/share/salt-formulas/env/_states/
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..abde6ef
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,5 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/gerrit/files/gerrit.conf b/gerrit/files/gerrit.conf
new file mode 100644
index 0000000..44e3449
--- /dev/null
+++ b/gerrit/files/gerrit.conf
@@ -0,0 +1 @@
+# Service config file
\ No newline at end of file
diff --git a/gerrit/init.sls b/gerrit/init.sls
new file mode 100644
index 0000000..0fb21bf
--- /dev/null
+++ b/gerrit/init.sls
@@ -0,0 +1,6 @@
+{%- if pillar.gerrit is defined %}
+include:
+{%- if pillar.gerrit.server is defined %}
+- gerrit.server
+{%- endif %}
+{%- endif %}
diff --git a/gerrit/map.jinja b/gerrit/map.jinja
new file mode 100644
index 0000000..20ba4d6
--- /dev/null
+++ b/gerrit/map.jinja
@@ -0,0 +1,29 @@
+
+{%- set source_engine = salt['pillar.get']('gerrit:server:source:engine') %}
+
+{%- load_yaml as base_defaults %}
+{%- if source_engine == 'git' %}
+Debian:
+ pkgs:
+ - python-psycopg2
+ dir:
+ base: /srv/gerrit/venv
+ home: /var/lib/gerrit
+ workspace: /srv/gerrit/workspace
+RedHat:
+ pkgs:
+ - python-psycopg2
+ dir:
+ base: /srv/gerrit/venv
+ home: /var/lib/gerrit
+ workspace: /srv/gerrit/workspace
+{%- else %}
+Debian:
+ pkgs:
+ - gerrit
+ dir:
+ base: /usr/lib/gerrit
+{%- endif %}
+{%- endload %}
+
+{%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('gerrit:server')) %}
\ No newline at end of file
diff --git a/gerrit/meta/sensu.yml b/gerrit/meta/sensu.yml
new file mode 100644
index 0000000..65992d5
--- /dev/null
+++ b/gerrit/meta/sensu.yml
@@ -0,0 +1,8 @@
+# Sample check
+check:
+ local_gerrit_proc:
+ command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C gerrit -u gerrit -c 1:1"
+ interval: 60
+ occurrences: 1
+ subscribers:
+ - local-gerrit-server
diff --git a/gerrit/meta/sphinx.yml b/gerrit/meta/sphinx.yml
new file mode 100644
index 0000000..f3ce10a
--- /dev/null
+++ b/gerrit/meta/sphinx.yml
@@ -0,0 +1,12 @@
+{%- from "gerrit/map.jinja" import server with context %}
+# Fill in documentation details
+doc:
+ name: gerrit
+ description: Some service info
+ role:
+ server:
+ name: server
+ param:
+ some_param:
+ name: "Some name"
+ value: "some value"
diff --git a/gerrit/server.sls b/gerrit/server.sls
new file mode 100644
index 0000000..9ae5a81
--- /dev/null
+++ b/gerrit/server.sls
@@ -0,0 +1,4 @@
+{%- from "gerrit/map.jinja" import server with context %}
+{%- if server.enabled %}
+
+{%- endif %}
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
new file mode 100644
index 0000000..8da8a38
--- /dev/null
+++ b/metadata/service/server/cluster.yml
@@ -0,0 +1,10 @@
+applications:
+- gerrit
+classes:
+- service.gerrit.support
+parameters:
+ gerrit:
+ server:
+ enabled: true
+ bind:
+ address: 0.0.0.0
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
new file mode 100644
index 0000000..8da8a38
--- /dev/null
+++ b/metadata/service/server/single.yml
@@ -0,0 +1,10 @@
+applications:
+- gerrit
+classes:
+- service.gerrit.support
+parameters:
+ gerrit:
+ server:
+ enabled: true
+ bind:
+ address: 0.0.0.0
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
new file mode 100644
index 0000000..1642ff2
--- /dev/null
+++ b/metadata/service/support.yml
@@ -0,0 +1,11 @@
+parameters:
+ gerrit:
+ _support:
+ collectd:
+ enabled: false
+ heka:
+ enabled: false
+ sensu:
+ enabled: false
+ sphinx:
+ enabled: true