diff options
Diffstat (limited to 'mcp/salt-formulas')
56 files changed, 723 insertions, 254 deletions
diff --git a/mcp/salt-formulas/maas/machines/delete.sls b/mcp/salt-formulas/maas/machines/delete.sls deleted file mode 100644 index 2903f9226..000000000 --- a/mcp/salt-formulas/maas/machines/delete.sls +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (c) 2017 Mirantis Inc., Enea AB 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 "maas/map.jinja" import region with context %} - -maas_login_admin: - cmd.run: - - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" - - unless: 'test -e /var/lib/maas/.maas_credentials' - -# TODO: implement delete_machine via _modules/maas.py -delete_machine: - cmd.run: - - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine delete {{ pillar['system_id'] }}" - - require: - - cmd: maas_login_admin diff --git a/mcp/salt-formulas/maas/machines/mark_broken_fixed.sls b/mcp/salt-formulas/maas/machines/mark_broken_fixed.sls deleted file mode 100644 index 46691bb09..000000000 --- a/mcp/salt-formulas/maas/machines/mark_broken_fixed.sls +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (c) 2017 Mirantis Inc., Enea AB 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 "maas/map.jinja" import region with context %} - -maas_login_admin: - cmd.run: - - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" - - unless: 'test -e /var/lib/maas/.maas_credentials' - -# TODO: implement mark_broken_fixed_machine via _modules/maas.py -mark_broken_fixed_machine: - cmd.run: - - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine mark-broken {{ pillar['system_id'] }} && sleep 10 && maas opnfv machine mark-fixed {{ pillar['system_id'] }} && maas opnfv machine test {{ pillar['system_id'] }} testing_scripts=fio" - - require: - - cmd: maas_login_admin diff --git a/mcp/salt-formulas/maas/machines/override_failed_testing.sls b/mcp/salt-formulas/maas/machines/override_failed_testing.sls deleted file mode 100644 index e7fe1d267..000000000 --- a/mcp/salt-formulas/maas/machines/override_failed_testing.sls +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Mirantis Inc., Enea AB 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 "maas/map.jinja" import region with context %} - -maas_login_admin: - cmd.run: - - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" - - unless: 'test -e /var/lib/maas/.maas_credentials' - -# TODO: implement override_failed_testing via _modules/maas.py -mark_broken_fixed_machine: - cmd.run: - - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine override-failed-testing {{ pillar['system_id'] }}" - - require: - - cmd: maas_login_admin diff --git a/mcp/salt-formulas/maas/machines/set_storage_layout.sls b/mcp/salt-formulas/maas/machines/set_storage_layout.sls deleted file mode 100644 index 0b7e37153..000000000 --- a/mcp/salt-formulas/maas/machines/set_storage_layout.sls +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Mirantis Inc., Enea AB 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 "maas/map.jinja" import region with context %} - -maas_login_admin: - cmd.run: - - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" - - unless: 'test -e /var/lib/maas/.maas_credentials' - -# TODO: implement set_storage_layout via _modules/maas.py -set_storage_layout: - cmd.run: - - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine set-storage-layout {{ pillar['system_id'] }} storage_layout={{ pillar['storage_layout'] | default('lvm') }} lv_size={{ pillar['lv_size'] | default('100%') }}" - - require: - - cmd: maas_login_admin diff --git a/mcp/salt-formulas/maas/pxe_nat.sls b/mcp/salt-formulas/maas/pxe_nat.sls deleted file mode 100644 index 701bae07a..000000000 --- a/mcp/salt-formulas/maas/pxe_nat.sls +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2017 Mirantis Inc., Enea AB 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 -############################################################################## -net.ipv4.ip_forward: - sysctl.present: - - value: 1 - -iptables_pxe_nat: - iptables.append: - - table: nat - - chain: POSTROUTING - - jump: MASQUERADE - - destination: 0/0 - - source: {{ salt['pillar.get']('_param:single_address') }}/24 - - save: True - -iptables_pxe_source: - iptables.append: - - table: filter - - chain: INPUT - - jump: ACCEPT - - destination: 0/0 - - source: {{ salt['pillar.get']('_param:single_address') }}/24 - - save: True - -iptables_pxe_destination: - iptables.append: - - table: filter - - chain: INPUT - - jump: ACCEPT - - destination: {{ salt['pillar.get']('_param:single_address') }}/24 - - source: 0/0 - - save: True diff --git a/mcp/salt-formulas/opendaylight/server.sls b/mcp/salt-formulas/opendaylight/server.sls deleted file mode 100644 index 51a4d9f95..000000000 --- a/mcp/salt-formulas/opendaylight/server.sls +++ /dev/null @@ -1,102 +0,0 @@ -############################################################################## -# Copyright (c) 2017 Mirantis Inc. 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 "opendaylight/map.jinja" import server with context %} -{% from "linux/map.jinja" import system with context %} - -{%- if server.enabled %} - -opendaylight_repo_key: - cmd.run: - - name: "apt-key adv --keyserver keyserver.ubuntu.com --recv 44C05248" -{%- if system.proxy is defined and system.proxy.keyserver is defined %} - - env: -{%- if system.proxy.keyserver.http is defined and grains['dns']['nameservers'][0] in system.proxy.keyserver.http %} - - http_proxy: {{ system.proxy.keyserver.http }} -{%- endif %} -{%- if system.proxy.keyserver.https is defined and grains['dns']['nameservers'][0] in system.proxy.keyserver.https %} - - https_proxy: {{ system.proxy.keyserver.https }} -{%- endif %} -{%- endif %} - -opendaylight_repo: - pkgrepo.managed: - # NOTE(armband): PPA handling behind proxy broken, define it explicitly - # https://github.com/saltstack/salt/pull/45224 - # - ppa: {{ server.repo }} - - human_name: opendaylight-ppa - - name: deb http://ppa.launchpad.net/odl-team/{{ server.version }}/ubuntu xenial main - - file: /etc/apt/sources.list.d/odl-team-ubuntu-{{ server.version }}-xenial.list - -opendaylight: - pkg.installed: - - require: - - pkgrepo: opendaylight_repo - - require_in: - - file: /opt/opendaylight/etc/jetty.xml - - file: /opt/opendaylight/bin/setenv - - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg - - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg - service.running: - - enable: true - - watch: - - file: /opt/opendaylight/etc/jetty.xml - - file: /opt/opendaylight/bin/setenv - - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg - - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg - -# TODO: use service.masked state once salt get updated to 2017.7.0+ -service.mask: - module.run: - - m_name: opendaylight - - require_in: - - pkg: opendaylight - -/opt/opendaylight/etc/jetty.xml: - file.managed: - - source: salt://opendaylight/files/jetty.xml - - template: jinja - - user: odl - - group: odl - -/opt/opendaylight/bin/setenv: - file.managed: - - source: salt://opendaylight/files/setenv.shell - - mode: 0755 - - use: - - file: /opt/opendaylight/etc/jetty.xml - -{% set features %} -{%- for f in server.karaf_features.itervalues() -%} -{{ f | join(',') }}{%- if not loop.last %},{%- endif %} -{%- endfor %} -{% endset %} - -/opt/opendaylight/etc/org.apache.karaf.features.cfg: - ini.options_present: - - sections: - featuresBoot: {{ features }} - -/opt/opendaylight/etc/org.ops4j.pax.web.cfg: - ini.options_present: - - sections: - org.ops4j.pax.web.listening.addresses: {{ server.odl_bind_ip }} - org.osgi.service.http.port: {{ server.odl_rest_port }} - -{%- if server.get('router_enabled', false) %} -/opt/opendaylight/etc/custom.properties: - ini.options_present: - - sections: - ovsdb.l3.fwd.enabled: 'yes' - ovsdb.of.version: 1.3 - - require: - - pkg: opendaylight - - watch_in: - - service: opendaylight -{%- endif %} - -{%- endif %} diff --git a/mcp/salt-formulas/opnfv/route_wrapper.sls b/mcp/salt-formulas/opnfv/route_wrapper.sls deleted file mode 100644 index 6132f317e..000000000 --- a/mcp/salt-formulas/opnfv/route_wrapper.sls +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Mirantis Inc., Enea AB 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 -############################################################################## -/usr/local/sbin/route: - file.managed: - - contents: | - #!/bin/sh - - # Workaround salt-managed routes breaking ifup when route already exists - route_binary='/sbin/route' - route_output=$("${route_binary}" "$@" 2>&1) - route_return=$? - - if [ -n "${route_output}" ]; then - if echo "${route_output}" | grep -q 'SIOCADDRT: File exists'; then - exit 0 - fi - echo "${route_output}" - fi - exit "${route_return}" - - user: root - - group: root - - mode: 755 diff --git a/mcp/salt-formulas/salt-formula-aodh b/mcp/salt-formulas/salt-formula-aodh new file mode 160000 +Subproject 858785a84cdbfb3add01158d40237af0d41e4b4 diff --git a/mcp/salt-formulas/salt-formula-apache b/mcp/salt-formulas/salt-formula-apache new file mode 160000 +Subproject 41d31d33354eeff85cd65b78fae0d5af274172b diff --git a/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff b/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff new file mode 100644 index 000000000..1ecbf2973 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff @@ -0,0 +1,27 @@ +From: Charalampos Kominos <Charalampos.Kominos@enea.com> +Date: Wed, 2 May 2018 14:20:47 +0200 +Subject: [PATCH] Allow libvirt to honor root device naming + +Current behaviour in upstream nova is for rootfs to be in /dev/vda +which is the default behaviour when using virtio driver. However when +other devices are requested either by glance or by CLI, nova ignores +that naming and still tries to attach to vda which fails. + +Manually applied in https://review.openstack.org/#/c/214314/ + +JIRA: ARMBAND-376 + +Signed-off-by: Charalampos Kominos <charalampos.kominos@enea.com> +--- + +--- a/nova/virt/libvirt/driver.py ++++ b/nova/virt/libvirt/driver.py +@@ -8257,6 +8257,8 @@ + "Ignoring supplied device name: %(device_name)s. " + "Libvirt can't honour user-supplied dev names", + {'device_name': bdm.device_name}, instance=instance) ++ if instance.root_device_name == bdm.device_name: ++ instance.root_device_name = None + bdm.device_name = None + block_device_info = driver.get_block_device_info(instance, + block_device_mapping) diff --git a/mcp/salt-formulas/salt-formula-armband/armband/init.sls b/mcp/salt-formulas/salt-formula-armband/armband/init.sls new file mode 100644 index 000000000..8a8cf2ab1 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/init.sls @@ -0,0 +1,7 @@ +include: + - armband.qemu_efi + - armband.vgabios + {%- if salt['pkg.version']('python-nova') %} + - armband.nova_libvirt + - armband.nova_config + {%- endif %} diff --git a/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls b/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls new file mode 100644 index 000000000..b0e17b718 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls @@ -0,0 +1,37 @@ +{% if grains['cpuarch'] == 'aarch64' %} +{% if grains['virtual'] == 'kvm' %} +nova_virt_type: + file.replace: + - name: "/etc/nova/nova.conf" + - pattern: '^virt_type\s*=.*$' + - repl: "virt_type = qemu" +nova_compute_virt_type: + file.replace: + - name: "/etc/nova/nova-compute.conf" + - pattern: '^virt_type\s*=.*$' + - repl: "virt_type = qemu" +{% endif %} +nova_pointer_model: + file.replace: + - name: "/etc/nova/nova.conf" + - pattern: '^#pointer_model\s*=.*$' + - repl: "pointer_model = ps2mouse" +nova_cpu_mode: + file.replace: + - name: "/etc/nova/nova.conf" + - pattern: '^cpu_mode\s*=\s*host-passthrough' + - repl: "cpu_mode = custom" +nova_cpu_model: + file.replace: + - name: "/etc/nova/nova.conf" + - pattern: '^#cpu_model\s*=.*$' + {% if grains['virtual'] == 'kvm' %} + - repl: "cpu_model = cortex-a57" + {% else %} + - repl: "cpu_model = host" + {% endif %} +restart_nova-compute: + cmd: + - run + - name: "service nova-compute restart" +{% endif %} diff --git a/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls b/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls new file mode 100644 index 000000000..9d26e86a4 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls @@ -0,0 +1,9 @@ +{% if grains['cpuarch'] == 'aarch64' %} +nova-libvirt-aarch64-rollup: + file.patch: + - name: /usr/lib/python2.7/dist-packages + - source: salt://armband/files/nova-libvirt-aarch64-rollup.diff + - hash: False + - options: '-p1' + - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run -r - < /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff' +{% endif %} diff --git a/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls b/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls new file mode 100644 index 000000000..aef17f9a8 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls @@ -0,0 +1,4 @@ +{% if grains['cpuarch'] == 'aarch64' %} +qemu-efi: + pkg.installed +{% endif %} diff --git a/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls b/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls new file mode 100644 index 000000000..7f004971c --- /dev/null +++ b/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls @@ -0,0 +1,9 @@ +{% if grains['cpuarch'] == 'aarch64' %} +vgabios: + pkg.installed +/usr/share/qemu: + file.directory +/usr/share/qemu/vgabios-stdvga.bin: + file.symlink: + - target: "/usr/share/vgabios/vgabios.bin" +{% endif %} diff --git a/mcp/salt-formulas/salt-formula-barbican b/mcp/salt-formulas/salt-formula-barbican new file mode 160000 +Subproject f70167cf8e99bdd72bcac7dbc946ec1655d5f31 diff --git a/mcp/salt-formulas/salt-formula-ceilometer b/mcp/salt-formulas/salt-formula-ceilometer new file mode 160000 +Subproject 7478c662b0a41671ebb76af936948d29e1a0448 diff --git a/mcp/salt-formulas/salt-formula-cinder b/mcp/salt-formulas/salt-formula-cinder new file mode 160000 +Subproject 57837bfba6427fd0d63afae332c724be5c3fa3b diff --git a/mcp/salt-formulas/salt-formula-etcd b/mcp/salt-formulas/salt-formula-etcd new file mode 160000 +Subproject b0c13fc3701045df3587d74d37bd947fd84dfda diff --git a/mcp/salt-formulas/salt-formula-glance b/mcp/salt-formulas/salt-formula-glance new file mode 160000 +Subproject bab584dc63874210c1bd3e42bcca8fd06d06ed3 diff --git a/mcp/salt-formulas/salt-formula-gnocchi b/mcp/salt-formulas/salt-formula-gnocchi new file mode 160000 +Subproject 0d4773a7dc87872dd28b3be0fc8a0a81cdaa864 diff --git a/mcp/salt-formulas/salt-formula-heat b/mcp/salt-formulas/salt-formula-heat new file mode 160000 +Subproject f1218e910d9bbf38c48b67e27cfa3c83024bbae diff --git a/mcp/salt-formulas/salt-formula-horizon b/mcp/salt-formulas/salt-formula-horizon new file mode 160000 +Subproject 116b93154b33bea17251b118e84c3eb47eb6893 diff --git a/mcp/salt-formulas/salt-formula-keystone b/mcp/salt-formulas/salt-formula-keystone new file mode 160000 +Subproject 196016fcaeb572108221933051b67568a52e80b diff --git a/mcp/salt-formulas/salt-formula-kubernetes b/mcp/salt-formulas/salt-formula-kubernetes new file mode 160000 +Subproject ffa16d06db002139aca3856b26539e54f17ed6d diff --git a/mcp/salt-formulas/salt-formula-linux b/mcp/salt-formulas/salt-formula-linux new file mode 160000 +Subproject a0d8b2d8b108bff351d6ed60ad427dcbdccc57d diff --git a/mcp/salt-formulas/salt-formula-maas b/mcp/salt-formulas/salt-formula-maas new file mode 160000 +Subproject decf41b9dd92ab23752b34c21e4f57dc780be33 diff --git a/mcp/salt-formulas/salt-formula-neutron b/mcp/salt-formulas/salt-formula-neutron new file mode 160000 +Subproject 7e623c0c660715f58ceaaf20e3d8620454c3977 diff --git a/mcp/salt-formulas/salt-formula-nfs b/mcp/salt-formulas/salt-formula-nfs new file mode 160000 +Subproject 5872d161e3ee149335932bfa364a437fdd367af diff --git a/mcp/salt-formulas/salt-formula-nova b/mcp/salt-formulas/salt-formula-nova new file mode 160000 +Subproject 60df8720a81b32f05885e3cbd49a4bb6e8960e2 diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml new file mode 100644 index 000000000..3554d786e --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml @@ -0,0 +1,60 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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 +############################################################################## +--- +applications: + - opendaylight +classes: + - service.keepalived.cluster.single + - service.haproxy.proxy.single +parameters: + _param: + opendaylight_version: neon + cluster_vip_address: ${_param:opendaylight_service_host} + keepalived_vip_virtual_router_id: 199 + keepalived_vip_password: ${_param:opnfv_main_password} + keepalived_vip_interface: ${_param:single_nic} + haproxy_odl_api_check_params: check inter 20s fastinter 2s + opendaylight: + server: + enabled: 'True' + version: ${_param:opendaylight_version} + repo: 'odl-team/${_param:opendaylight_version}' + cluster_enabled: true + keepalived: + cluster: + vrrp_scripts: + check_pidof: + args: haproxy + interval: 20 + rise: 3 + fall: 1 + instance: + VIP: + track_script: check_pidof + haproxy: + proxy: + listen: + opendaylight_api: + type: general-service + balance: source + binds: + - address: ${_param:opendaylight_service_host} + port: ${_param:opendaylight_rest_port} + servers: + - name: ${_param:opendaylight_server_node01_hostname} + host: ${_param:opendaylight_server_node01_address} + port: ${_param:opendaylight_rest_port} + params: ${_param:haproxy_odl_api_check_params} + - name: ${_param:opendaylight_server_node02_hostname} + host: ${_param:opendaylight_server_node02_address} + port: ${_param:opendaylight_rest_port} + params: ${_param:haproxy_odl_api_check_params} + - name: ${_param:opendaylight_server_node03_hostname} + host: ${_param:opendaylight_server_node03_address} + port: ${_param:opendaylight_rest_port} + params: ${_param:haproxy_odl_api_check_params} diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml new file mode 100644 index 000000000..36736be0a --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml @@ -0,0 +1,18 @@ +############################################################################## +# Copyright (c) 2017 Mirantis Inc. 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 +############################################################################## +--- +applications: + - opendaylight +parameters: + _param: + opendaylight_version: neon + opendaylight: + server: + enabled: 'True' + version: ${_param:opendaylight_version} + repo: 'odl-team/${_param:opendaylight_version}' diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml new file mode 100644 index 000000000..bbb204315 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml @@ -0,0 +1,19 @@ +############################################################################## +# Copyright (c) 2017 Mirantis Inc. 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: + opendaylight: + _support: + collectd: + enabled: false + heka: + enabled: false + sensu: + enabled: false + sphinx: + enabled: false diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls new file mode 100644 index 000000000..3f1f81348 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls @@ -0,0 +1,94 @@ +############################################################################## +# Copyright (c) 2019 Mirantis Inc. 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 "opendaylight/map.jinja" import server with context %} + +/opt/opendaylight/etc/jetty.xml: + file.managed: + - source: salt://opendaylight/files/jetty.xml + - template: jinja + - user: odl + - group: odl + +/opt/opendaylight/bin/setenv: + file.managed: + - source: salt://opendaylight/files/setenv.shell + - template: jinja + - mode: 0755 + - user: odl + - group: odl + +{%- set features = [] %} +{%- for f in server.karaf_features.itervalues() %} + {%- do features.extend(f) %} +{%- endfor %} + +/opt/opendaylight/etc/org.apache.karaf.features.cfg: + ini.options_present: + - sections: + featuresBoot: {{ features|join(',') }} + +/opt/opendaylight/etc/org.ops4j.pax.web.cfg: + ini.options_present: + - sections: + org.ops4j.pax.web.listening.addresses: {{ server.odl_bind_ip }} + org.osgi.service.http.port: {{ server.odl_rest_port }} + +{%- if not server.pax_logging_enabled|d(false) %} + {%- + set pax_logging_opts = [ + 'log4j2.rootLogger.appenderRef.PaxOsgi.ref', + 'log4j2.appender.osgi.type', + 'log4j2.appender.osgi.name', + 'log4j2.appender.osgi.filter' + ] + %} + + {%- for opt in pax_logging_opts %} +pax.logging.cfg.{{ opt }}: + file.comment: + - name: /opt/opendaylight/etc/org.ops4j.pax.logging.cfg + - regex: ^{{ opt }}\s*= + - backup: false + {%- endfor %} +{%- endif %} + +/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg: + file.managed: + - user: odl + - group: odl + ini.options_present: + - sections: + is-statistics-polling-on: {{ server.stats_polling_enabled }} + +{%- if server.get('router_enabled', false) %} +/opt/opendaylight/etc/custom.properties: + ini.options_present: + - sections: + ovsdb.l3.fwd.enabled: 'yes' + ovsdb.of.version: 1.3 +{%- endif %} + +{%- if server.netvirt_natservice is defined %} +/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml: + file.managed: + - source: salt://opendaylight/files/netvirt-natservice-config.xml + - template: jinja + - makedirs: true + - user: odl + - group: odl +{%- endif %} + +{%- if server.dhcp.enabled %} +/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml: + file.managed: + - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml + - template: jinja + - makedirs: true + - user: odl + - group: odl +{%- endif %} diff --git a/mcp/salt-formulas/opendaylight/files/jetty.xml b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml index de2ac677d..de2ac677d 100644 --- a/mcp/salt-formulas/opendaylight/files/jetty.xml +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml new file mode 100644 index 000000000..336957fd1 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml @@ -0,0 +1,23 @@ +{%- from "opendaylight/map.jinja" import server with context -%} +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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. +--> +<dhcpservice-config xmlns="urn:opendaylight:params:xml:ns:yang:dhcpservice:config"> + <controller-dhcp-enabled>{{ server.dhcp.enabled }}</controller-dhcp-enabled> + <dhcp-dynamic-allocation-pool-enabled>{{ server.dhcp.dynamic_allocation_pool_enabled }}</dhcp-dynamic-allocation-pool-enabled> +</dhcpservice-config> diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-natservice-config.xml b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-natservice-config.xml new file mode 100644 index 000000000..35994e51d --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-natservice-config.xml @@ -0,0 +1,23 @@ +{%- from "opendaylight/map.jinja" import server with context -%} +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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. +--> +<natservice-config xmlns="urn:opendaylight:netvirt:natservice:config"> + <nat-mode>{{ server.netvirt_natservice.nat_mode|d('controller') }}</nat-mode> + <snat-punt-timeout>{{ server.netvirt_natservice.snat_punt_timeout|d('5') }}</snat-punt-timeout> +</natservice-config> diff --git a/mcp/salt-formulas/opendaylight/files/setenv.shell b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell index 2921ade14..2921ade14 100644 --- a/mcp/salt-formulas/opendaylight/files/setenv.shell +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell diff --git a/mcp/salt-formulas/opendaylight/init.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls index 132f69b33..132f69b33 100644 --- a/mcp/salt-formulas/opendaylight/init.sls +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls diff --git a/mcp/salt-formulas/opendaylight/map.jinja b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja index 38575111e..44f2685d0 100644 --- a/mcp/salt-formulas/opendaylight/map.jinja +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja @@ -1,28 +1,33 @@ ############################################################################## -# Copyright (c) 2017 Mirantis Inc. and others. +# Copyright (c) 2019 Mirantis Inc. 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 pkgs = ['opendaylight'] %} +{%- do pkgs.append('opendaylight-leveldbjni') if grains['cpuarch'] == 'aarch64' %} + {% set server = salt['grains.filter_by']({ 'Debian': { + 'pkgs': pkgs, 'karaf_features': {'default': ['standard', 'wrap', 'ssh']}, 'odl_rest_port': '8282', 'odl_bind_ip': '0.0.0.0', 'repo': 'odl-team/oxygen', 'log_levels': {}, - 'enable_ha': false, - 'ha_node_ips': [], - 'ha_node_index': 0, + 'cluster_enabled': false, + 'seed_nodes_list': [], + 'stats_polling_enabled': false, + 'dhcp': { + 'enabled': false, + 'dynamic_allocation_pool_enabled': false, + }, 'security_group_mode': 'stateful', 'vpp_routing_node': '', 'java_extra_opts': '-Djava.net.preferIPv4Stack=true -XX:+UseG1GC', 'java_min_mem': '1g', 'java_max_mem': '2g', - }, - 'RedHat': { - 'repo': 'opendaylight-6-testing' - }, + } }, merge=salt['pillar.get']('opendaylight:server')) %} diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/repo.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/repo.sls new file mode 100644 index 000000000..1f322c53f --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/repo.sls @@ -0,0 +1,56 @@ +############################################################################## +# Copyright (c) 2019 Mirantis Inc. 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 "opendaylight/map.jinja" import server with context %} + +# NOTE: starting with Salt 2018.3, key_text might be used instead +opendaylight_repo_key: + # Launchpad PPA for ODL Team + # pub 4096R/44C05248 2017-01-26 + cmd.run: + - name: | + cat <<-EOF | sudo apt-key add - + -----BEGIN PGP PUBLIC KEY BLOCK----- + Version: GnuPG v1 + + mQINBFiKaBEBEADpCtIj8utf/bUfN6iQ+sxGiOPLnXVYoYyKifHDazD4o1Jevfiu + EpcDIx9EdnhrCpvKTU+jaw2B7K3pkdqbjbzjZY+2CDENSQXfRHuuI/nWDaYI0stx + Tf/evip3cxdutnZNAklzkxppHP+4UZm9HAd7uZsEyff4H9DIsHzZIA4Z++Hx2+lt + w9K0iCKh2k6Pon/VVo8Bir3JuKIIdLRAuHmyniYlHDswQnu+1nQHE0F/oboD0Q9Z + hOvXAr1L7LWu0hkLV7BqmeI0SPcRA3b5MU3dfaTK8MaPAo8anQTpCyYUnoIBqX8h + y324T/dvpFKq2/X3RL+wOSYTA8TLgyhH0fhdIKZg3G8m9kxuAHZYHIHnDtvgJ5yd + 72tNY+w8UIX8U2ark/WdkAMZr3O0AuTDlvHcasxO5+puAu8jh0EgtqItqrvKwiF7 + dmlHVW41Rt+su2fmsUkk4Z0IhWrn3PdrSWAcH2eL6vjuqx6CccpjsjyiSQ90dUox + EoMpY+viX59aF0kU4BLt76mQO6YZtCpicLxFGCu97v1mNn+FWjhBOIF08pVsbNlq + oMl2j0N8NKZxJvkkmsA/i//ch5FsjzvUy3xajlSzq9ruWS4SlWq2Vzdx/acvF7Oa + ABA11wIjzLc9vmhzQNiRa53fJQwi+w/Or9LtH2msKCbcPVHoZ5OT4t6S8QARAQAB + tBpMYXVuY2hwYWQgUFBBIGZvciBPREwgVGVhbYkCOAQTAQIAIgUCWIpoEQIbAwYL + CQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQe4qho0TAUkgAmg//XY/RqU4WcT+p + 13oDc3+Dp4aL+rwaNz0o56i0z0cYPxd8GPicCuS8d/di07GnQiBcZ5DZgegnnaYm + OUF+phxk4q+jYO/t2GHQlYSf/QyUv7OimidLOHN1FiahmcGobliwih70o6ZcMT84 + ggSu8jBzA/HLFBIkgStKD/staR5zJ2HfK298yVhiffyrPA+I3nPe7pvTaGa2e8AP + BYs5zB5n27upSZIokXFvqlmS4HEKDmPcY061wgmg1cNY1Y+mIuGjxY1Igbi6kAe0 + yaLN2AN4c2ImhpwOcuazKTe/q2ZhoPTpYvuzmogwau8LBjRBhVS6fkTpSBPEkcwn + f/QYmmVLygmpMDHuHapyH8iaUoksq7gd64iBRDJQN7giQSjkTVvcGBqoKG8lbUMV + MDT4FGuYYsObWUg7kmHlNq9nIVlAxmxv8ZTg9+8xy3f53aId/51m+gW9LGRAT94T + ZIWrF9cBvsPWoHgHkV1At/fPprOvNXqeQiJ7UzC3ikDNCu2AjPEbA4sb019RNgtj + jUI6g6RZdzbeKVpptxILCtT3yKbfKj8AfrfaRzS0yMhVudgLolIUA4S6g46p0Cgy + gITO49wxxBu6UAOsAG3psDRlsZmmrT4AH09Yt2RzmY0FBWValqpoPagheQqeU+2W + FKnV9Lw1SKMtWZbYMvIlB0rwts3k9lE= + =xkZ9 + -----END PGP PUBLIC KEY BLOCK----- + EOF + - unless: apt-key list | grep -qF '4096R/44C05248 2017-01-26' + +opendaylight_repo: + pkgrepo.managed: + # NOTE(armband): PPA handling behind proxy broken, define it explicitly + # https://github.com/saltstack/salt/pull/45224 + # - ppa: {{ server.repo }} + - human_name: opendaylight-ppa + - name: deb http://ppa.launchpad.net/{{ server.repo }}/ubuntu {{ grains.oscodename }} main + - file: /etc/apt/sources.list.d/odl-team-{{ server.version }}.list diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls new file mode 100644 index 000000000..6e31ffb3f --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls @@ -0,0 +1,51 @@ +############################################################################## +# Copyright (c) 2019 Mirantis Inc. 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 "opendaylight/map.jinja" import server with context %} + +{%- if server.enabled %} + +include: + - opendaylight.config + - opendaylight.repo + +{%- if grains['saltversioninfo'] < [2017, 7] %} +service.mask: + module.run: + - m_name: opendaylight +{%- else %} +opendaylight_service_mask: + service.masked: + - name: opendaylight +{%- endif %} + - prereq: + - pkg: opendaylight + +{%- if server.cluster_enabled %} +configure_cluster: + cmd.run: + - name: /opt/opendaylight/bin/configure-cluster-ipdetect.sh {{ server.seed_nodes_list }} + - require: + - pkg: opendaylight +{%- endif %} + +opendaylight: + pkg.installed: + - names: {{ server.pkgs }} + - require: + - sls: opendaylight.repo + - require_in: + - sls: opendaylight.config + service.running: + - enable: true +{%- if grains['saltversioninfo'] >= [2017, 7] %} + - unmask: true +{%- endif %} + - watch: + - sls: opendaylight.config + +{%- endif %} diff --git a/mcp/salt-formulas/salt-formula-oslo-templates b/mcp/salt-formulas/salt-formula-oslo-templates new file mode 160000 +Subproject 3534ca9dd05031cbde84cc878122183e3b6daec diff --git a/mcp/salt-formulas/salt-formula-panko b/mcp/salt-formulas/salt-formula-panko new file mode 160000 +Subproject 31c752a6eedf41bf4310f7a620acd87b61d0f09 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 %} diff --git a/mcp/salt-formulas/salt-formula-rabbitmq b/mcp/salt-formulas/salt-formula-rabbitmq new file mode 160000 +Subproject a4d0ca57eec99edd1a6df031a6bd8eabec9a7bd diff --git a/mcp/salt-formulas/salt-formula-redis b/mcp/salt-formulas/salt-formula-redis new file mode 160000 +Subproject e6426b6a271b87e90a1c31ddcca36e5449383c4 diff --git a/mcp/salt-formulas/salt-formula-tacker/metadata/service/server/single.yml b/mcp/salt-formulas/salt-formula-tacker/metadata/service/server/single.yml new file mode 100644 index 000000000..231e978cc --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/metadata/service/server/single.yml @@ -0,0 +1,35 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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 +############################################################################## +--- +classes: + - service.git.client +parameters: + _param: + keystone_tacker_endpoint_type: internalURL + tacker: + server: + bind_host: ${_param:cluster_local_address} + enabled: true + git: + branch: stable/${_param:openstack_version} + database: + engine: mysql + host: ${_param:single_address} + port: 3306 + name: tacker + user: tacker + password: ${_param:mysql_tacker_password} + identity: + engine: keystone + region: RegionOne + host: ${_param:single_address} + port: 35357 + user: tacker + password: ${_param:keystone_tacker_password} + tenant: service + endpoint_type: ${_param:keystone_tacker_endpoint_type} diff --git a/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.conf b/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.conf new file mode 100644 index 000000000..7adfd3139 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.conf @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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 "tacker/map.jinja" import server with context %} + +[DEFAULT] +auth_strategy = keystone +policy_file = /usr/local/etc/tacker/policy.json +debug = True +use_syslog = False +bind_host = {{ server.bind_host }} +bind_port = 9890 +service_plugins = nfvo,vnfm + +state_path = /var/lib/tacker + +[nfvo_vim] +vim_drivers = openstack + +[keystone_authtoken] +region_name = {{ server.identity.region }} +auth_type = password +user_domain_id = {{ server.identity.get('domain', 'default') }} +project_domain_id = {{ server.identity.get('domain', 'default') }} +project_name = {{ server.identity.tenant }} +username = {{ server.identity.user }} +password = {{ server.identity.password }} +auth_url = http://{{ server.identity.host }}:35357 +www_authenticate_uri = http://{{ server.identity.host }}:5000 +{%- if server.cache is defined %} +memcached_servers={%- for member in server.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %} +{%- endif %} + +[agent] +root_helper = sudo /usr/local/bin/tacker-rootwrap /usr/local/etc/tacker/rootwrap.conf + +[database] +connection = {{ server.database.engine }}+pymysql://{{ server.database.user }}:{{ server.database.password }}@{{ server.database.host }}/{{ server.database.name }}?charset=utf8 + +[tacker] +monitor_driver = ping,http_ping diff --git a/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.systemd b/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.systemd new file mode 100644 index 000000000..12ff5cdde --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/tacker/files/tacker.systemd @@ -0,0 +1,20 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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 +############################################################################## +[Unit] +Description = OpenStack Tacker service + +[Service] +ExecReload = /bin/kill -HUP $MAINPID +TimeoutStopSec = 300 +KillMode = process +WorkingDirectory = /tmp +ExecStartPre=/bin/mkdir -p /var/log/tacker +ExecStart=/usr/local/bin/tacker-server --config-file /usr/local/etc/tacker/tacker.conf --log-file /var/log/tacker/tacker.log + +[Install] +WantedBy = multi-user.target diff --git a/mcp/salt-formulas/salt-formula-tacker/tacker/init.sls b/mcp/salt-formulas/salt-formula-tacker/tacker/init.sls new file mode 100644 index 000000000..35291b8f9 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/tacker/init.sls @@ -0,0 +1,11 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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.tacker.server is defined %} +- tacker.server +{%- endif %} diff --git a/mcp/salt-formulas/salt-formula-tacker/tacker/map.jinja b/mcp/salt-formulas/salt-formula-tacker/tacker/map.jinja new file mode 100644 index 000000000..9a35c8e52 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/tacker/map.jinja @@ -0,0 +1,21 @@ +{#- + Copyright (c) 2018 Mirantis Inc. 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': ['python-heat-translator', 'python-tosca-parser', 'python-tackerclient'], + 'bind_host': '0.0.0.0', + 'git': { + 'source': 'https://github.com/openstack/tacker', + 'target': '/tmp/tacker', + 'branch': 'master', + }, + }, + 'RedHat': { + 'pkgs': 'openstack-tacker' + }, +}, merge=salt['pillar.get']('tacker:server')) %} diff --git a/mcp/salt-formulas/salt-formula-tacker/tacker/server.sls b/mcp/salt-formulas/salt-formula-tacker/tacker/server.sls new file mode 100644 index 000000000..eb3468a11 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-tacker/tacker/server.sls @@ -0,0 +1,56 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. 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 "tacker/map.jinja" import server with context %} +{%- if server.enabled %} + +include: +- git + +{{ server.git.source }}: + git.latest: + - target: {{ server.git.target }} + - rev: {{ server.git.branch }} + - depth: 1 + +tacker_packages: + pkg.installed: + - names: {{ server.pkgs }} + +tacker_install: + cmd.run: + - name: python setup.py install + - cwd: {{ server.git.target }} + - creates: /usr/local/bin/tacker-server + - require: + - git: {{ server.git.source }} + +/usr/local/etc/tacker/tacker.conf: + file.managed: + - source: salt://tacker/files/tacker.conf + - template: jinja + - makedirs: true + - require: + - cmd: tacker_install + +tacker_db_manage: + cmd.run: + - name: /usr/local/bin/tacker-db-manage --config-file /usr/local/etc/tacker/tacker.conf upgrade head + - require: + - file: /usr/local/etc/tacker/tacker.conf + +/lib/systemd/system/tacker.service: + file.managed: + - source: salt://tacker/files/tacker.systemd + +tacker: + service.running: + - enable: true + - watch: + - file: /usr/local/etc/tacker/tacker.conf + +{%- endif %} |