diff --git a/makefiles/netbox_inventory_manager/Makefile b/makefiles/netbox_inventory_manager/Makefile index d211913cb54b29cfe2ab6aea4963b26f692fd4d4..d6afdbca741b7a565175da473a94bbf022037d20 100644 --- a/makefiles/netbox_inventory_manager/Makefile +++ b/makefiles/netbox_inventory_manager/Makefile @@ -8,7 +8,8 @@ TARGET_DIR=../../../gosdn/internal/netboxapi NETBOX_VERSION=4.2.8 NETBOX_DOCKER_VERSION=3.2.0 GOIMPORTS := $(shell go env GOPATH)/bin/goimports -USER_NAME := fabii +USER_NAME := fabi +CONFIG_DIR=../../applications/inventory-manager-netbox/config/configNetbox.yaml .PHONY: reset @@ -95,7 +96,6 @@ build: goimports -w $$(find . -name '*.go') - .PHONY: copy copy: @echo ">> Copying generated API to $(TARGET_DIR)..." @@ -116,9 +116,9 @@ clean: .PHONY: netboxstarten netboxstarten: @echo ">> PULL NetBox Docker with..." - cd ../../../netbox-docker && docker compose pull -d + cd ../../../netbox-docker && docker compose pull @echo ">> UP NetBox Docker with..." - cd ../../../netbox-docker && docker compose up -d + cd ../../../netbox-docker && docker compose up @echo ">> NetBox Docker started." @echo ">> http://127.0.0.1:8000/ @@ -129,7 +129,7 @@ netboxsuperuser: cd ../../../netbox-docker && docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser --username $(USER_NAME) --email $(USER_NAME)@example.com - .PHONY: netboxToken +.PHONY: netboxToken netboxToken: @echo ">> Creating API token for user '$(USER_NAME)'..." docker compose -f ../../../netbox-docker/docker-compose.yml exec netbox /opt/netbox/netbox/manage.py shell -c "\ @@ -142,6 +142,7 @@ print(token.key)" > .tmp_token.txt && \ TOKEN=$$(tail -n1 .tmp_token.txt) && \ rm .tmp_token.txt && \ mkdir -p ../../applications/inventory-manager-netbox/config && \ - echo "NetboxAddress: \"127.0.0.1:8000\"" > ../../applications/inventory-manager-netbox/config/configNetbox.yaml && \ - echo "ApiToken: \"$$TOKEN\"" >> ../../applications/inventory-manager-netbox/config/configNetbox.yaml && \ - echo "✅ Token written to configNetbox.yaml" + echo "NetboxAddress: \"127.0.0.1:8000\"" > $(CONFIG_DIR) && \ + echo "ApiToken: \"$$TOKEN\"" >> $(CONFIG_DIR) && \ + echo "Token written to configNetbox.yaml complete" +