From 01fad4fddb3d9efb013ed5cf87bc65d6ddba9dbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Tue, 29 Sep 2020 16:31:11 +0200
Subject: [PATCH] Set ANSIBLE_CONFIG path in ansible commands of Makefile |
 refs #32734

---
 .devcontainer/devcontainer.json | 20 ++++----------------
 Makefile                        |  9 +++++----
 2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 3c161363..bc0d6b44 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -16,22 +16,10 @@
     ],
     "settings": {
         "files.associations": {
-            "**/ansible/requirements.in/*.txt": "pip-requirements",
-            "ansible/requirements.*.txt": "pip-requirements",
-            "**/defaults/**/*": "ansible",
-            "**/tasks/**/*.yml": "ansible",
-            "**/handler/*.yml": "ansible",
-            "**/*_vars/**/*.yml": "ansible",
-            "**/roles/**/*.yml": "ansible",
-            "**/role.d/**/*.yml": "ansible",
-            "**/playbooks/**/*.yml": "ansible",
-            "**/playbook.d/**/*.yml": "ansible",
-            "**/*ansible*/**/*.yml": "ansible",
-            "**/vars/**/*.yml": "ansible",
-            "**/inventories/**/hosts": "ini",
-            "**/inventories/**/*": "ansible",
-            "**/inventory/**/*": "ansible",
-            "**/inventory.d/**/*": "ansible"
+            "**/ansible/requirements*.in": "pip-requirements",
+            "**/ansible/requirements*.txt": "pip-requirements",
+            "**/ansible/*/*/*.yml": "ansible",
+            "**/ansible/inventories/*/hosts": "ini",
         },
         "python.pythonPath": "/home/code/pyvenv/bin/python",
         "python.formatting.provider": "black",
diff --git a/Makefile b/Makefile
index d020a117..f860b9c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 SHELL := /bin/bash
 DOCKER_IMAGE_NAME := registry.ubicast.net/mediaserver/envsetup
 VENV := /tmp/pyvensetup
+ANSIBLE_CONFIG := ansible/ansible.cfg
 PIP_BIN = $(shell command -v $(VENV)/bin/pip3 || command -v pip3 || echo pip3)
 PIP_COMPILE_BIN = $(shell command -v $(VENV)/bin/pip-compile || command -v pip-compile)
 ANSIBLE_BIN = $(shell command -v ansible || command -v $(VENV)/bin/ansible)
@@ -39,7 +40,7 @@ venv:
 install: venv
 	$(PIP_BIN) install -U pip wheel
 	$(PIP_BIN) install -r ansible/requirements.txt
-	$(ANSIBLE_GALAXY_BIN) install -r ansible/requirements.yml
+	ANSIBLE_CONFIG=$(ANSIBLE_CONFIG) $(ANSIBLE_GALAXY_BIN) install -r ansible/requirements.yml
 
 
 .PHONY: install-dev
@@ -54,7 +55,7 @@ install-dev: install
 lint:
 	$(FLAKE8_BIN) .
 	$(YAMLLINT_BIN) .
-	$(ANSIBLE_LINT_BIN) ansible/playbooks/site.yml
+	ANSIBLE_CONFIG=$(ANSIBLE_CONFIG) $(ANSIBLE_LINT_BIN) ansible/playbooks/site.yml
 
 .PHONY: test
 ## test: Run development tests on the project : debug=1, keep=1, SKYREACH_SYSTEM_KEY=<xxx>
@@ -76,8 +77,8 @@ endif
 ifndef t
 	$(eval t=all)
 endif
-	$(ANSIBLE_BIN) -i $(i) -l $(l) -m ping all
-	$(ANSIBLE_PLAYBOOK_BIN) -i $(i) ansible/playbooks/site.yml -e conf_update=true -l $(l) -t $(t)
+	ANSIBLE_CONFIG=$(ANSIBLE_CONFIG) $(ANSIBLE_BIN) -i $(i) -l $(l) -m ping all
+	ANSIBLE_CONFIG=$(ANSIBLE_CONFIG) $(ANSIBLE_PLAYBOOK_BIN) -i $(i) playbooks/site.yml -e conf_update=true -l $(l) -t $(t)
 
 .PHONY: image-validate
 ## image-validate: Check that Packer image is valid : build=<path-to-packer-file>
-- 
GitLab