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
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:
...
@@ -8,11 +8,12 @@ include:
- user: {{ pillar['user'] }}
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 700
- 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")
{% set service_files = (("vmcelery@.service", "netcelery@.service", "node.service")
if grains['os_family'] == 'RedHat'
if pillar['init_type'] == 'systemd' else
or grains['os'] == 'Debian' else
("vmcelery.conf", "netcelery.conf", "node.conf")) %}
("vmcelery.conf", "netcelery.conf", "node.conf")) %}
{% for file in service_files %}
{% for file in service_files %}
...
@@ -36,3 +37,4 @@ ovs-bridge:
...
@@ -36,3 +37,4 @@ ovs-bridge:
- user: root
- user: root
- group: root
- group: root
- mode: 600
- mode: 600
salt/vmdriver/init.sls
View file @
a477ae1b
...
@@ -16,11 +16,10 @@ vmdriver:
...
@@ -16,11 +16,10 @@ vmdriver:
- pkgs:
- pkgs:
- git
- git
- python-augeas
- python-augeas
-
ntp
-
chrony
- wget
- wget
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
- qemu-kvm-ev
- qemu-kvm-ev
- python2-pip
- libmemcached-devel
- libmemcached-devel
- libvirt
- libvirt
- libvirt-daemon
- libvirt-daemon
...
@@ -28,57 +27,55 @@ vmdriver:
...
@@ -28,57 +27,55 @@ vmdriver:
- libvirt-python
- libvirt-python
- libxml2-devel
- libxml2-devel
- libxslt-devel
- libxslt-devel
- python-devel
- python3-devel
- python-virtualenvwrapper
- qemu-img-ev
- qemu-img-ev
- zlib-devel
- zlib-devel
{% else %}
{% else %}
- qemu-kvm
- qemu-kvm
- python-pip
# - libvirt-bin
- virt-manager
- libmemcached-dev
- libmemcached-dev
- libvirt-bin
- libxml2-dev
- libxml2-dev
- libxslt1-dev
- libxslt1-dev
- python3-dev
- openvswitch-common
- openvswitch-common
- openvswitch-switch
- openvswitch-switch
{% if grains['os'] != 'Debian' %}
{% if grains['os
_family
'] != 'Debian' %}
{# No such package in Debian Jessie! #}
{# No such package in Debian Jessie! #}
- openvswitch-controller
- openvswitch-controller
{% endif %}
{% endif %}
- python-dev
- python-libvirt
- python-libvirt
- virtualenvwrapper
- qemu-utils
- qemu-utils
- zlib1g-dev
- zlib1g-dev
{% endif %}
{% endif %}
- require_in:
- require_in:
- file: /etc/default/libvirt-bin
#
- file: /etc/default/libvirt-bin
{% if grains['os_family'] == 'RedHat' or grains['os
'] == 'Debian' %}
# {% if grains['os_family'] == 'RedHat' or grains['os_family
'] == 'Debian' %}
- service: libvirtd
#
- service: libvirtd
{% else %}
#
{% else %}
- file: /etc/apparmor.d/libvirt/TEMPLATE
#
- file: /etc/apparmor.d/libvirt/TEMPLATE
- file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
#
- file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
- file: /var/lib/libvirt/serial
#
- file: /var/lib/libvirt/serial
- service: libvirt-bin
#
- service: libvirt-bin
{% endif %}
#
{% endif %}
- augeas: libvirtconf
#
- augeas: libvirtconf
- git: gitrepo_vmdriver
- git: gitrepo_vmdriver
- virtualenv: virtualenv_vmdriver
- virtualenv: virtualenv_vmdriver
{% if grains['os_family'] == 'RedHat' %}
#
{% if grains['os_family'] == 'RedHat' %}
- require:
#
- require:
- pkg: ev_repo_for_vmdriver
#
- pkg: ev_repo_for_vmdriver
{% endif %}
#
{% endif %}
agentdriver_service:
#
agentdriver_service:
service:
#
service:
- name: agentdriver
#
- name: agentdriver
- running
#
- running
- enable: true
#
- enable: true
- watch:
#
- watch:
- pkg: agentdriver
#
- pkg: agentdriver
- sls: agentdriver.gitrepo
#
- sls: agentdriver.gitrepo
- sls: agentdriver.virtualenv
#
- sls: agentdriver.virtualenv
- sls: agentdriver.configuration
#
- sls: agentdriver.configuration
node:
node:
service:
service:
...
...
salt/vmdriver/libvirt.sls
View file @
a477ae1b
...
@@ -3,28 +3,28 @@ augeas_dependency:
...
@@ -3,28 +3,28 @@ augeas_dependency:
- pkgs:
- pkgs:
- python-augeas
- python-augeas
libvirtconf:
#
libvirtconf:
augeas.change:
#
augeas.change:
- context: /files/etc/libvirt/libvirtd.conf
#
- context: /files/etc/libvirt/libvirtd.conf
- changes:
#
- changes:
- set listen_tcp 1
#
- set listen_tcp 1
- set listen_tls 0
#
- set listen_tls 0
- set auth_tcp "none"
#
- set auth_tcp "none"
/etc/default/libvirt-bin:
#
/etc/default/libvirt-bin:
file.append:
#
file.append:
- text: libvirtd_opts="-d -l"
#
- text: libvirtd_opts="-d -l"
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %}
{% if grains['os_family'] == 'RedHat' or grains['os
_family
'] == 'Debian' %}
libvirtd:
libvirtd:
{% else %}
{% else %}
libvirt-bin:
libvirt-bin:
{% endif %}
{% endif %}
service:
service:
- running
- running
- watch:
#
- watch:
- file: /etc/default/libvirt-bin
#
- file: /etc/default/libvirt-bin
- augeas: libvirtconf
#
- augeas: libvirtconf
{% if grains['os_family'] == 'RedHat' %}
{% if grains['os_family'] == 'RedHat' %}
/usr/bin/kvm:
/usr/bin/kvm:
...
@@ -65,14 +65,14 @@ vmdriver_semodule:
...
@@ -65,14 +65,14 @@ vmdriver_semodule:
- file: /root/vmdriver.te
- file: /root/vmdriver.te
- pkg: selinux_pkgs
- pkg: selinux_pkgs
{% elif grains['os'] == 'Debian' %}
{% elif grains['os
_family
'] == 'Debian' %}
/usr/bin/kvm:
#
/usr/bin/kvm:
file.replace:
#
file.replace:
- pattern: -enable-kvm
#
- pattern: -enable-kvm
- repl: ""
#
- repl: ""
- watch:
#
- watch:
- pkg: vmdriver
#
- pkg: vmdriver
policycoreutils:
policycoreutils:
pkg.installed
pkg.installed
...
@@ -85,7 +85,7 @@ policycoreutils:
...
@@ -85,7 +85,7 @@ policycoreutils:
- group: root
- group: root
- template: jinja
- template: jinja
polkit
d
:
polkit:
service:
service:
- running
- running
- watch:
- watch:
...
...
salt/vmdriver/virtualenv.sls
View file @
a477ae1b
include:
- common
virtualenv_vmdriver:
virtualenv_vmdriver:
virtualenv.managed:
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
- 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'] }}
- user: {{ pillar['user'] }}
- cwd: /home/{{ pillar['user'] }}/vmdriver
- no_chown: true
- 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 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',
{% set targets = { 'libvirtmod_qemu.so': 'libvirtmod_qemu.x86_64-linux-gnu.so',
'libvirtmod.so': 'libvirtmod.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") %}
{% 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 }}:
/home/{{ pillar['user'] }}/.virtualenvs/vmdriver/lib/python2.7/site-packages/{{ file }}:
...
@@ -18,3 +37,4 @@ virtualenv_vmdriver:
...
@@ -18,3 +37,4 @@ virtualenv_vmdriver:
- require:
- require:
- virtualenv: virtualenv_vmdriver
- virtualenv: virtualenv_vmdriver
{% endfor %}
{% 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