Commit a477ae1b by Szeberényi Imre

vmdriver install test

parent 3f9822e7
...@@ -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
...@@ -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:
......
...@@ -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
polkitd: polkit:
service: service:
- running - running
- watch: - watch:
......
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 %}
#}
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