Commit 8df6aa33 by Desztics Armand

fix, zeroerror

parent cced407b
fwdriver: fwdriver:
repo_name: https://git.ik.bme.hu/circle/fwdriver.git repo_name: https://git.ik.bme.hu/circle/fwdriver.git
repo_revision: master repo_revision: ubuntu1604
user: fw user: fw
......
#user: cloud user: cloud
#proxy_secret: xooquageire7uX1 proxy_secret: xooquageire7uX1
#secret_key: Ga4aex3Eesohngo secret_key: Ga4aex3Eesohngo
#timezone: Europe/Budapest timezone: Europe/Budapest
#deployment_type: local deployment_type: production
#admin_user: admin admin_user: admin
#admin_pass: 4j23oihreehfd admin_pass: admin
#database: database:
# name: circle name: circle
# user: circle user: circle
# password: hoGei6paiN0ieda password: hoGei6paiN0ieda
#amqp: amqp:
# user: cloud user: cloud
# password: password password: password
# host: 127.0.0.1 host: 127.0.0.1
# port: 5672 port: 5672
# vhost: circle vhost: circle
#graphite: graphite:
# user: monitor user: monitor
# password: monitor password: monitor
# host: 127.0.0.1 host: 127.0.0.1
# port: 5672 port: 5672
# vhost: monitor vhost: monitor
# queue: monitor queue: monitor
# secret_key: ahf2aim7ahLeo8n secret_key: ahf2aim7ahLeo8n
#cache: pylibmc://127.0.0.1:11211/ cache: pylibmc://127.0.0.1:11211/
#nfs: nfs:
# enabled: true enabled: true
# server: 10.0.0.115 server: 127.0.0.1
# network: 192.168.1.0/24 network: 127.0.0.0/8
# directory: /datastore directory: /datastore
#storagedriver: storagedriver:
# queue_name: cloud-6605 queue_name: ubuntu
#fwdriver: fwdriver:
# queue_name: cloud-6605 queue_name: ubuntu
# gateway: 10.0.255.254 gateway: 10.9.255.254
# external_net: 10.0.0.115/16 external_net: 10.9.0.64/16
# external_if: eth0 external_if: ens3
# trunk_if: linkb trunk_if: linkb
# management_if: ethy management_if: ethy
...@@ -4,3 +4,7 @@ virtualenv_agentdriver: ...@@ -4,3 +4,7 @@ virtualenv_agentdriver:
- requirements: /home/{{ pillar['user'] }}/agentdriver/requirements.txt - requirements: /home/{{ pillar['user'] }}/agentdriver/requirements.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- require:
- file: ubuntu_virtualenvwrapper
{% endif %}
git: git:
pkg.installed pkg.installed
{% if grains['osfinger'] == 'Ubuntu-16.04' %}
ubuntu_virtualenvwrapper:
file.append:
- name: /etc/profile
- text:
- "export WORKON_HOME=$HOME/.virtualenvs"
- "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh"
{% endif %}
\ No newline at end of file
...@@ -4,3 +4,7 @@ virtualenv_fwdriver: ...@@ -4,3 +4,7 @@ virtualenv_fwdriver:
- requirements: /home/{{ pillar['fwdriver']['user'] }}/fwdriver/requirements/production.txt - requirements: /home/{{ pillar['fwdriver']['user'] }}/fwdriver/requirements/production.txt
- user: {{ pillar['fwdriver']['user'] }} - user: {{ pillar['fwdriver']['user'] }}
- no_chown: true - no_chown: true
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- require:
- file: ubuntu_virtualenvwrapper
{% endif %}
...@@ -12,6 +12,9 @@ virtualenv_graphite: ...@@ -12,6 +12,9 @@ virtualenv_graphite:
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- file: /home/{{ pillar['graphite']['user'] }}/requirements.txt - file: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- file: /opt/graphite - file: /opt/graphite
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- file: ubuntu_virtualenvwrapper
{% endif %}
global-site-packages: global-site-packages:
file.absent: file.absent:
......
...@@ -24,6 +24,9 @@ virtualenv_manager: ...@@ -24,6 +24,9 @@ virtualenv_manager:
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
- environ: m2crypto_swig_env - environ: m2crypto_swig_env
{% endif %} {% endif %}
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- file: ubuntu_virtualenvwrapper
{% endif %}
salt://manager/files/syncdb.sh: salt://manager/files/syncdb.sh:
cmd.script: cmd.script:
......
...@@ -4,3 +4,7 @@ virtualenv_monitor-client: ...@@ -4,3 +4,7 @@ virtualenv_monitor-client:
- requirements: /home/{{ pillar['user'] }}/monitor-client/requirements.txt - requirements: /home/{{ pillar['user'] }}/monitor-client/requirements.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- require:
- file: ubuntu_virtualenvwrapper
{% endif %}
...@@ -31,6 +31,8 @@ storage: ...@@ -31,6 +31,8 @@ storage:
service: service:
- running - running
- enable: True - enable: True
- require:
- virtualenv: virtualenv_storagedriver
- watch: - watch:
- pkg: storagedriver - pkg: storagedriver
- sls: storagedriver.gitrepo - sls: storagedriver.gitrepo
......
...@@ -4,3 +4,8 @@ virtualenv_storagedriver: ...@@ -4,3 +4,8 @@ virtualenv_storagedriver:
- requirements: /home/{{ pillar['user'] }}/storagedriver/requirements/production.txt - requirements: /home/{{ pillar['user'] }}/storagedriver/requirements/production.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
- require:
- pkg: storagedriver
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- file: ubuntu_virtualenvwrapper
{% endif %}
...@@ -50,8 +50,12 @@ vmdriver: ...@@ -50,8 +50,12 @@ vmdriver:
- 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
{% if grains['osfinger'] == 'Ubuntu-16.04' %}
- service: libvirtd
{% else %}
- service: libvirt-bin - service: libvirt-bin
{% endif %} {% endif %}
{% endif %}
- augeas: libvirtconf - augeas: libvirtconf
- git: gitrepo_vmdriver - git: gitrepo_vmdriver
- virtualenv: virtualenv_vmdriver - virtualenv: virtualenv_vmdriver
......
...@@ -13,9 +13,35 @@ libvirtconf: ...@@ -13,9 +13,35 @@ libvirtconf:
/etc/default/libvirt-bin: /etc/default/libvirt-bin:
file.append: file.append:
{% if grains['osfinger'] == 'Ubuntu-16.04' %}
- text: libvirtd_opts="-l"
{% else %}
- text: libvirtd_opts="-d -l" - text: libvirtd_opts="-d -l"
{% endif %}
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} {% if grains['osfinger'] == 'Ubuntu-16.04' %}
symlink_libvirtd:
file.symlink:
- name: /etc/systemd/system/libvirtd.service
- target: /lib/systemd/system/libvirt-bin.service
- force: True
- require_in:
- service: libvirtd
- require:
- cmd: kill_libvirt-bin
cmd.run:
- name: /bin/systemctl daemon-reload
- require:
- file: symlink_libvirtd
kill_libvirt-bin:
cmd.run:
- name: /usr/sbin/service libvirt-bin force-stop
- require:
- pkg: vmdriver
{% endif %}
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' or grains['osfinger'] == 'Ubuntu-16.04' %}
libvirtd: libvirtd:
{% else %} {% else %}
libvirt-bin: libvirt-bin:
...@@ -25,6 +51,10 @@ libvirt-bin: ...@@ -25,6 +51,10 @@ libvirt-bin:
- watch: - watch:
- file: /etc/default/libvirt-bin - file: /etc/default/libvirt-bin
- augeas: libvirtconf - augeas: libvirtconf
{% if grains['osfinger'] == 'Ubuntu-16.04' %}
- require:
- user: user_in_libvirtd_group
{% endif %}
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
/usr/bin/kvm: /usr/bin/kvm:
...@@ -67,13 +97,6 @@ vmdriver_semodule: ...@@ -67,13 +97,6 @@ vmdriver_semodule:
{% elif grains['os'] == 'Debian' %} {% elif grains['os'] == 'Debian' %}
/usr/bin/kvm:
file.replace:
- pattern: -enable-kvm
- repl: ""
- watch:
- pkg: vmdriver
policycoreutils: policycoreutils:
pkg.installed pkg.installed
...@@ -114,6 +137,15 @@ apparmor: ...@@ -114,6 +137,15 @@ apparmor:
- file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper - file: /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
{% endif %} {% endif %}
{% if grains['os'] == 'Debian' or grains['osfinger'] == 'Ubuntu-16.04' %}
/usr/bin/kvm:
file.replace:
- pattern: -enable-kvm
- repl: ""
- watch:
- pkg: vmdriver
{% endif %}
/var/lib/libvirt/serial: /var/lib/libvirt/serial:
file.directory: file.directory:
- makedirs: True - makedirs: True
...@@ -124,3 +156,18 @@ apparmor: ...@@ -124,3 +156,18 @@ apparmor:
{% endif %} {% endif %}
- group: kvm - group: kvm
- mode: 755 - mode: 755
{% if grains['osfinger'] == 'Ubuntu-16.04' %}
user_in_libvirtd_group:
user.present:
- name: {{ pillar['user'] }}
- groups:
- libvirtd
- require:
- file: fix_user_sudoer
fix_user_sudoer:
file.append:
- name: /etc/sudoers
- text: "{{ pillar['user'] }} ALL=(ALL) ALL"
{% endif %}
...@@ -4,12 +4,16 @@ virtualenv_vmdriver: ...@@ -4,12 +4,16 @@ virtualenv_vmdriver:
- requirements: /home/{{ pillar['user'] }}/vmdriver/requirements/production.txt - requirements: /home/{{ pillar['user'] }}/vmdriver/requirements/production.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- require:
- file: ubuntu_virtualenvwrapper
{% endif %}
{% 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'] == 'Debian' or grains['osfinger'] == 'Ubuntu-16.04') 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 }}:
......
...@@ -4,3 +4,7 @@ virtualenv_vncproxy: ...@@ -4,3 +4,7 @@ virtualenv_vncproxy:
- requirements: /home/{{ pillar['user'] }}/vncproxy/requirements/production.txt - requirements: /home/{{ pillar['user'] }}/vncproxy/requirements/production.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
{% if grains["osfinger"] == "Ubuntu-16.04" %}
- require:
- file: ubuntu_virtualenvwrapper
{% endif %}
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