Commit a477ae1b by Szeberényi Imre

vmdriver install test

parent 3f9822e7
......@@ -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
......@@ -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:
......
......@@ -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
polkitd:
polkit:
service:
- running
- watch:
......
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 %}
#}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment