redhat-openstack / tripleo-quickstart

Ansible roles for setting up TripleO virtual environments and building images
16 stars 15 forks source link

quickstart.sh shouldn't require privileges #22

Closed larsks closed 8 years ago

larsks commented 8 years ago

With 6bd4368, the quickstart.sh script was transformed from something that can be run as a non-root user to something that must be run as root (or via sudo), because now it tries to install packages. This introduces a variety of complications:

I think putting these yum install commands in quickstart.sh was a move in the wrong direction. A better solution would be to error out with an appropriate error message if the commands aren't available.

We should be moving away from requiring additional privileges.

apevec commented 8 years ago

If you have those pre-requirements installed, it wouldn't execute yum install. It was noted in review comments that https://github.com/redhat-openstack/tripleo-quickstart/commit/6bd4368174d1cf3eebdf3ab283d9690e63b5cb19 is wrong direction also for multi-distro support (although if Fedora, dnf-yum should be good enough compat layer) but it is useful to support testday scenario:

larsks commented 8 years ago

@apevec's recent patch takes care of some dependencies by installing packages that provide specific binaries.

Unfortunately, there are other dependencies that can cause quickstart failures; e.g., #29 can be caused if "pip install" fails because of missing dependencies (building pycrypto requires gcc, for example).

I would like to remove all the package installation from quickstart.sh, and ship a separate script that can be used to install all the deps. We can error out with something like "please run sudo ./install-deps.sh to install the necessary dependencies".

trown commented 8 years ago

I like this solution, but we probably need to output instructions on downloading this new script too. Since a new user would not have a cloned repo yet.

larsks commented 8 years ago

Ugh, I keep forgetting that we expect quickstart.sh to run standalone.

trown commented 8 years ago

or we could have install-deps.sh download the quickstart.sh if it does not exist in the directory it is run from, and switch instructions to reference install-deps.sh

trown commented 8 years ago

Or I could just package it already and be done with all of these issues :p

larsks commented 8 years ago

This is resolved by https://review.gerrithub.io/#/c/265955/

apevec commented 8 years ago

Solved with an option which runs privileged: sudo quickstart.sh --install-deps and documented in https://github.com/redhat-openstack/tripleo-quickstart/blob/master/README.md#requirements