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

revise readme for multiple host os #20

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

revise readme for multiple host os #20

wants to merge 17 commits into from

Conversation

smartbit
Copy link
Collaborator

Initial draft for revised README.md. Does not close #11 as Windows setup is TODO.

@AnwarYagoub Please reword/rewrite unclear sentences. Let me know what you think.

Copy link
Owner

@AnwarYagoub AnwarYagoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smartbit

sorry for late reply (as usual) I was busy last week.
I have don the following :

  • reviewed your changes & put in-line review in a couple of files.
  • test instructions on ubuntu.md file.

ssh-keygen -R 192.168.4.220; ssh-copy-id root@192.168.4.220
vagrant halt # shutdown all machines
vagrant status # all 4 have state poweroff
vagrant snapshot save begin # create a VM snapshot
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is nice that you added a snapshot part

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, in case of errors you can give it a clean start. Should also work on platforms other than Virtualbox.

Sander sometimes assumes changes made in previous chapters, sometimes he doesn't. IMHO a candidate RHCSA should be able to make a small script or flip back a few pages, to get on the same page were Sander assumes you are.


**1.1 Install virtualbox on Ubuntu:**
## install Vagrant
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heading should be Install Dependencies not install Vagrant because we are install both vagrant and virtualization hypervisors either kvm or virtualbox & the section above it in README.md should be called Dependencies.

Copy link
Collaborator Author

@smartbit smartbit Dec 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, see 373c8c7. Current Vagrantfile assumes Virtualbox, KVM hasn't been implemented yet.

wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` non-free contrib" > /etc/apt/sources.list.d/virtualbox.org.list'
sudo apt-get update
sudo apt-get install dkms
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can reduce the lines by put package names in one command:
sudo apt-get install git dkms virtualbox-5.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like 8058808?

@smartbit
Copy link
Collaborator Author

smartbit commented Dec 2, 2016

If you have time, please test. Eg. a clean install in a hypervisor with nested virtualisation support.

One day we should automate testing, but that is another story...

sudo reboot
```

```shell
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smartbit I think we can organize it better

# Generate SSH key to use when accessing machies
ssh-keygen -t rsa -b 4096 -N "" -C "root@example.com" -f ~/.ssh/rhce # empty password

# Make adding SSH key load to ssh agent automatic
eval $(ssh-agent); echo $'eval $(ssh-agent)' >> ~/.profile
ssh-add ~/.ssh/rhce; echo $'ssh-add ~/.ssh/rhce' >> ~/.profile

# Add Virtualbox GPG Key & repository
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` non-free contrib" > /etc/apt/sources.list.d/virtualbox.org.list'

# TODO remove linestarve.com and use alternative method to get latest version of vagrant
# Add a repository to download vagrant
sudo bash -c 'echo deb http://vagrant-deb.linestarve.com/ any main > /etc/apt/sources.list.d/wolfgang42-vagrant.list'
sudo apt-key adv --keyserver pgp.mit.edu --recv-key AD319E0F7CFFA38B4D9F6E55CE3F3DE92099F7A4

# Update packages list
sudo apt update

# TODO remove virtualbox version-number and automatically install latest version; dkms needed when upgrading kernel
# Install packages
sudo apt -y --force-yes install virtualbox-5.1 git vagrant # virtualbox-ext-pack dkms

# Download (clone) lab environment from GitHub
cd ~
git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git
cd ~/RHCSA-RHCE-Lab-Environment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more comment is (almost) always better. Please push to the branch update_readme

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will pull the latest changes and add comments.


```shell
sudo apt update
sudo apt -y --force-yes upgrade
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using --force-yes man page for this command says:

--force-yes
           Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful.
           It should not be used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item:
           APT::Get::force-yes. This is deprecated and replaced by --allow-downgrades, --allow-remove-essential, --allow-change-held-packages in
           1.1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw it, the --allow* descriptions and which to choose wasn't easy to find. Please suggest one.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to force installing packages I can see why we need it !!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, now removed

wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` non-free contrib" > /etc/apt/sources.list.d/virtualbox.org.list'
# TODO remove linestarve.com and use alternative method to get latest version of vagrant
sudo bash -c 'echo deb http://vagrant-deb.linestarve.com/ any main > /etc/apt/sources.list.d/wolfgang42-vagrant.list'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make installing vagrant easy 👍

@AnwarYagoub
Copy link
Owner

If you have time, please test. Eg. a clean install in a hypervisor with nested virtualisation support.

I will try to do so. VirtualBox does not supprt nested virtualization check this link.

KVM may do it for us.

One day we should automate testing, but that is another story...

Definitely we should do so. I know nothing about test so I should read about it.


# Get vagrant version
export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {b=a[1]} END {print b}'` # depends on yum sorting
export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smartbit
why two exports with the same variable name virtualbox_version ?
the last one will override the first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was studying regex, sed & awk and came up with several alternatives. The other.md files have similar pairs and in c6bcfb3 you'll find even more alternatives.

What do you think, should we depend on the output order of yum & html pages, or should awk do the sorting? Any other suggestions, enhancements, questions, etc?

Ubuntu.md currently has three steps for installing vagrant:

  1. download the .deb file
  2. install it apt install ./vagrant_"$vagrant_version"_x86_64.deb
  3. delete it rm ./vagrant_"$vagrant_version"_x86_64.deb

whereas in CentOS/Fedora it is a simple yum install https://...._x86_64.rpm. Do you know how to put the .deb-url on the apt install command-line directly?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think, should we depend on the output order of yum & html pages, or should awk do the sorting? Any other suggestions, enhancements, questions, etc?

I mean when a user sees theses two command he/she may apply both of them. so why to put two of them if one can handle it properly

Ubuntu.md currently has three steps for installing vagrant:

download the .deb file
install it apt install ./vagrant_"$vagrant_version"x86_64.deb
delete it rm ./vagrant
"$vagrant_version"_x86_64.deb

whereas in CentOS/Fedora it is a simple yum install https://...._x86_64.rpm. Do you know how to put the .deb-url on the apt install command-line directly?

If we want to install .deb we should use dpkg with -i option or any other alternative apt-get used to install packages from repositories unlike yum which can handle install a local package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so why to put two of them if one can handle it properly

Because I didn't come to a conclusion which of the two (three) is better. What are your thoughts? After we made up our mind, we remove the other and have a reference left in the repository.

we should use dpkg with -i

Like this? It would put vagrant install on a single line, but then we'd have 2 lines for installing: dpkg for vagrant & apt install for git & virtualbox.
That would give 2 options 1) apt install & dpkg -i 2) download, apt install, rm. Which do you prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Windows
3 participants