+
+

Ansible Sandbox Documentation

+

Learn, experiment, and master Ansible automation in a safe environment

+
+ +
+

Introduction

+

+ Welcome to the ArgoBox Ansible Sandbox! This environment provides a safe and isolated space for learning + and experimenting with Ansible automation. Whether you're new to Ansible or an experienced user, our + sandbox offers the perfect platform to develop and test your automation skills. +

+ +
+
+ + Note
+

The Ansible Sandbox is part of the ArgoBox Lab Environment, designed to provide hands-on experience + with enterprise-grade automation tools.

- -
-
-
-
-

Web Server Deployment

- Basic -
-

- Deploy a Nginx web server with a sample website in a controlled environment. -

-
-
- - Runtime: ~3 min -
-
- - 1 VM -
-
-
- -
-
-

Docker Compose Stack

- Intermediate -
-

- Deploy a multi-container application using Docker Compose with automatic configuration. -

-
-
- - Runtime: ~5 min -
-
- - 1 VM -
-
-
- -
-
-

K3s Kubernetes Cluster

- Advanced -
-

- Deploy a lightweight Kubernetes cluster with basic services and sample application. -

-
-
- - Runtime: ~8 min -
-
- - 3 VMs -
-
-
- -
-
-

LAMP Stack

- Intermediate -
-

- Deploy a Linux, Apache, MySQL, and PHP stack with a sample application. -

-
-
- - Runtime: ~4 min -
-
- - 1 VM -
-
-
- -
-
-

Security Hardening

- Advanced -
-

- Apply security best practices to a Linux server including firewall, SSH hardening, and more. -

-
-
- - Runtime: ~6 min -
-
- - 1 VM -
-
-
-
- -
-
-
-
- - Web Server Deployment -
-
-
Playbook
-
Configuration
-
Output
-
VM Status
-
-
-
-
-
-
- 1 - --- -
-
- 2 - # Web Server Deployment Playbook -
-
- 3 - # This playbook installs and configures a basic Nginx web server -
-
- 4 - -
-
- 5 - - name: Deploy Web Server -
-
- 6 - hosts: all -
-
- 7 - become: yes -
-
- 8 - vars: -
-
- 9 - web_domain: example.local -
-
- 10 - web_root: /var/www/html -
-
- 11 - enable_https: false -
-
- 12 - web_color: blue -
-
- 13 - -
-
- 14 - tasks: -
-
- 15 - - name: Update apt cache -
-
- 16 - apt: -
-
- 17 - update_cache: yes -
-
- 18 - cache_valid_time: 3600 -
-
- 19 - -
-
- 20 - - name: Install Nginx and required packages -
-
- 21 - apt: -
-
- 22 - name: -
-
- 23 - - nginx -
-
- 24 - - curl -
-
- 25 - state: present -
-
- 26 - -
-
- 27 - - name: Create web root directory -
-
- 28 - file: -
-
- 29 - path: "{{ web_root }}" -
-
- 30 - state: directory -
-
- 31 - mode: '0755' -
-
- 32 - -
-
- 33 - - name: Create sample website -
-
- 34 - template: -
-
- 35 - src: templates/index.html.j2 -
-
- 36 - dest: "{{ web_root }}/index.html" -
-
- 37 - mode: '0644' -
-
- 38 - -
-
- 39 - - name: Configure Nginx virtual host -
-
- 40 - template: -
-
- 41 - src: templates/nginx.conf.j2 -
-
- 42 - dest: /etc/nginx/sites-available/{{ web_domain }} -
-
- 43 - notify: restart nginx -
-
- 44 - -
-
- 45 - - name: Enable Nginx virtual host -
-
- 46 - file: -
-
- 47 - src: /etc/nginx/sites-available/{{ web_domain }} -
-
- 48 - dest: /etc/nginx/sites-enabled/{{ web_domain }} -
-
- 49 - state: link -
-
- 50 - notify: restart nginx -
-
- 51 - -
-
- 52 - - name: Start Nginx -
-
- 53 - service: -
-
- 54 - name: nginx -
-
- 55 - state: started -
-
- 56 - enabled: yes -
-
- 57 - -
-
- 58 - handlers: -
-
- 59 - - name: restart nginx -
-
- 60 - service: -
-
- 61 - name: nginx -
-
- 62 - state: restarted -
-
-
- -
-
-
- - -
Domain name for the Nginx virtual host.
-
- -
- - -
Directory path where website files will be stored.
-
- -
- -
- - -
-
- -
- - -
Color theme for the sample website.
-
- -
- - -
Operating system for the virtual machine.
-
- -
- - -
Resource allocation for the virtual machine.
-
-
-
- -
-
- PLAY [Deploy Web Server] *************************************************** - - TASK [Gathering Facts] ***************************************************** - ok: [webserver] - - TASK [Update apt cache] **************************************************** - ok: [webserver] - - TASK [Install Nginx and required packages] ******************************** - ok: [webserver] - - TASK [Create web root directory] ******************************************* - ok: [webserver] - - TASK [Create sample website] *********************************************** - changed: [webserver] - - TASK [Configure Nginx virtual host] **************************************** - changed: [webserver] - - TASK [Enable Nginx virtual host] ******************************************* - changed: [webserver] - - TASK [Start Nginx] ********************************************************* - ok: [webserver] - - RUNNING HANDLER [restart nginx] ******************************************** - changed: [webserver] - - PLAY RECAP ***************************************************************** - webserver : ok=9 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 - - VERIFICATION ************************************************************** - Testing website availability... - Website is accessible at: http://192.168.122.10 - Website deployed successfully! -
-
- -
-
-
-
- -
-
-
webserver (Ubuntu 22.04 LTS)
-
1 vCPU, 1GB RAM, 20GB Storage
-
-
-
-
-
Running
-
- -
-
Sandbox environment active for 15 more minutes
-
-
-
-
-
-
-
-
-
-
- Ready to deploy -
-
- - -
-
-
-
+
+ +
+

Prerequisites

+
+

System Requirements

+
    +
  • Access to ArgoBox Lab Environment
  • +
  • Basic understanding of YAML syntax
  • +
  • Familiarity with command-line interface
  • +
  • Text editor or IDE for writing playbooks
  • +
- + +
+

Required Knowledge

+

+ While no prior Ansible experience is required, basic understanding of the following concepts will be + helpful: +

+
    +
  • Linux/Unix command line basics
  • +
  • SSH and basic networking concepts
  • +
  • Version control with Git (optional)
  • +
+
+
+ +
+

Quick Start Guide

+
+
+ + Important +
+

Make sure you have completed the initial setup and have your credentials ready before proceeding.

+
+ +
+

Getting Started Steps

+
    +
  1. Log in to your ArgoBox environment
  2. +
  3. Navigate to the Ansible Sandbox section
  4. +
  5. Create your first playbook using the provided templates
  6. +
  7. Test your playbook in the sandbox environment
  8. +
+
+ +
+
+# Example playbook structure
+---
+- name: My First Playbook
+  hosts: sandbox
+  tasks:
+    - name: Ensure Apache is installed
+      ansible.builtin.package:
+        name: apache2
+        state: present
+
+
+ +
+

Sandbox Environment

+

+ Our sandbox environment provides a fully isolated space where you can experiment with Ansible playbooks + without affecting production systems. The environment includes multiple target hosts, common services, and + pre-configured inventory files. +

+ +
+

Available Resources

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ResourceDescriptionStatus
Control NodeMain Ansible control serverAvailable
Target Hosts3 Ubuntu servers for testingAvailable
Example PlaybooksPre-configured templatesAvailable
+
+
+ + +