aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/salt-formula-quagga
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/salt-formulas/salt-formula-quagga')
-rw-r--r--mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml12
-rw-r--r--mcp/salt-formulas/salt-formula-quagga/quagga/init.sls11
-rw-r--r--mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja21
-rw-r--r--mcp/salt-formulas/salt-formula-quagga/quagga/server.sls41
4 files changed, 85 insertions, 0 deletions
diff --git a/mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml b/mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml
new file mode 100644
index 000000000..2eeca6760
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+parameters:
+ quagga:
+ server:
+ enabled: true
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/init.sls b/mcp/salt-formulas/salt-formula-quagga/quagga/init.sls
new file mode 100644
index 000000000..810809d77
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-quagga/quagga/init.sls
@@ -0,0 +1,11 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+include:
+{%- if pillar.quagga.server is defined %}
+- quagga.server
+{%- endif %}
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja b/mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja
new file mode 100644
index 000000000..a76c760d9
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja
@@ -0,0 +1,21 @@
+{#-
+ Copyright (c) 2018 Intracom Telecom and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Apache License, Version 2.0
+ which accompanies this distribution, and is available at
+ http://www.apache.org/licenses/LICENSE-2.0
+-#}
+{% set server = salt['grains.filter_by']({
+ 'Debian': {
+ 'pkgs': ['libglib2.0-0'],
+ 'quagga_package_url': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-ubuntu.tar.gz',
+ 'quagga_package_checksum': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-ubuntu.checksum',
+ 'install_cmd': 'dpkg -i'
+ },
+ 'RedHat': {
+ 'pkgs': ['glib2', 'glib2-devel'],
+ 'quagga_package_url': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-4.tar.gz',
+ 'quagga_package_checksum': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-4.checksum',
+ 'install_cmd': 'yum -y'
+ },
+}, merge=salt['pillar.get']('quagga:server')) %}
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/server.sls b/mcp/salt-formulas/salt-formula-quagga/quagga/server.sls
new file mode 100644
index 000000000..3a9c32906
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-quagga/quagga/server.sls
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- from "quagga/map.jinja" import server with context %}
+{%- if server.enabled %}
+
+quagga_packages:
+ pkg.installed:
+ - names: {{ server.pkgs }}
+
+download_quagga:
+ file.managed:
+ - name: /var/cache/quagga.tar.gz
+ - source: {{ server.quagga_package_url }}
+ - source_hash: {{ server.quagga_package_checksum }}
+ - user: root
+ - group: root
+
+unarchive_quagga:
+ archive.extracted:
+ - source: /var/cache/quagga.tar.gz
+ - name: /tmp
+ - user: root
+ - group: root
+
+install_quagga_packages:
+ cmd.run:
+ - name: {{ server.install_cmd }} $(ls |grep -vE 'debuginfo|devel|contrib')
+ - cwd: /tmp/quagga
+ - runas: root
+
+start_zebra_rpc_daemon:
+ cmd.run:
+ - name: /opt/quagga/etc/init.d/zrpcd start
+ - runas: root
+
+{%- endif %}