Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Molecule Learnings

Molecule Learnings

Setting up a Vagrant Box

 vagrant init ubuntu/bionic64
 vagrant up
 vagrant ssh

Inside the Vagrant Box

    1  sudo apt-get update
    2  sudo apt-get -y install git
    3  sudo apt-get install git
    4  git
    5  sudo apt-get install docker-ce
    6  sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg-agent     software-properties-common
    7  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    8  sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    9     $(lsb_release -cs) \
   10     stable"
   11  sudo apt-get update
   12  sudo apt-get install docker-ce
   13  sudo docker run hello-world
   14  sudo pip install molecule
   15  apt-get install python-pip
   16  sudo apt-get install python-pip
   17  pip
   18  sudo pip install --upgrade pip
   19  sudo pip install molecule
   20  molecule
   21  mkdir workspace
   22  cd workspace/
   23  git clone https://github.com/geerlingguy/ansible-role-docker.git
   24  cd ansible-role-docker/
   25  molecule test
   26  molecule --debug test
   27  sudo pip install docker-py
   28  molecule --debug test
   29  sudo molecule test
   30  sudo usermod -aG docker $USER
   31  docker ps
   32  cd workspace/ansible-role-docker/
   33  molecule test
   34  ls -la
   35  cd molecule/
   36  ls -la
   37  cd default/
   38  ls -la
   39  vi molecule.yml
   40  vi playbook.yml
   41  cd ..
   42  ls -la
   43  cd meta/
   44  ls -la
   45  vi main.yml
   46  cd ..
   47  MOLECULE_DISTRO=ubuntu1804 molecule test
   48  cd ..
   49  mv ansible-role-docker geerlingguy.docker
   50  cd geerlingguy.docker/
   51  MOLECULE_DISTRO=ubuntu1804 molecule test
   52  history

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.