Skip to content

Ansible Playbook Tasks

Suraj Gupta Gudla edited this page Mar 11, 2022 · 4 revisions

Ansible Playbook Tasks

1. Install Packages - The below packages will get installed

  • dnsmasq
  • bridge-utils
  • genisoimage
  • expect
  • mlocate
  • zlib1g-dev
  • libglib2.0-dev
  • ntfs-3g
  • netcat
  • wget
  • git
  • gcc
  • qemu
  • iptables
  • python3-pip
  • python3-venv
  • iptables-persistent
  • netfilter-persistent
  • negotiator-host

2. Install Ip tables

  • The IP tables are not present by default and will be enabled, started in this stage.

3. Setup IPtables

Here all the required IP tables rules will be added such as,

  • Adding the Postrouting DC IP ranges for the TCP and UDP ports
  • Allow established incoming connections
  • Allow ICMP incoming connections
  • Allow lo incoming connections
  • Allow the SSH port -22
  • Allow port range for DC: 16000-16079
  • Allow forwarding for DC IP range

4. User Configuration

  • creates the dc-host user
  • Add the respective NO PASSWORD privileges for the dc-host user in the sudoers file

5. Backend Script Configuration

  • Clones the HTRC Data Capsule repository
  • Create a directory to hold the backend scripts
  • Add the full path of the directory containing backend scripts to the SCRIPT_DIR variable in qemu-ifup file.
  • Copy and replace qemu-ifup from the Backend directory to the /etc directory.
  • Copy all the Backend scripts form the cloned directory to the SCRIPT_DIR directory.
  • Recursively odify permisions (chmod 755)for the script directory
  • Replace htrcvirt with the dc-host username in the files capsules.cfg, configure, createvm.sh, deletevm.sh.
  • Copy the free_hosts file to the dc-host home directory
  • Create a new tapinit file and replace the old version of the tapinit file and change permissions.

6. Configure Firewall Rules

  • Configure and copy the firewall rule files (maintenance_mode.fw, secure_mode.fw) to the script directory

7. Cleanup

  • Deletes the cloned HTRC git repository