Commit 6f9c3e6a by Czémán Arnold

Add openvswitch standalone module; prettify some sls files

parent 8b56dbe7
include:
- openvswitch
/home/{{ pillar['fwdriver']['user'] }}/.virtualenvs/fw/bin/postactivate:
file.managed:
- source: salt://fwdriver/files/postactivate
......@@ -80,25 +83,6 @@ systemd-sysctl:
service.running:
- reload: True
{# TODO: standalone module for openvswitch #}
openvswitch2:
pkg.installed:
- sources:
- openvswitch: salt://vmdriver/files/openvswitch-2.3.1-1.x86_64.rpm
cmd.run:
- name: mkdir /etc/openvswitch; restorecon -R /etc/openvswitch/
- creates: /etc/openvswitch
- require:
- pkg: openvswitch
service:
- name: openvswitch
- running
- enable: True
- require:
- cmd: openvswitch
- required_in:
- cmd: ovs-bridge
/root/firewall-init.te:
file.managed:
- source: salt://fwdriver/files/firewall-init.te
......
......@@ -6,13 +6,13 @@ include:
firewall:
pkg.installed:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- zlib-devel
- python-virtualenvwrapper
- python-devel
- libmemcached-devel
- dhcp
{% else %}
{% else %}
- zlib1g-dev
- virtualenvwrapper
- python-dev
......@@ -20,7 +20,7 @@ firewall:
- openvswitch-switch
- openvswitch-controller
- isc-dhcp-server
{% endif %}
{% endif %}
- git
- python-pip
- ntp
......
......@@ -16,19 +16,23 @@ portal.conf:
- user: root
- group: root
- template: jinja
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
{% if pillar['deployment_type'] == 'production' %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service
{% else %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.service
{% endif %}
{% else %}
{% else %}
{% if pillar['deployment_type'] == 'production' %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.conf
{% else %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.conf
{% endif %}
{% endif %}
{% endif %}
{% if grains['os_family'] == 'RedHat' %}
/etc/systemd/system/manager.service:
......
......@@ -13,11 +13,11 @@ nginx:
circlecert:
cmd.run:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: ./make-dummy-cert circle.pem
{% else %}
{% else %}
- name: openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout circle.key -out circle.crt -subj '/CN=localhost/O=My Company Name LTD./C=US' && cat circle.key circle.crt > circle.pem && rm circle.key circle.crt; chmod 600 circle.pem
{% endif %}
{% endif %}
- cwd: /etc/ssl/certs/
- creates: /etc/ssl/certs/circle.pem
......@@ -37,11 +37,11 @@ nginx_selinux:
nginxdefault:
file.managed:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: /etc/nginx/conf.d/default.conf
{% else %}
{% else %}
- name: /etc/nginx/sites-enabled/default
{% endif %}
{% endif %}
- template: jinja
- source: salt://manager/files/nginx-default-site.conf
- user: root
......
......@@ -4,13 +4,13 @@ nodejs-legacy:
{% endif %}
npm:
{% if grains['os'] == 'Ubuntu' %}
{% if grains['os'] == 'Ubuntu' %}
pkg.installed:
- require:
- pkg: nodejs-legacy
{% else %}
{% else %}
pkg.installed
{% endif %}
{% endif %}
bower:
npm.installed:
......
{% if grains['os_family'] == 'RedHat' %}
postgresql-server:
pkg.installed
......
......@@ -11,11 +11,11 @@ vm:
- ipaddr: {{ pillar['fwdriver']['vm_net_ip'] }}
- netmask: {{ pillar['fwdriver']['vm_net_mask'] }}
- pre_up_cmds:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- /bin/systemctl restart openvswitch
{% else %}
{% else %}
- /etc/init.d/openvswitch-switch restart
{% endif %}
{% endif %}
- require:
- cmd: ovs-if
......@@ -41,9 +41,9 @@ salt://network/files/fix_dhcp.sh:
isc-dhcp-server:
service:
- running
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: dhcpd
{% endif %}
{% endif %}
- enable: True
- reload: True
nfs-client:
pkg.installed:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- nfs-utils
{% else %}
{% else %}
- nfs-common
{% endif %}
{% endif %}
- require_in:
- mount: /datastore
......
{% if grains['os_family'] == "RedHat" %}
openvswitch:
pkg.installed:
- sources:
- openvswitch: salt://openvswitch/files/openvswitch-2.3.1-1.x86_64.rpm
cmd.run:
- name: mkdir /etc/openvswitch; restorecon -R /etc/openvswitch/
- creates: /etc/openvswitch
- require:
- pkg: openvswitch
service:
- name: openvswitch
- running
- enable: True
- require:
- cmd: openvswitch
- required_in:
- cmd: ovs-bridge
{% endif %}
......@@ -10,20 +10,20 @@ rpcbind:
nfs-server:
service:
{% if grains['os_family'] != 'RedHat' %}
{% if grains['os_family'] != 'RedHat' %}
- name: nfs-kernel-server
{% endif %}
{% endif %}
- running
- watch:
- file: /etc/exports
- require:
- service: rpcbind
pkg.installed:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: nfs-utils
{% else %}
{% else %}
- name: nfs-kernel-server
{% endif %}
{% endif %}
/etc/exports:
file.managed:
......
include:
- openvswitch
/home/{{ pillar['user'] }}/.virtualenvs/vmdriver/bin/postactivate:
file.managed:
- source: salt://vmdriver/files/postactivate
......@@ -20,26 +23,6 @@
- source: file:///home/{{ pillar['user'] }}/vmdriver/miscellaneous/{{ file }}
{% endfor %}
{# TODO: standalone module for openvswitch #}
{% if grains['os_family'] == 'RedHat' %}
openvswitch:
pkg.installed:
- sources:
- openvswitch: salt://vmdriver/files/openvswitch-2.3.1-1.x86_64.rpm
cmd.run:
- name: mkdir /etc/openvswitch; restorecon -R /etc/openvswitch/
- creates: /etc/openvswitch
- require:
- pkg: openvswitch
service:
- running
- enable: True
- require:
- cmd: openvswitch
- required_in:
- cmd: ovs-bridge
{% endif %}
ovs-bridge:
cmd.run:
- name: ovs-vsctl add-br cloud
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment