Не отдаётся переменная из /etc/environment при использовании с Ansible

Сообщения
1
#1
Добрый день.
Использую образ AstraLinux 1.7 и ставлю на него средствами Ansible пакет Liberica JDK.
После установки прописываю также удалённо с помощью Ansible переменную MY_JAVA_HOME в /etc/environment и пытаюсь её вызвать при установке другого приложения.
Она не находится приложением, потому что в ansible_env попадают все переменные из bash_rc и др. , а MY_JAVA_HOME из /etc/environment не подтягивается, хотя она там реально есть.
В ОС сам не захожу, все действия неинтерактивные.
На RedHat/OEL всё в порядке.

Подскажите, пожалуйста, в чём может быть дело.

Пример вывода Astra:
Код:
[09:49:16][Step 4/5] TASK [Debug env variable] ******************************************************
[09:49:16][Step 4/5] ok: [app.tf2] => {
[09:48:50][Step 4/5]     "ansible_env": {
[09:48:50][Step 4/5]         "HOME": "/root",
[09:48:50][Step 4/5]         "LANG": "C.UTF-8",
[09:48:50][Step 4/5]         "LC_ADDRESS": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_ALL": "C.UTF-8",
[09:48:50][Step 4/5]         "LC_COLLATE": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_CTYPE": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_IDENTIFICATION": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_MEASUREMENT": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_MESSAGES": "C.UTF-8",
[09:48:50][Step 4/5]         "LC_MONETARY": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_NAME": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_NUMERIC": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_PAPER": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_TELEPHONE": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LC_TIME": "ru_RU.UTF-8",
[09:48:50][Step 4/5]         "LOGNAME": "root",
[09:48:50][Step 4/5]         "MAIL": "/var/mail/root",
[09:48:50][Step 4/5]         "PATH": "/usr/lib/parsec/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
[09:48:50][Step 4/5]         "PWD": "/home/other-user",
[09:48:50][Step 4/5]         "SHELL": "/bin/bash",
[09:48:50][Step 4/5]         "SHLVL": "1",
[09:48:50][Step 4/5]         "SUDO_COMMAND": "/bin/sh -c echo BECOME-SUCCESS-gggonoorrxhgqvnzbsxutubqricnkhrn ; /usr/bin/python3.7",
[09:48:50][Step 4/5]         "SUDO_GID": "1000",
[09:48:50][Step 4/5]         "SUDO_UID": "1000",
[09:48:50][Step 4/5]         "SUDO_USER": "other-user",
[09:48:50][Step 4/5]         "TERM": "unknown",
[09:48:50][Step 4/5]         "USER": "root",
[09:48:50][Step 4/5]         "_": "/usr/bin/python3.7"
[09:48:50][Step 4/5]     }
[09:48:50][Step 4/5] }
Пример вывода OEL:
Код:
[09:49:16][Step 4/5] TASK [Debug env variable] ******************************************************
[09:49:16][Step 4/5] ok: [app.tf3] => {
[09:49:16][Step 4/5]     "ansible_env": {
[09:49:16][Step 4/5]         "HOME": "/root",
[09:49:16][Step 4/5]         "LANG": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_ADDRESS": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_ALL": "en_US.UTF-8",
[09:49:16][Step 4/5]         "LC_COLLATE": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_CTYPE": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_IDENTIFICATION": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_MEASUREMENT": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_MESSAGES": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_MONETARY": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_NAME": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_NUMERIC": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_PAPER": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_TELEPHONE": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LC_TIME": "ru_RU.UTF-8",
[09:49:16][Step 4/5]         "LOGNAME": "root",
[09:49:16][Step 4/5]         "MAIL": "/var/mail/root",
[09:49:16][Step 4/5]         "MY_JAVA_HOME": "/opt/jdk/jdk-11.0.14.1+1",                     #<-------------------------------------вот она на OEL
[09:49:16][Step 4/5]         "PATH": "/sbin:/bin:/usr/sbin:/usr/bin",
[09:49:16][Step 4/5]         "PWD": "/home/other-user",
[09:49:16][Step 4/5]         "SHELL": "/bin/bash",
[09:49:16][Step 4/5]         "SHLVL": "1",
[09:49:16][Step 4/5]         "SUDO_COMMAND": "/bin/sh -c echo BECOME-SUCCESS-iudjzzihwkrwvhlinulgibxjlryqfrjx ; /usr/libexec/platform-python",
[09:49:16][Step 4/5]         "SUDO_GID": "1000",
[09:49:16][Step 4/5]         "SUDO_UID": "1000",
[09:49:16][Step 4/5]         "SUDO_USER": "other-user",
[09:49:16][Step 4/5]         "TERM": "unknown",
[09:49:16][Step 4/5]         "USER": "root",
[09:49:16][Step 4/5]         "_": "/usr/libexec/platform-python"
[09:49:16][Step 4/5]     }
[09:49:16][Step 4/5] }