From eb1c98d9bc2737c2a0e3d7330659dab6b8929a37 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 7 May 2023 17:06:09 +0200 Subject: [PATCH] Remove unused files --- states/gnuviechadmin/base.sls | 61 ---------------------------- states/gnuviechadmin/celery.sls | 13 ------ states/gnuviechadmin/django.sls | 20 --------- states/gnuviechadmin/gvamysql.sls | 2 - states/gnuviechadmin/vars.sls | 7 ---- states/patches/files/3000-mysql.diff | 13 ------ states/patches/mysql.sls | 19 --------- 7 files changed, 135 deletions(-) delete mode 100644 states/gnuviechadmin/base.sls delete mode 100644 states/gnuviechadmin/celery.sls delete mode 100644 states/gnuviechadmin/django.sls delete mode 100644 states/gnuviechadmin/vars.sls delete mode 100644 states/patches/files/3000-mysql.diff delete mode 100644 states/patches/mysql.sls diff --git a/states/gnuviechadmin/base.sls b/states/gnuviechadmin/base.sls deleted file mode 100644 index fdc1989..0000000 --- a/states/gnuviechadmin/base.sls +++ /dev/null @@ -1,61 +0,0 @@ -{% from 'gnuviechadmin/vars.sls' import home, gva_component, gva_amqp_user, checkout, appdir, venv %} - -{% for host in salt['pillar.get']('gnuviechadmin:machines') %} -{{ host }}: - host.present: - - ip: {{ salt['pillar.get']('gnuviechadmin:machines:%s:ip' % host) }} -{% if salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %} - - names: -{% for machine in salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %} - - {{ machine }} -{% endfor %} -{% endif %} -{% endfor %} - -gnuviechadmin-packages: - pkg.installed: - - pkgs: - - libyaml-dev - - python-virtualenv - - virtualenv - - python-dev - - python-pip - - gettext - -{{ home }}/gvasettings.sh: - file.managed: - - user: vagrant - - group: vagrant - - mode: 0640 - - source: salt://gnuviechadmin/{{ gva_component }}/settings.sh - - template: jinja - - context: - broker_url: {{ 'amqp://%s:%s@mq/%s' % (gva_amqp_user, salt['pillar.get']('gnuviechadmin:queues:users:%s:password' % gva_amqp_user), salt['pillar.get']('gnuviechadmin:queues:vhost')) }} - -gnuviechadmin-venv: - cmd.run: - - name: virtualenv {{ venv }} - - runas: vagrant - - unless: test -f {{ venv }}/bin/pip - -gnuviechadmin-requires: - cmd.run: - - name: {{ venv }}/bin/pip install -U -r requirements/local.txt && touch {{ venv }}/lastinstall - - runas: vagrant - - cwd: {{ checkout }} - - require: - - cmd: gnuviechadmin-venv - - pkg: gnuviechadmin-packages - - unless: test -e {{ venv }}/lastinstall && test {{ checkout }}/requirements/local.txt -ot {{ venv }}/lastinstall && test {{ checkout }}/requirements/base.txt -ot {{ venv }}/lastinstall - -/home/vagrant/.bash_functions: - file.managed: - - user: vagrant - - group: vagrant - - mode: 0644 - - source: salt://base/bash_functions - - template: jinja - - context: - home: {{ home }} - venv: {{ venv }} - appdir: {{ appdir }} diff --git a/states/gnuviechadmin/celery.sls b/states/gnuviechadmin/celery.sls deleted file mode 100644 index b27b504..0000000 --- a/states/gnuviechadmin/celery.sls +++ /dev/null @@ -1,13 +0,0 @@ -{% from 'gnuviechadmin/vars.sls' import home, gva_component, venv, appdir %} - -{{ home }}/bin/run_celery.sh: - file.managed: - - user: vagrant - - group: vagrant - - mode: 0750 - - source: salt://gnuviechadmin/{{ gva_component }}/run_celery.sh - - template: jinja - - context: - home: {{ home }} - virtualenv: {{ venv }} - appdir: {{ appdir }} diff --git a/states/gnuviechadmin/django.sls b/states/gnuviechadmin/django.sls deleted file mode 100644 index 6e57afd..0000000 --- a/states/gnuviechadmin/django.sls +++ /dev/null @@ -1,20 +0,0 @@ -{% from 'gnuviechadmin/vars.sls' import home, appdir, venv %} - -gnuviechadmin-dbschema: - cmd.wait: - - name: . {{ home }}/gvasettings.sh ; unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME ; {{ venv }}/bin/python manage.py migrate --noinput - - runas: vagrant - - cwd: {{ appdir }} - - watch: - - cmd: gnuviechadmin-requires - - file: {{ home }}/gvasettings.sh - -gnuviechadmin-locale-data-compile: - cmd.wait: - - name: . {{ home }}/gvasettings.sh ; {{ venv }}/bin/python {{ appdir }}/manage.py compilemessages - - runas: vagrant - - cwd: {{ appdir }} - - require: - - pkg: gnuviechadmin-packages - - file: {{ home }}/gvasettings.sh - - cmd: gnuviechadmin-venv diff --git a/states/gnuviechadmin/gvamysql.sls b/states/gnuviechadmin/gvamysql.sls index 5b93c8a..206a8b6 100644 --- a/states/gnuviechadmin/gvamysql.sls +++ b/states/gnuviechadmin/gvamysql.sls @@ -3,8 +3,6 @@ {% set mysql_admin_user = salt['pillar.get']('gnuviechadmin:{}:mysql_admin_user'.format(gvaappname), 'gvamysql') %} {% set mysql_admin_password = salt['pillar.get']('gnuviechadmin:{}:mysql_admin_password'.format(gvaappname)) %} {% from 'gnuviechadmin/gvaapp_macros.sls' import create_celery_worker with context %} -# FIXME: this is broken due to https://github.com/saltstack/salt/issues/56124 -# patches.mysql is needed to be run on the minion before usage with Salt 3000 include: - python.poetry - mariadb-server diff --git a/states/gnuviechadmin/vars.sls b/states/gnuviechadmin/vars.sls deleted file mode 100644 index 6ad1aa2..0000000 --- a/states/gnuviechadmin/vars.sls +++ /dev/null @@ -1,7 +0,0 @@ -{% set home = '/home/vagrant' %} -{% set venv = home + '/gva-venv' %} -{% set checkout = '/vagrant' %} -{% set gva_component = salt['pillar.get']('gnuviechadmin:component:name') %} -{% set gva_amqp_user = salt['pillar.get']('gnuviechadmin:component:amqp_user') %} -{% set python_module = salt['pillar.get']('gnuviechadmin:component:python_module', gva_component) %} -{% set appdir = checkout + '/' + python_module %} diff --git a/states/patches/files/3000-mysql.diff b/states/patches/files/3000-mysql.diff deleted file mode 100644 index 3a0287c..0000000 --- a/states/patches/files/3000-mysql.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py -index 87e2361e28..37436206d4 100644 ---- a/salt/modules/mysql.py -+++ b/salt/modules/mysql.py -@@ -355,7 +355,7 @@ def _connect(**kwargs): - except IndexError: - return - val = __salt__['config.option']('mysql.{0}'.format(name), None) -- if val is not None: -+ if val != '': - connargs[key] = val - - # If a default file is explicitly passed to kwargs, don't grab the diff --git a/states/patches/mysql.sls b/states/patches/mysql.sls deleted file mode 100644 index d75e4a0..0000000 --- a/states/patches/mysql.sls +++ /dev/null @@ -1,19 +0,0 @@ -{% if grains.saltversion == "3000" %} -patch: - pkg.installed - -mysql_module_patch: - file.patch: - - name: '{{ grains.saltpath }}' - - source: salt://patches/files/3000-mysql.diff - - strip: 2 - - require: - - pkg: patch - -restart_salt_minion: - cmd.run: - - name: 'salt-call service.restart salt-minion' - - bg: true - - onchanges: - - file: mysql_module_patch -{%- endif %}