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: /home/{{ pillar['fwdriver']['user'] }}/.virtualenvs/fw/bin/postactivate:
file.managed: file.managed:
- source: salt://fwdriver/files/postactivate - source: salt://fwdriver/files/postactivate
...@@ -80,25 +83,6 @@ systemd-sysctl: ...@@ -80,25 +83,6 @@ systemd-sysctl:
service.running: service.running:
- reload: True - 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: /root/firewall-init.te:
file.managed: file.managed:
- source: salt://fwdriver/files/firewall-init.te - source: salt://fwdriver/files/firewall-init.te
......
...@@ -17,17 +17,21 @@ portal.conf: ...@@ -17,17 +17,21 @@ portal.conf:
- group: root - group: root
- template: jinja - template: jinja
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
{% if pillar['deployment_type'] == 'production' %} {% if pillar['deployment_type'] == 'production' %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service
{% else %} {% else %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.service - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.service
{% endif %} {% endif %}
{% else %} {% else %}
{% if pillar['deployment_type'] == 'production' %} {% if pillar['deployment_type'] == 'production' %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.conf - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.conf
{% else %} {% else %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.conf - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.conf
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
......
...@@ -13,11 +13,11 @@ nginx: ...@@ -13,11 +13,11 @@ nginx:
circlecert: circlecert:
cmd.run: cmd.run:
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
- name: ./make-dummy-cert circle.pem - 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 - 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/ - cwd: /etc/ssl/certs/
- creates: /etc/ssl/certs/circle.pem - creates: /etc/ssl/certs/circle.pem
......
...@@ -4,13 +4,13 @@ nodejs-legacy: ...@@ -4,13 +4,13 @@ nodejs-legacy:
{% endif %} {% endif %}
npm: npm:
{% if grains['os'] == 'Ubuntu' %} {% if grains['os'] == 'Ubuntu' %}
pkg.installed: pkg.installed:
- require: - require:
- pkg: nodejs-legacy - pkg: nodejs-legacy
{% else %} {% else %}
pkg.installed pkg.installed
{% endif %} {% endif %}
bower: bower:
npm.installed: npm.installed:
......
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
postgresql-server: postgresql-server:
pkg.installed pkg.installed
......
{% 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 %}
include:
- openvswitch
/home/{{ pillar['user'] }}/.virtualenvs/vmdriver/bin/postactivate: /home/{{ pillar['user'] }}/.virtualenvs/vmdriver/bin/postactivate:
file.managed: file.managed:
- source: salt://vmdriver/files/postactivate - source: salt://vmdriver/files/postactivate
...@@ -20,26 +23,6 @@ ...@@ -20,26 +23,6 @@
- source: file:///home/{{ pillar['user'] }}/vmdriver/miscellaneous/{{ file }} - source: file:///home/{{ pillar['user'] }}/vmdriver/miscellaneous/{{ file }}
{% endfor %} {% 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: ovs-bridge:
cmd.run: cmd.run:
- name: ovs-vsctl add-br cloud - 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