[FOLIO-3171] folio-ansible: environment variables dont make it to docker Created: 21/May/21 Updated: 16/Jul/21 Resolved: 16/Jul/21 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | TBD |
| Reporter: | Florian Gleixner | Assignee: | Wayne Schneider |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Sprint: | DevOps Sprint 116, DevOps Sprint 115, DevOps Sprint 117, DevOps Sprint 118 |
| Development Team: | FOLIO DevOps |
| Release: | R1 2021 |
| Description |
|
Overview:
Expected Results: Ansible Playbook error: TASK [okapi-tenant-deploy : Post install list for deployment and enabling] ********************************************************************************************************************************************************************
Looking at the okapi log, i see: 2021-05-21T20:27:08,505 INFO DockerModuleHandle mod-search-1.3.0 20:27:08.500 [main] ERROR org.springframework.boot.SpringApplication - Application run failed "
So mod-search cannot run. With docker inspect i can see the environment: "Env": [
which is missing the OKAPI_URL Environment. Meanwhile checking the Ansible Output, i see: TASK [okapi-tenant-deploy : Build install list for modules with deployment] ******************************************************************************************************************************************************************* .... ok: [138.246.234.10] => (item={'name': 'mod-search', 'version': '1.3.0', 'deploy': True, 'docker_env': [{'name': 'ELASTICSEARCH_URL', 'value': 'http://192.168.128.89:9301'}, {'name': 'OKAPI_URL', 'value': 'http://192.168.128.89:9130'}, {'n
Where OKAPI_URL and ELASTICSEARCH_URL are correctly set. The same happens to other modules with special environment like mod-pubsub. I did not yet find the point where the environment gets lost. Happens on folio-ansible main and r1-2021-release, does not happen on q3-2020-release Additional Information: |
| Comments |
| Comment by Wayne Schneider [ 15/Jul/21 ] |
|
Florian Gleixner sorry for the delay in getting to this issue. My notes here assume that you are using Okapi to deploy modules on a host using the Docker daemon. Obviously, if you are deploying modules using some other mechanism, you will need to control the module environment using those tools. Okapi provides environment variables to modules it deploys in three ways, I believe in this order (i.e. the first one wins):
folio-ansible supports all three of these with different roles in different ways. I think the problem you are running into has to do with some very confusing roles in folio-ansible that are tricky to try to keep straight. Sorry about that, I probably wrote the code several years ago, and I find it tricky to keep straight
Some models for using these roles can be found in the folio.yml file in folio-ansible (used by CI in combination with the files in group_vars to build Vagrant boxes). I hope that helps! I do not think there is actually a bug here, just some confusing code that lacks documentation. |
| Comment by Florian Gleixner [ 16/Jul/21 ] |
|
Hi Wayne, thank you for explanations. I was able to install folio with folio-ansible at 7.june, and with your explanations, i think the commit https://github.com/folio-org/folio-ansible/commit/98180e5b3dbccba60e1e81a0ae04a3299ad1317e fixed my issue. Folio-ansible could be a great alternative for the single server installation method. We should describe it better in the documentation. Thank you!
Florian |
| Comment by Wayne Schneider [ 16/Jul/21 ] |
|
Great, I'm glad I accidentally fixed your issue in early June – so there was a bug! The single-server installation documentation was originally built by reverse engineering the folio.yml playbook in folio-ansible. Unfortunately, the project does not currently have the DevOps resources available to maintain it very well. |