Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBIAN_FRONTEND=noninteractive not working when installing apt-get freeipa-server #1022

Closed
yabhinav opened this issue Feb 23, 2017 · 3 comments

Comments

@yabhinav
Copy link

For reference, look at duplicate Issue on ansible GitHub:
ansible/ansible#21691

SUMMARY

When installing freeipa-server the post installation script try to setup the IPA server or krb5 configuration.
To prevent that apt-get install should be run with DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yf freeipa-server

"export DEBIAN_FRONTEND=noninteractive &&  apt-get install -yf freeipa-server dnsutils sssd-ldap expect "
"DEBIAN_FRONTEND=noninteractive  apt-get install -yf freeipa-server dnsutils sssd-ldap expect "

Installing freeipa-client and freeipa-server with command line fails when running on virutalenv /bin/bash

The issue is probably due to incompatibility with docker 1.13.1 + ubuntu 16.04 + virtualenv

docker exec  "$(cat ${container_id})" bash -c 'source ~/.bashrc; workon ansible_2.2.0.0; ansible --version; export DEBIAN_FRONTEND=noninteractive && apt-get update -q  && apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" freeipa-server freeipa-client '

The same command works on ubuntu:14.04, while it fails on ubuntu:16.04 docker image

Also the following installation command works on ubuntu16:04 when any python virtialenv is not activated
"apt-get update && apt-get -y install freeipa-server"

So the issue is not with docket images but with the python-virtual env , which is installed wither with pip or with apt-get. They are not reading the environment variable DEBIAN_FRONTEND=noninteractive

@yan12125
Copy link

yan12125 commented Feb 24, 2017

I guess you mean export DEBIAN_FRONTEND=noninteractive && apt-get install -yf freeipa-server dnsutils sssd-ldap expect does not work in virtual environments? That works fine for me: https://gist.github.com/yan12125/66a6760a255588c2ca052653b936b1ed

In your commands, workon is provided by virtualenvwrapper, not virtualenv. There were reports that things working with virtualenv are broken with virtualenvwrapper. (#1006) You may want to also report this issue there.

UPDATE: fix the URL of virtualenvwrapper

@yabhinav
Copy link
Author

yabhinav commented Feb 24, 2017

Hi @yan12125 it doesn't work when you are using non-interactive ansible-playbooks or scripts that run on the docker image ubuntu16:04

I have tried to load the environment with source <env_path>/bin/activate, but still failed.Please checkout the logs!! So is it because the environment is created by mkvirtualenv and not virtualenv ??
Or is it because of the packages installed in the virtualenv ?

https://gist.github.com/yabhinav/35bd42af202262f803bc63611d7eda3a

Can you please check once running the command on docker image yabhinav/ansible:ubuntu16.04

docker run -h testlab.example.com --name testlab --rm -it  yabhinav/ansible:ubuntu16.04 /bin/bash

[Update] Added logs for both virtualenv and workon , there are two files in one gist

@dhoppeIT
Copy link

I was able to reproduce the problem. On my MacBook (Python 2.7.15, Virtualenv 16.0.0) everything works fine, but on a CentOS instance (Python 2.7.5, Virtualenv 15.1.0) I cannot install packages in a Docker container (Debian 8, Ubuntu 16.04) because the apt-utils package is missing.

So I uninstalled the python-virtualenv package on the CentOS instances and installed Virtualenv 16.0.0 via pip. I also compiled Python 2.7.15 and created a new Virtualenv, based on that version but the problem still occurs

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants