Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
a477ae1b
authored
Jan 16, 2022
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmdriver install test
parent
3f9822e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
62 deletions
+81
-62
salt/vmdriver/configuration.sls
+5
-3
salt/vmdriver/init.sls
+30
-33
salt/vmdriver/libvirt.sls
+24
-24
salt/vmdriver/virtualenv.sls
+22
-2
No files found.
salt/vmdriver/configuration.sls
View file @
a477ae1b
...
...
@@ -8,11 +8,12 @@ include:
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 700
- require:
- virtualenv: virtualenv_vmdriver
{% set service_dir = "/etc/systemd/system/" if
grains['os_family'] == 'RedHat' or grains['os'] == 'Debian
' else "/etc/init/" %}
{% set service_dir = "/etc/systemd/system/" if
pillar['init_type'] == 'systemd
' else "/etc/init/" %}
{% set service_files = (("vmcelery@.service", "netcelery@.service", "node.service")
if grains['os_family'] == 'RedHat'
or grains['os'] == 'Debian' else
if pillar['init_type'] == 'systemd' else
("vmcelery.conf", "netcelery.conf", "node.conf")) %}
{% for file in service_files %}
...
...
@@ -36,3 +37,4 @@ ovs-bridge:
- user: root
- group: root
- mode: 600
salt/vmdriver/init.sls
View file @
a477ae1b
...
...
@@ -16,11 +16,10 @@ vmdriver:
- pkgs:
- git
- python-augeas
-
ntp
-
chrony
- wget
{% if grains['os_family'] == 'RedHat' %}
- qemu-kvm-ev
- python2-pip
- libmemcached-devel
- libvirt
- libvirt-daemon
...
...
@@ -28,57 +27,55 @@ vmdriver:
- libvirt-python
- libxml2-devel
- libxslt-devel
- python-devel
- python-virtualenvwrapper
- python3-devel
- qemu-img-ev
- zlib-devel
{% else %}
- qemu-kvm
- python-pip
# - libvirt-bin
- virt-manager
- libmemcached-dev
- libvirt-bin
- libxml2-dev
- libxslt1-dev
- python3-dev
- openvswitch-common
- openvswitch-switch
{% if grains['os'] != 'Debian' %}
{% if grains['os
_family
'] != 'Debian' %}
{# No such package in Debian Jessie! #}
- openvswitch-controller
{% endif %}
- python-dev
- python-libvirt
- virtualenvwrapper
- qemu-utils
- zlib1g-dev
{% endif %}
- require_in:
- file: /etc/default/libvirt-bin
{% if grains['os_family'] == 'RedHat' or grains['os
'] == 'Debian' %}
- service: libvirtd
{% else %}
- file: /etc/apparmor.d/libvirt/TEMPLATE
- file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
- file: /var/lib/libvirt/serial
- service: libvirt-bin
{% endif %}
- augeas: libvirtconf
#
- file: /etc/default/libvirt-bin
# {% if grains['os_family'] == 'RedHat' or grains['os_family
'] == 'Debian' %}
#
- service: libvirtd
#
{% else %}
#
- file: /etc/apparmor.d/libvirt/TEMPLATE
#
- file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
#
- file: /var/lib/libvirt/serial
#
- service: libvirt-bin
#
{% endif %}
#
- augeas: libvirtconf
- git: gitrepo_vmdriver
- virtualenv: virtualenv_vmdriver
{% if grains['os_family'] == 'RedHat' %}
- require:
- pkg: ev_repo_for_vmdriver
{% endif %}
#
{% if grains['os_family'] == 'RedHat' %}
#
- require:
#
- pkg: ev_repo_for_vmdriver
#
{% endif %}
agentdriver_service:
service:
- name: agentdriver
- running
- enable: true
- watch:
- pkg: agentdriver
- sls: agentdriver.gitrepo
- sls: agentdriver.virtualenv
- sls: agentdriver.configuration
#
agentdriver_service:
#
service:
#
- name: agentdriver
#
- running
#
- enable: true
#
- watch:
#
- pkg: agentdriver
#
- sls: agentdriver.gitrepo
#
- sls: agentdriver.virtualenv
#
- sls: agentdriver.configuration
node:
service:
...
...
salt/vmdriver/libvirt.sls
View file @
a477ae1b
...
...
@@ -3,28 +3,28 @@ augeas_dependency:
- pkgs:
- python-augeas
libvirtconf:
augeas.change:
- context: /files/etc/libvirt/libvirtd.conf
- changes:
- set listen_tcp 1
- set listen_tls 0
- set auth_tcp "none"
/etc/default/libvirt-bin:
file.append:
- text: libvirtd_opts="-d -l"
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %}
#
libvirtconf:
#
augeas.change:
#
- context: /files/etc/libvirt/libvirtd.conf
#
- changes:
#
- set listen_tcp 1
#
- set listen_tls 0
#
- set auth_tcp "none"
#
/etc/default/libvirt-bin:
#
file.append:
#
- text: libvirtd_opts="-d -l"
{% if grains['os_family'] == 'RedHat' or grains['os
_family
'] == 'Debian' %}
libvirtd:
{% else %}
libvirt-bin:
{% endif %}
service:
- running
- watch:
- file: /etc/default/libvirt-bin
- augeas: libvirtconf
#
- watch:
#
- file: /etc/default/libvirt-bin
#
- augeas: libvirtconf
{% if grains['os_family'] == 'RedHat' %}
/usr/bin/kvm:
...
...
@@ -65,14 +65,14 @@ vmdriver_semodule:
- file: /root/vmdriver.te
- pkg: selinux_pkgs
{% elif grains['os'] == 'Debian' %}
{% elif grains['os
_family
'] == 'Debian' %}
/usr/bin/kvm:
file.replace:
- pattern: -enable-kvm
- repl: ""
- watch:
- pkg: vmdriver
#
/usr/bin/kvm:
#
file.replace:
#
- pattern: -enable-kvm
#
- repl: ""
#
- watch:
#
- pkg: vmdriver
policycoreutils:
pkg.installed
...
...
@@ -85,7 +85,7 @@ policycoreutils:
- group: root
- template: jinja
polkit
d
:
polkit:
service:
- running
- watch:
...
...
salt/vmdriver/virtualenv.sls
View file @
a477ae1b
include:
- common
virtualenv_vmdriver:
virtualenv.managed:
- python: /usr/bin/python3
- name: /home/{{ pillar['user'] }}/.virtualenvs/vmdriver
- requirements: /home/{{ pillar['user'] }}/vmdriver/requirements/{{ pillar['deployment_type'] }}.txt
- user: {{ pillar['user'] }}
- cwd: /home/{{ pillar['user'] }}/vmdriver
- no_chown: true
- require:
- git: gitrepo_vmdriver
- virtualenv: virtualenv_vmdriver_install_first
virtualenv_vmdriver_install_first:
virtualenv.managed:
- python: /usr/bin/python3
- name: /home/{{ pillar['user'] }}/.virtualenvs/vmdriver
- requirements: /home/{{ pillar['user'] }}/
vmdriver/requirements/production
.txt
- requirements: /home/{{ pillar['user'] }}/
circle/requirements/install_first
.txt
- user: {{ pillar['user'] }}
- cwd: /home/{{ pillar['user'] }}/vmdriver
- no_chown: true
{#
{% set libvirt_dir = "/usr/lib64/python2.7/site-packages/" if grains['os_family'] == 'RedHat' else "/usr/lib/python2.7/dist-packages/" %}
{% set targets = { 'libvirtmod_qemu.so': 'libvirtmod_qemu.x86_64-linux-gnu.so',
'libvirtmod.so': 'libvirtmod.x86_64-linux-gnu.so'
} if grains['os'] == 'Debian' else {} %}
} if grains['os
_family
'] == 'Debian' else {} %}
{% for file in ("libvirtmod_qemu.so", "libvirtmod.so", "libvirt_qemu.py", "libvirt.py", "libvirt_qemu.pyc", "libvirt.pyc") %}
/home/{{ pillar['user'] }}/.virtualenvs/vmdriver/lib/python2.7/site-packages/{{ file }}:
...
...
@@ -18,3 +37,4 @@ virtualenv_vmdriver:
- require:
- virtualenv: virtualenv_vmdriver
{% endfor %}
#}
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