mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-22 08:11:09 +02:00
Changed snipe-it to web-app-snipe-it and additional optimations
This commit is contained in:
parent
867b377115
commit
2db5f75888
@ -17,7 +17,7 @@ ports:
|
|||||||
phpldapadmin: 4186
|
phpldapadmin: 4186
|
||||||
fusiondirectory: 4187
|
fusiondirectory: 4187
|
||||||
web-app-gitea: 4188
|
web-app-gitea: 4188
|
||||||
snipe-it: 4189
|
web-app-snipe-it: 4189
|
||||||
ldap:
|
ldap:
|
||||||
svc-db-openldap: 389
|
svc-db-openldap: 389
|
||||||
http:
|
http:
|
||||||
@ -56,7 +56,7 @@ ports:
|
|||||||
web-app-keycloak: 8032
|
web-app-keycloak: 8032
|
||||||
web-app-lam: 8033
|
web-app-lam: 8033
|
||||||
web-app-phpmyadmin: 8034
|
web-app-phpmyadmin: 8034
|
||||||
snipe-it: 8035
|
web-app-snipe-it: 8035
|
||||||
sphinx: 8036
|
sphinx: 8036
|
||||||
phpldapadmin: 8037
|
phpldapadmin: 8037
|
||||||
fusiondirectory: 8038
|
fusiondirectory: 8038
|
||||||
|
@ -62,7 +62,7 @@ defaults_networks:
|
|||||||
subnet: 192.168.102.128/28
|
subnet: 192.168.102.128/28
|
||||||
pgadmin:
|
pgadmin:
|
||||||
subnet: 192.168.102.144/28
|
subnet: 192.168.102.144/28
|
||||||
snipe-it:
|
web-app-snipe-it:
|
||||||
subnet: 192.168.102.160/28
|
subnet: 192.168.102.160/28
|
||||||
taiga:
|
taiga:
|
||||||
subnet: 192.168.102.176/28
|
subnet: 192.168.102.176/28
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
version: "latest"
|
|
||||||
features:
|
features:
|
||||||
matomo: true
|
matomo: true
|
||||||
css: false
|
css: false
|
||||||
@ -33,3 +32,10 @@ docker:
|
|||||||
enabled: true
|
enabled: true
|
||||||
database:
|
database:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
snipe-it:
|
||||||
|
version: "latest"
|
||||||
|
name: "snipe-it"
|
||||||
|
image: "grokability/snipe-it"
|
||||||
|
volumes:
|
||||||
|
data: "snipe-it_data"
|
||||||
|
|
@ -15,30 +15,30 @@
|
|||||||
- name: "Debug: show APP_KEY in container shell"
|
- name: "Debug: show APP_KEY in container shell"
|
||||||
shell: |
|
shell: |
|
||||||
docker-compose exec -T \
|
docker-compose exec -T \
|
||||||
-u www-data \
|
-u {{ snipe_it_user }} \
|
||||||
-e XDG_CONFIG_HOME=/tmp \
|
-e XDG_CONFIG_HOME=/tmp \
|
||||||
-e APP_KEY='{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}' \
|
-e APP_KEY='{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}' \
|
||||||
application \
|
application \
|
||||||
sh -c 'echo "SHELL sees APP_KEY=$APP_KEY"'
|
sh -c 'echo "SHELL sees APP_KEY=$APP_KEY"'
|
||||||
args:
|
args:
|
||||||
chdir: "/opt/docker/snipe-it/"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
|
|
||||||
- name: "Debug: show APP_KEY in container shell"
|
- name: "Debug: show APP_KEY in container shell"
|
||||||
shell: |
|
shell: |
|
||||||
docker-compose exec -T -u www-data \
|
docker-compose exec -T -u {{ snipe_it_user }} \
|
||||||
-e XDG_CONFIG_HOME=/tmp \
|
-e XDG_CONFIG_HOME=/tmp \
|
||||||
-e APP_KEY="{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}" \
|
-e APP_KEY="{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}" \
|
||||||
application \
|
application \
|
||||||
php artisan tinker --execute="echo 'CONFIG app.key: ' . config('app.key') . PHP_EOL;"
|
php artisan tinker --execute="echo 'CONFIG app.key: ' . config('app.key') . PHP_EOL;"
|
||||||
args:
|
args:
|
||||||
chdir: "/opt/docker/snipe-it/"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
|
|
||||||
- name: "Set all LDAP settings via Laravel Setting model (inside container as www-data)"
|
- name: "Set all LDAP settings via Laravel Setting model (inside container as {{ snipe_it_user }})"
|
||||||
shell: |
|
shell: |
|
||||||
docker-compose exec -T \
|
docker-compose exec -T \
|
||||||
-e APP_KEY='{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}' \
|
-e APP_KEY='{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}' \
|
||||||
-e XDG_CONFIG_HOME=/tmp \
|
-e XDG_CONFIG_HOME=/tmp \
|
||||||
-u www-data application \
|
-u {{ snipe_it_user }} application \
|
||||||
sh -c 'php artisan tinker << "EOF"
|
sh -c 'php artisan tinker << "EOF"
|
||||||
$s = \App\Models\Setting::getSettings();
|
$s = \App\Models\Setting::getSettings();
|
||||||
$s->ldap_enabled = 1;
|
$s->ldap_enabled = 1;
|
||||||
@ -74,7 +74,7 @@
|
|||||||
- name: Encrypt & save LDAP bind password via Crypt + DB façade
|
- name: Encrypt & save LDAP bind password via Crypt + DB façade
|
||||||
shell: |
|
shell: |
|
||||||
docker-compose exec -T \
|
docker-compose exec -T \
|
||||||
-u www-data \
|
-u {{ snipe_it_user }} \
|
||||||
-e APP_KEY="{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}" \
|
-e APP_KEY="{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}" \
|
||||||
-e XDG_CONFIG_HOME=/tmp \
|
-e XDG_CONFIG_HOME=/tmp \
|
||||||
application \
|
application \
|
||||||
@ -93,14 +93,14 @@
|
|||||||
echo 'Stored: ' . \$encrypted . PHP_EOL;
|
echo 'Stored: ' . \$encrypted . PHP_EOL;
|
||||||
"
|
"
|
||||||
args:
|
args:
|
||||||
chdir: "/opt/docker/snipe-it/"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
register: ldap_encrypt
|
register: ldap_encrypt
|
||||||
failed_when: ldap_encrypt.rc != 0
|
failed_when: ldap_encrypt.rc != 0
|
||||||
|
|
||||||
- name: "Clear Laravel config & cache (inside container as www-data)"
|
- name: "Clear Laravel config & cache (inside container as {{ snipe_it_user }})"
|
||||||
shell: |
|
shell: |
|
||||||
docker-compose exec -T -u www-data application php artisan config:clear
|
docker-compose exec -T -u {{ snipe_it_user }} application php artisan config:clear
|
||||||
docker-compose exec -T -u www-data application php artisan cache:clear
|
docker-compose exec -T -u {{ snipe_it_user }} application php artisan cache:clear
|
||||||
args:
|
args:
|
||||||
chdir: "{{ docker_compose.directories.instance }}"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
notify: docker compose up
|
notify: docker compose up
|
@ -3,7 +3,6 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: cmp-db-docker-proxy
|
name: cmp-db-docker-proxy
|
||||||
|
|
||||||
|
|
||||||
- name: "Configure Snipe-IT LDAP settings"
|
- name: "Configure Snipe-IT LDAP settings"
|
||||||
import_tasks: ldap.yml
|
import_tasks: ldap.yml
|
||||||
when: applications | get_app_conf(application_id, 'features.ldap', False)
|
when: applications | get_app_conf(application_id, 'features.ldap', False)
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
||||||
|
|
||||||
|
# Container Configuration
|
||||||
|
|
||||||
application:
|
application:
|
||||||
{% set container_port = 80 %}
|
{% set container_port = 80 %}
|
||||||
image: grokability/snipe-it:{{applications | get_app_conf(application_id, 'version', True)}}
|
image: "{{ snipe_it_image }}:{{ snipe_it_version }}"
|
||||||
|
container_name: "{{ snipe_it_container }}"
|
||||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/lib/snipeit
|
- data:/var/lib/snipeit
|
||||||
@ -11,8 +14,12 @@
|
|||||||
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
||||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
||||||
{% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %}
|
{% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %}
|
||||||
|
|
||||||
|
# Compose Configuration
|
||||||
|
|
||||||
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
||||||
redis:
|
redis:
|
||||||
data:
|
data:
|
||||||
|
name: "{{ snipe_it_volume }}"
|
||||||
|
|
||||||
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
|
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
application_id: "snipe-it"
|
application_id: "web-app-snipe-it"
|
||||||
database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
|
database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
|
||||||
database_type: "mariadb"
|
database_type: "mariadb"
|
||||||
snipe_it_url: "{{ domains | get_url(application_id, web_protocol) }}"
|
snipe_it_url: "{{ domains | get_url(application_id, web_protocol) }}"
|
||||||
|
snipe_it_version: "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.version', True) }}"
|
||||||
|
snipe_it_image: "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.image', True) }}"
|
||||||
|
snipe_it_name: "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.name', True) }}"
|
||||||
|
snipe_it_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
|
||||||
|
snipe_it_user: "www-data"
|
Loading…
x
Reference in New Issue
Block a user