Commit e56a6953 by Szeberényi Imre

First try

parent ae1e9385
agentdriver: agentdriver:
repo_name: https://git.ik.bme.hu/circle/agentdriver.git repo_name: https://git.ik.bme.hu/circle3/agentdriver.git
repo_revision: master repo_revision: python3.6
...@@ -5,6 +5,7 @@ secret_key: Ga4aex3Eesohngo ...@@ -5,6 +5,7 @@ secret_key: Ga4aex3Eesohngo
timezone: Europe/Budapest timezone: Europe/Budapest
deployment_type: local deployment_type: local
init_type: systemd
admin_user: admin admin_user: admin
admin_pass: 4j23oihreehfd admin_pass: 4j23oihreehfd
......
fwdriver: fwdriver:
repo_name: https://git.ik.bme.hu/circle/fwdriver.git repo_name: https://git.ik.bme.hu/circle3/fwdriver.git
repo_revision: master repo_revision: master
user: fw user: fw
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#timezone: Europe/Budapest #timezone: Europe/Budapest
#deployment_type: local #deployment_type: local
#init_type: systemd
#admin_user: admin #admin_user: admin
#admin_pass: 4j23oihreehfd #admin_pass: 4j23oihreehfd
......
manager: manager:
repo_name: https://git.ik.bme.hu/circle/cloud.git repo_name: https://git.ik.bme.hu/circle3/cloud.git
repo_revision: master repo_revision: master
monitor-client: monitor-client:
repo_name: https://git.ik.bme.hu/circle/monitor-client.git repo_name: https://git.ik.bme.hu/circle3/monitor-client.git
repo_revision: master repo_revision: ptyhon3.6
storagedriver: storagedriver:
repo_name: https://git.ik.bme.hu/circle/storagedriver.git repo_name: https://git.ik.bme.hu/circle3/storagedriver.git
repo_revision: master repo_revision: python3.6
queue_name: storageserver queue_name: storageserver
vmdriver: vmdriver:
repo_name: https://git.ik.bme.hu/circle/vmdriver.git repo_name: https://git.ik.bme.hu/circle3/vmdriver.git
repo_revision: master repo_revision: python3.6
hypervisor_type: kvm hypervisor_type: kvm
vncproxy: vncproxy:
repo_name: https://git.ik.bme.hu/circle/vncproxy.git repo_name: https://git.ik.bme.hu/circle3/vncproxy.git
repo_revision: master repo_revision: python3.6
include:
- profile
git: git:
pkg.installed pkg.installed
...@@ -5,10 +5,13 @@ manager_postactivate: ...@@ -5,10 +5,13 @@ manager_postactivate:
- template: jinja - template: jinja
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- mode: 700 - mode: 700
- require:
- virtualenv: virtualenv_manager
portal.conf: portal.conf:
file.managed: file.managed:
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} {% if pillar['init_type'] == 'systemd' %}
- name: /etc/systemd/system/portal.service - name: /etc/systemd/system/portal.service
{% else %} {% else %}
- name: /etc/init/portal.conf - name: /etc/init/portal.conf
...@@ -16,8 +19,7 @@ portal.conf: ...@@ -16,8 +19,7 @@ portal.conf:
- user: root - user: root
- group: root - group: root
- template: jinja - template: jinja
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} {% if pillar['init_type'] == 'systemd' %}
{% if pillar['deployment_type'] == 'production' %} {% if pillar['deployment_type'] == 'production' %}
- source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service
{% else %} {% else %}
...@@ -34,7 +36,7 @@ portal.conf: ...@@ -34,7 +36,7 @@ portal.conf:
{% endif %} {% endif %}
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} {% if pillar['init_type'] == 'systemd' %}
/etc/systemd/system/manager.service: /etc/systemd/system/manager.service:
file.managed: file.managed:
- user: root - user: root
......
#!/bin/bash #!/bin/bash
source /home/{{ pillar['user'] }}/.virtualenvs/circle/bin/activate source /etc/profile.d/virtualenvwrapper.sh
source /home/{{ pillar['user'] }}/.virtualenvs/circle/bin/postactivate workon circle
{% set fw = pillar['fwdriver'] %} {% set fw = pillar['fwdriver'] %}
HOSTNAME=$(hostname -s) HOSTNAME=$(hostname -s)
......
include: include:
- manager.pipeline # - manager.pipeline
- manager.gitrepo - manager.gitrepo
- manager.agentgit # - manager.agentgit
- manager.postgres - manager.postgres
- manager.rabbitmq - manager.rabbitmq
- manager.virtualenv - manager.virtualenv
...@@ -13,14 +13,13 @@ manager: ...@@ -13,14 +13,13 @@ manager:
- pkgs: - pkgs:
- postgresql - postgresql
- git - git
- ntp - chrony
- rabbitmq-server - rabbitmq-server
- memcached - memcached
- gettext - gettext
- wget - wget
- swig - swig
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
- python2-pip
- libffi-devel - libffi-devel
- openssl-devel - openssl-devel
- libmemcached-devel - libmemcached-devel
...@@ -29,25 +28,22 @@ manager: ...@@ -29,25 +28,22 @@ manager:
- postgresql-server - postgresql-server
- libxml2-devel - libxml2-devel
- libxslt-devel - libxslt-devel
- python-devel - python3-devel
- python-virtualenvwrapper
{% else %} {% else %}
- python-pip
- libffi-dev - libffi-dev
- libssl-dev - libssl-dev
- libmemcached-dev - libmemcached-dev
- libpq-dev - libpq-dev
- libxml2-dev - libxml2-dev
- libxslt1-dev - libxslt1-dev
- python-dev - python3-dev
- virtualenvwrapper
{% endif %} {% endif %}
- require_in: - require_in:
- service: postgres_service - service: postgres_service
user: user:
- present - present
- name: {{ pillar['user'] }} - name: {{ pillar['user'] }}
- gid_from_name: True - usergroup: True
- shell: /bin/bash - shell: /bin/bash
- groups: - groups:
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
...@@ -56,21 +52,12 @@ manager: ...@@ -56,21 +52,12 @@ manager:
- sudo - sudo
{% endif %} {% endif %}
service: service:
- running - running
- enable: True - enable: True
- watch: - watch:
- file: manager_postactivate - file: manager_postactivate
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} - sls: manager.configuration
- file: /etc/systemd/system/manager.service
- file: /etc/systemd/system/managercelery@.service
{% else %}
- file: /etc/init/manager.conf
- file: /etc/init/mancelery.conf
- file: /etc/init/moncelery.conf
- file: /etc/init/slowcelery.conf
{% endif %}
- sls: manager.gitrepo - sls: manager.gitrepo
portal: portal:
......
{% if grains['os'] == 'Ubuntu' or grains['os'] == 'Debian' %} {% if grains['os'] == 'Ubuntu' or grains['os_family'] == 'Debian' %}
nodejs-legacy: nodejs-legacy:
pkg.installed pkg.installed
{% endif %} {% endif %}
npm: npm:
{% if grains['os'] == 'Ubuntu' or grains['os'] == 'Debian' %} {% if grains['os'] == 'Ubuntu' or grains['os_family'] == 'Debian' %}
pkg.installed: pkg.installed:
- require: - require:
- pkg: nodejs-legacy - pkg: nodejs-legacy
......
...@@ -14,19 +14,21 @@ rabbitmq-server: ...@@ -14,19 +14,21 @@ rabbitmq-server:
- file: rabbitmq-server - file: rabbitmq-server
{% endif %} {% endif %}
virtual_host:
rabbitmq_vhost.present:
- name: {{ pillar['amqp']['vhost']}}
- require:
- service: rabbitmq-server
rabbitmq_user: rabbitmq_user:
rabbitmq_user.present: rabbitmq_user.present:
- name: {{ pillar['amqp']['user'] }} - name: {{ pillar['amqp']['user'] }}
- password: {{ pillar['amqp']['password'] }} - password: {{ pillar['amqp']['password'] }}
- perms: [{ {{ pillar['amqp']['vhost']}}: [.*, .*, .*]}]
# - '{{ pillar['amqp']['vhost']}}':
# - conf: ".*"
# - write: " .*"
# - read: ".*"
- require: - require:
- service: rabbitmq-server - service: rabbitmq-server
virtual_host:
rabbitmq_vhost.present:
- name: {{ pillar['amqp']['vhost']}}
- user: {{ pillar['amqp']['user'] }}
- conf: .*
- write: .*
- read: .*
- require:
- service: rabbitmq-server
...@@ -15,6 +15,7 @@ m2crypto_swig_env: ...@@ -15,6 +15,7 @@ m2crypto_swig_env:
virtualenv_manager: virtualenv_manager:
virtualenv.managed: virtualenv.managed:
- python: /usr/bin/python3
- name: /home/{{ pillar['user'] }}/.virtualenvs/circle - name: /home/{{ pillar['user'] }}/.virtualenvs/circle
- requirements: /home/{{ pillar['user'] }}/circle/requirements/{{ pillar['deployment_type'] }}.txt - requirements: /home/{{ pillar['user'] }}/circle/requirements/{{ pillar['deployment_type'] }}.txt
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
...@@ -26,6 +27,11 @@ virtualenv_manager: ...@@ -26,6 +27,11 @@ virtualenv_manager:
- environ: m2crypto_swig_env - environ: m2crypto_swig_env
{% endif %} {% endif %}
/home/{{ pillar['user'] }}/.virtualenvs/circle/lib/python3.6/site-packages/simplesshkey/models.py:
file.patch:
- source: file:///home/{{ pillar['user'] }}/circle/requirements/simplesshkey.patch
- strip: 5
salt://manager/files/syncdb.sh: salt://manager/files/syncdb.sh:
cmd.script: cmd.script:
- template: jinja - template: jinja
......
include: include:
- profile
- agentdriver - agentdriver
- monitor-client - monitor-client
- vmdriver - vmdriver
......
{% if grains['os']=='Debian' %} /etc/profile.d/virtualenvwrapper.sh:
{# For non-interactive shells, virtualenvwrapper commands file.symlink:
('workon' etc.) are not sourced automatically #} - target: /usr/local/bin/virtualenvwrapper.sh
/etc/profile:
file.append:
- text:
- "#Line below added for Debian by CIRCLE Salt installer"
- . /etc/bash_completion
{% endif %}
...@@ -6,16 +6,14 @@ ...@@ -6,16 +6,14 @@
- group: {{ pillar['user'] }} - group: {{ pillar['user'] }}
- mode: 700 - mode: 700
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %} {% if pillar['init_type'] == 'systemd' %}
/etc/systemd/system/vncproxy.service: /etc/systemd/system/vncproxy.service:
file.managed: file.managed:
- user: root - user: root
- group: root - group: root
- template: jinja - template: jinja
- source: file:///home/{{ pillar['user'] }}/vncproxy/miscellaneous/vncproxy.service - source: file:///home/{{ pillar['user'] }}/vncproxy/miscellaneous/vncproxy.service
{% else %} {% else %}
/etc/init/vncproxy.conf: /etc/init/vncproxy.conf:
file.managed: file.managed:
- user: root - user: root
...@@ -23,3 +21,5 @@ ...@@ -23,3 +21,5 @@
- template: jinja - template: jinja
- source: file:///home/{{ pillar['user'] }}/vncproxy/miscellaneous/vncproxy.conf - source: file:///home/{{ pillar['user'] }}/vncproxy/miscellaneous/vncproxy.conf
{% endif %} {% endif %}
...@@ -7,19 +7,19 @@ vncproxy: ...@@ -7,19 +7,19 @@ vncproxy:
pkg.installed: pkg.installed:
- pkgs: - pkgs:
- git - git
- ntp - chrony
- wget - wget
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
- python2-pip - python3-pip
- libffi-devel - libffi-devel
- openssl-devel - openssl-devel
- python-devel - python3-devel
- python-virtualenvwrapper - python3-virtualenvwrapper
{% else %} {% else %}
- python-pip - python3-pip
- libffi-dev - libffi-dev
- libssl-dev - libssl-dev
- python-dev - python3-dev
- virtualenvwrapper - virtualenvwrapper
{% endif %} {% endif %}
- require_in: - require_in:
......
virtualenv_vncproxy: virtualenv_vncproxy:
virtualenv.managed: virtualenv.managed:
- python: /usr/bin/python3
- name: /home/{{ pillar['user'] }}/.virtualenvs/vncproxy - name: /home/{{ pillar['user'] }}/.virtualenvs/vncproxy
- requirements: /home/{{ pillar['user'] }}/vncproxy/requirements.txt - requirements: /home/{{ pillar['user'] }}/vncproxy/requirements/{{ pillar['deployment_type'] }}.txt
- cwd: /home/{{ pillar['user'] }}/vncproxy
- user: {{ pillar['user'] }} - user: {{ pillar['user'] }}
- no_chown: true - no_chown: true
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