From 2ce8bce0e7a12a4d164f7aa8355c68324a45cfc7 Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Mon, 2 Aug 2021 17:28:20 +0200 Subject: [PATCH] updated from im to nmgfitness --- README.md | 4 ++-- meta/main.yml | 12 +++--------- tasks/main.yml | 16 ++++++++-------- templates/im.service.j2 | 4 ++-- templates/settings.py.j2 | 9 +++++---- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 071b202..7d69ac2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Role Name ========= -This role installs IM: https://gitea.caret.be/jens/im +This role installs nmgfitness: https://gitea.caret.be/jens/nmgfitness Requirements ------------ @@ -36,7 +36,7 @@ Example Playbook - name: "Install im pantry app" hosts: im roles: - - ansible-role-im + - ansible-role-nmgfitness vars: - im_domain: "im.example.com" - im_http_listen: "{{inventory_hostname}}" diff --git a/meta/main.yml b/meta/main.yml index 7a73553..dd6671f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,9 +1,9 @@ galaxy_info: - role_name: ansible_role_im + role_name: ansible_role_nmgfitness author: Jens Timmerman - description: This role installs the im pantry app (https://gitea.caret.be/jens/im) + description: This role installs the nmg fitness app (https://gitea.caret.be/jens/nmgfitness) - issue_tracker_url: https://gitea.caret.be/jens/im/issues + issue_tracker_url: https://gitea.caret.be/jens/nmgfitness/issues # - GPL-3.0-only license: GPL-3.0-only @@ -24,12 +24,6 @@ galaxy_info: versions: - 8 - galaxy_tags: - - inventory - - management - - pantry - - food - dependencies: [] # List your role dependencies here, one per line. Be sure to remove the '[]' above, # if you add dependencies to this list. diff --git a/tasks/main.yml b/tasks/main.yml index 7f2d628..88af79f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,7 +21,7 @@ - name: 'download latest im stable' get_url: dest: "{{im_home}}/im-latest.tar.gz" - url: https://gitea.caret.be/jens/im/archive/main.tar.gz + url: https://gitea.caret.be/jens/nmgfitness/archive/main.tar.gz owner: im group: im mode: '0400' @@ -29,7 +29,7 @@ - name: 'remove previous install stable' file: - dest: "{{im_home}}/im" + dest: "{{im_home}}/nmgfitness" state: absent - name: 'unarchive latest im stable' @@ -57,7 +57,7 @@ - name: "Configure im" template: src: "settings.py.j2" - dest: "{{im_home}}/im/im/settings.py" + dest: "{{im_home}}/nmgfitness/nmgfitness/settings.py" owner: "{{ im_user }}" mode: 0600 notify: "Restart im" @@ -65,14 +65,14 @@ - name: 'migrate django im app' django_manage: command: migrate - app_path: "{{im_home}}/im" + app_path: "{{im_home}}/nmgfitness" become: true become_user: "{{im_user}}" - name: check if django superuser exists django_manage: command: 'shell -c "from django.contrib.auth.models import User; print(User.objects.filter(is_superuser=True).exists())"' - app_path: "{{im_home}}/im" + app_path: "{{im_home}}/nmgfitness" register: superuser_exists become: true become_user: "{{im_user}}" @@ -80,7 +80,7 @@ - name: "create superjuser for django im app if it doesn't exist" django_manage: command: "createsuperuser --noinput --username=admin --email={{im_admin_email}}" - app_path: "{{im_home}}/im" + app_path: "{{im_home}}/nmgfitness" become: true become_user: "{{im_user}}" when: superuser_exists.out.find("True") == -1 @@ -88,14 +88,14 @@ - name: "set superjuser password" django_manage: command: shell -c "from django.contrib.auth.models import User; usr = User.objects.get(username='admin'); usr.set_password('{{im_admin_password}}'); usr.save()" - app_path: "{{im_home}}/im" + app_path: "{{im_home}}/nmgfitness" become: true become_user: "{{im_user}}" - name: 'collect static content' django_manage: command: "collectstatic" - app_path: "{{im_home}}/im" + app_path: "{{im_home}}/nmgfitness" - name: "Service im" service: diff --git a/templates/im.service.j2 b/templates/im.service.j2 index 636b8ee..c7776a9 100644 --- a/templates/im.service.j2 +++ b/templates/im.service.j2 @@ -4,8 +4,8 @@ After=network.target [Service] User=root -WorkingDirectory={{ im_home }}/im -ExecStart=gunicorn -g={{im_user}} -u={{im_user}} --workers {{im_workers}} --bind {{ im_http_listen }}:{{ im_http_port }} im.wsgi:application +WorkingDirectory={{ im_home }}/nmgfitness +ExecStart=gunicorn -g={{im_user}} -u={{im_user}} --workers {{im_workers}} --bind {{ im_http_listen }}:{{ im_http_port }} nmgfitness.wsgi:application Restart=on-failure diff --git a/templates/settings.py.j2 b/templates/settings.py.j2 index 599b0de..0ed1d48 100644 --- a/templates/settings.py.j2 +++ b/templates/settings.py.j2 @@ -39,7 +39,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'inventory.apps.InventoryConfig', + 'nmgfitness', ] MIDDLEWARE = [ @@ -53,7 +53,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'im.urls' +ROOT_URLCONF = 'nmgfitness.urls' TEMPLATES = [ { @@ -71,7 +71,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'im.wsgi.application' +WSGI_APPLICATION = 'nmgfitness.wsgi.application' # Database @@ -139,7 +139,8 @@ USE_I18N = True USE_L10N = True -USE_TZ = True +#USE_TZ = True +USE_TZ = False # Static files (CSS, JavaScript, Images)