Code Monkey home page Code Monkey logo

idug23_ansible_dev's Introduction

idug23_ansible_dev

Vagrant, Docker, Ansible-Examples for Session F15 at IDUG 2023 EMEA

Usage

You don't have to use all components. If you like running your own VM or on real hardware, choose the parts you need.

Vagrant VM

  • Edit Vagrantfile to your needs. Then start the vm with
vagrant up
  • Stop or hibernate current vm
vagrant halt
vagrant suspend
  • Completely remove the current vm
vagrant destroy

Docker Images

  • ssh to the VM (user: vagrant pw: vagrant)
  • create a working directory and copy the contents from the git-repository there (or checkout the repo again)
mkdir idug_workdir
cd idug_workdir
cp -r /vagrant/idug23_ansible_dev/* .
  • Build the ubuntu-jammy-Image (edit Dockerfile if needed)
cd docker/ubuntu-jammy
./createImage.sh
  • Build the ubuntu-db2-Image
    • Copy a Db2 installation image for linux to the Windows-Directory, where your Vagrantfile sits. The file should be seen in the /vagrant-Directory on your Linux vm.
    • Edit the Dockerfile to match the filename of your installation image
    • Edit the createImage.sh - File to match the filename of your installation image
    • Create Docker-Image (this takes a while)
    ./createImage.sh

Start and initialize containers

  • cd to the tools-Directory
cd ../../tools
  • run init_db2_containers.sh
./init_db2_containers.sh
  • run init_knownhosts.sh
./init_knownhosts.sh db2hosts.txt

The key-error during the live demo at IDUG Prague was simply caused by existing keys from a previous installation in the file /home/vagrant/.ssh/known_hosts. Now, this keys are removed first. If you still get this error, mmove he known_hosts-file away and run the script again.

The script init_knownhosts.sh is only needed if you had changes done to your Docker-image.The RSA-Signature of the containers will not change, even if you destroy (remove) the containers as long as you use the same docker image or the next start.

  • Test ssh-connection for the first container
ssh -l root 172.20.0.2

Ansible

  • cd to the ansible directory cd ../ansible
  • Run the 03_db2_instance_and_sample.yml playbook to create the db2inst1 instance and the Sample-Database on all targets
ansible-playbook 03_db2_instance_and_sample.yml -i inventory/ -l db2server

Remarks

  • you can always start/stop/remove containers with the Docker-Plugin from VSC
  • when you start new containers, you don't need to initialize known_hosts again, unless the Docker-Image has changed its signature
  • HAVE FUN!

idug23_ansible_dev's People

Contributors

nmitgain avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.