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
9a2595bd
authored
Jul 13, 2015
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cent OS 7 port of fwdriver, network, storagedriver, vmdriver, nfs-client. Issues: #5, #6.
parent
aa5c987d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
27 deletions
+69
-27
salt/fwdriver/configuration.sls
+40
-8
salt/fwdriver/init.sls
+13
-18
salt/network/init.sls
+5
-1
salt/nfs-client/init.sls
+4
-0
salt/storagedriver/nfs-server.sls
+6
-0
salt/vmdriver/configuration.sls
+1
-0
No files found.
salt/fwdriver/configuration.sls
View file @
9a2595bd
...
...
@@ -6,6 +6,21 @@
- group: {{ pillar['fwdriver']['user'] }}
- mode: 700
{% if grains['os_family'] == 'RedHat' %}
/etc/systemd/system/firewall.service:
file.managed:
- user: root
- group: root
- template: jinja
- source: file:///home/{{ pillar['fwdriver']['user'] }}/fwdriver/miscellaneous/firewall.service
/etc/systemd/system/firewall-init.service:
file.managed:
- user: root
- group: root
- template: jinja
- source: file:///home/{{ pillar['fwdriver']['user'] }}/fwdriver/miscellaneous/firewall-init.service
{% else %}
/etc/init/firewall.conf:
file.managed:
- user: root
...
...
@@ -19,6 +34,7 @@
- group: root
- template: jinja
- source: file:///home/{{ pillar['fwdriver']['user'] }}/fwdriver/miscellaneous/firewall-init.conf
{% endif %}
/etc/dhcp/dhcpd.conf:
file.managed:
...
...
@@ -32,18 +48,12 @@
- user: {{ pillar['fwdriver']['user'] }}
- group: {{ pillar['fwdriver']['user'] }}
{% if grains['os_family'] != 'RedHat' %}
/etc/init.d/isc-dhcp-server:
file.symlink:
- target: /lib/init/upstart-job
- force: True
isc-dhcp-server:
service:
- running
- watch:
- file: /etc/dhcp/dhcpd.conf
- file: /etc/dhcp/dhcpd.conf.generated
- file: /etc/init.d/isc-dhcp-server
{% endif %}
/etc/sysctl.d/60-circle-firewall.conf:
file.managed:
...
...
@@ -58,3 +68,25 @@ isc-dhcp-server:
- mode: 400
- template: jinja
- source: salt://fwdriver/files/sudoers
{# TODO: standalone module for openvswitch #}
{% if grains['os_family'] == 'RedHat' %}
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
{% endif %}
salt/fwdriver/init.sls
View file @
9a2595bd
...
...
@@ -6,39 +6,34 @@ include:
firewall:
pkg.installed:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
- zlib-devel
- python-virtualenvwrapper
- python-devel
- libmemcached-devel
- dhcp
{% else %}
- zlib1g-dev
- virtualenvwrapper
- git
- python-pip
- python-dev
- libmemcached-dev
- ntp
- openvswitch-switch
- openvswitch-controller
- isc-dhcp-server
{% endif %}
- git
- python-pip
- ntp
- iptables
- ipset
- isc-dhcp-server
- require:
- user: {{ pillar['fwdriver']['user'] }}
- require_in:
- git: gitrepo_fwdriver
- virtualenv: virtualenv_fwdriver
- service: isc-dhcp-server
user:
- present
- name: {{ pillar['fwdriver']['user'] }}
- gid_from_name: True
service:
- running
- require:
- service: firewall-init
- watch:
- pkg: firewall
- sls: fwdriver.gitrepo
- sls: fwdriver.virtualenv
- sls: fwdriver.configuration
firewall-init:
service:
- running
salt/network/init.sls
View file @
9a2595bd
...
...
@@ -7,11 +7,15 @@ vm:
network.managed:
- enabled: True
- type: eth
- proto:
static
- proto:
none
- ipaddr: {{ pillar['fwdriver']['vm_net'].split('/')[0] }}
- netmask: {{ pillar['fwdriver']['vm_net'].split('/')[1] }}
- pre_up_cmds:
{% if grains['os_family'] == 'RedHat' %}
- /bin/systemctl restart openvswitch
{% else %}
- /etc/init.d/openvswitch-switch restart
{% endif %}
- require:
- cmd: ovs-if
...
...
salt/nfs-client/init.sls
View file @
9a2595bd
nfs-client:
pkg.installed:
- pkgs:
{% if grains['os_family'] == 'RedHat' %}
- nfs-utils
{% else %}
- nfs-common
{% endif %}
- require_in:
- mount: /datastore
...
...
salt/storagedriver/nfs-server.sls
View file @
9a2595bd
{% if pillar['nfs']['enabled'] %}
nfs-server:
service:
{% if grains['os_family'] != 'RedHat' %}
- name: nfs-kernel-server
{% endif %}
- running
- watch:
- file: /etc/exports
pkg.installed:
{% if grains['os_family'] == 'RedHat' %}
- name: nfs-utils
{% else %}
- name: nfs-kernel-server
{% endif %}
/etc/exports:
file.managed:
...
...
salt/vmdriver/configuration.sls
View file @
9a2595bd
...
...
@@ -20,6 +20,7 @@
- source: file:///home/{{ pillar['user'] }}/vmdriver/miscellaneous/{{ file }}
{% endfor %}
{# TODO: standalone module for openvswitch #}
{% if grains['os_family'] == 'RedHat' %}
openvswitch:
pkg.installed:
...
...
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