Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6f9c3e6a
authored
Jul 31, 2015
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add openvswitch standalone module; prettify some sls files
parent
8b56dbe7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
57 additions
and
68 deletions
+57
-68
salt/fwdriver/configuration.sls
+3
-19
salt/fwdriver/init.sls
+3
-3
salt/manager/configuration.sls
+7
-3
salt/manager/nginx.sls
+6
-6
salt/manager/pipeline.sls
+3
-3
salt/manager/postgres.sls
+0
-1
salt/network/init.sls
+5
-5
salt/nfs-client/init.sls
+3
-3
salt/openvswitch/files/openvswitch-2.3.1-1.x86_64.rpm
+0
-0
salt/openvswitch/init.sls
+19
-0
salt/storagedriver/nfs-server.sls
+5
-5
salt/vmdriver/configuration.sls
+3
-20
No files found.
salt/fwdriver/configuration.sls
View file @
6f9c3e6a
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
...
...
salt/fwdriver/init.sls
View file @
6f9c3e6a
...
...
@@ -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
...
...
salt/manager/configuration.sls
View file @
6f9c3e6a
...
...
@@ -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:
...
...
salt/manager/nginx.sls
View file @
6f9c3e6a
...
...
@@ -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
...
...
salt/manager/pipeline.sls
View file @
6f9c3e6a
...
...
@@ -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:
...
...
salt/manager/postgres.sls
View file @
6f9c3e6a
{% if grains['os_family'] == 'RedHat' %}
postgresql-server:
pkg.installed
...
...
salt/network/init.sls
View file @
6f9c3e6a
...
...
@@ -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
salt/nfs-client/init.sls
View file @
6f9c3e6a
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
...
...
salt/
vmdriver
/files/openvswitch-2.3.1-1.x86_64.rpm
→
salt/
openvswitch
/files/openvswitch-2.3.1-1.x86_64.rpm
View file @
6f9c3e6a
File moved
salt/openvswitch/init.sls
0 → 100644
View file @
6f9c3e6a
{% 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 %}
salt/storagedriver/nfs-server.sls
View file @
6f9c3e6a
...
...
@@ -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:
...
...
salt/vmdriver/configuration.sls
View file @
6f9c3e6a
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment