Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
17
Merge Requests
1
Wiki
Snippets
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:
/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
...
...
salt/fwdriver/init.sls
View file @
6f9c3e6a
...
@@ -6,13 +6,13 @@ include:
...
@@ -6,13 +6,13 @@ include:
firewall:
firewall:
pkg.installed:
pkg.installed:
- pkgs:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- zlib-devel
- zlib-devel
- python-virtualenvwrapper
- python-virtualenvwrapper
- python-devel
- python-devel
- libmemcached-devel
- libmemcached-devel
- dhcp
- dhcp
{% else %}
{% else %}
- zlib1g-dev
- zlib1g-dev
- virtualenvwrapper
- virtualenvwrapper
- python-dev
- python-dev
...
@@ -20,7 +20,7 @@ firewall:
...
@@ -20,7 +20,7 @@ firewall:
- openvswitch-switch
- openvswitch-switch
- openvswitch-controller
- openvswitch-controller
- isc-dhcp-server
- isc-dhcp-server
{% endif %}
{% endif %}
- git
- git
- python-pip
- python-pip
- ntp
- ntp
...
...
salt/manager/configuration.sls
View file @
6f9c3e6a
...
@@ -16,19 +16,23 @@ portal.conf:
...
@@ -16,19 +16,23 @@ portal.conf:
- user: root
- user: root
- 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' %}
/etc/systemd/system/manager.service:
/etc/systemd/system/manager.service:
...
...
salt/manager/nginx.sls
View file @
6f9c3e6a
...
@@ -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
...
@@ -37,11 +37,11 @@ nginx_selinux:
...
@@ -37,11 +37,11 @@ nginx_selinux:
nginxdefault:
nginxdefault:
file.managed:
file.managed:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: /etc/nginx/conf.d/default.conf
- name: /etc/nginx/conf.d/default.conf
{% else %}
{% else %}
- name: /etc/nginx/sites-enabled/default
- name: /etc/nginx/sites-enabled/default
{% endif %}
{% endif %}
- template: jinja
- template: jinja
- source: salt://manager/files/nginx-default-site.conf
- source: salt://manager/files/nginx-default-site.conf
- user: root
- user: root
...
...
salt/manager/pipeline.sls
View file @
6f9c3e6a
...
@@ -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:
...
...
salt/manager/postgres.sls
View file @
6f9c3e6a
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
postgresql-server:
postgresql-server:
pkg.installed
pkg.installed
...
...
salt/network/init.sls
View file @
6f9c3e6a
...
@@ -11,11 +11,11 @@ vm:
...
@@ -11,11 +11,11 @@ vm:
- ipaddr: {{ pillar['fwdriver']['vm_net_ip'] }}
- ipaddr: {{ pillar['fwdriver']['vm_net_ip'] }}
- netmask: {{ pillar['fwdriver']['vm_net_mask'] }}
- netmask: {{ pillar['fwdriver']['vm_net_mask'] }}
- pre_up_cmds:
- pre_up_cmds:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- /bin/systemctl restart openvswitch
- /bin/systemctl restart openvswitch
{% else %}
{% else %}
- /etc/init.d/openvswitch-switch restart
- /etc/init.d/openvswitch-switch restart
{% endif %}
{% endif %}
- require:
- require:
- cmd: ovs-if
- cmd: ovs-if
...
@@ -41,9 +41,9 @@ salt://network/files/fix_dhcp.sh:
...
@@ -41,9 +41,9 @@ salt://network/files/fix_dhcp.sh:
isc-dhcp-server:
isc-dhcp-server:
service:
service:
- running
- running
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: dhcpd
- name: dhcpd
{% endif %}
{% endif %}
- enable: True
- enable: True
- reload: True
- reload: True
salt/nfs-client/init.sls
View file @
6f9c3e6a
nfs-client:
nfs-client:
pkg.installed:
pkg.installed:
- pkgs:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- nfs-utils
- nfs-utils
{% else %}
{% else %}
- nfs-common
- nfs-common
{% endif %}
{% endif %}
- require_in:
- require_in:
- mount: /datastore
- 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:
...
@@ -10,20 +10,20 @@ rpcbind:
nfs-server:
nfs-server:
service:
service:
{% if grains['os_family'] != 'RedHat' %}
{% if grains['os_family'] != 'RedHat' %}
- name: nfs-kernel-server
- name: nfs-kernel-server
{% endif %}
{% endif %}
- running
- running
- watch:
- watch:
- file: /etc/exports
- file: /etc/exports
- require:
- require:
- service: rpcbind
- service: rpcbind
pkg.installed:
pkg.installed:
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- name: nfs-utils
- name: nfs-utils
{% else %}
{% else %}
- name: nfs-kernel-server
- name: nfs-kernel-server
{% endif %}
{% endif %}
/etc/exports:
/etc/exports:
file.managed:
file.managed:
...
...
salt/vmdriver/configuration.sls
View file @
6f9c3e6a
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
...
...
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