Skip to content

fluidos-project/OpenCall-icewapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ICEWAPP: Photovoltaic Nowcasting

This document provides a brief introduction to the implementation of the ICEWAPP use case testbed. For more information about the use case and how FLUIDOS has helped to the development of the project, you can check out this video.

During the development and testing phases of the project, the environment had to be reinstalled from scratch several times. For this reason, automation through Ansible scripts allowed us to save time and facilitate replicability. This guide is inspired by the documentation provided in the Node repository and in the intelligent-power-grid-use-case.

The testbed environment involves the following components and tools:

  • Two K3s Kubernetes clusters
    • CONSUMER: with 1 armv8 master node (Revolution Pi Connect 4).
    • PROVIDER: with 1 amd64 master node.
  • ArgoCD: a declarative GitOps continuous delivery tool for Kubernetes.
  • LIQO: v0.10.3
  • FLUIDOS Node: v0.1.1
  • Helm
  • Kubernetes-Dashboard
  • kube-prometheus-stack

Despite the specified nodes, ANSIBLE variables can be customized to install the testbed in a different setup.

ANSIBLE scripts are located on /ansible folder, but first a brief overview of ANSIBLE and how to setup it will be given.

📘 Introduction to Ansible

✅ What is Ansible?

Ansible is a configuration automation and systems management tool, based on an agentless approach that uses SSH to communicate with remote machines. It was developed by Red Hat and is designed to be simple, powerful, and flexible.

🛠️ What is Ansible used for?

  • Installing and configuring software on servers (Apache, Docker, K3s, RabbitMQ...).
  • Infrastructure orchestration (deploying microservices, restarting services, etc.).
  • Managing heterogeneous environments (local VMs, edge devices, clouds, containers).
  • Automating repetitive tasks (copying files, applying configuration changes, restarting systems...).

All this is achieved through playbooks written in YAML.

🔁 How does it work?

  • Define tasks in YAML files called playbooks.
  • Use SSH to execute these tasks on one or more remote servers.
  • No agents required (nothing is installed on managed servers).
  • An inventory file defines the target servers.

🧭 Why NOT run Ansible directly on Windows?

❌ Windows limitations:

  • Compatibility issues → Ansible is based on Linux/POSIX and is not designed to run natively on Windows.
  • Lacks full SSH support → Until recent versions, Windows did not include robust SSH support, which Ansible requires.
  • Dependency problems → Ansible depends on UNIX tools (bash, python, scp...), which are not available natively on Windows.
  • Lack of official support → Official documentation does not recommend or support running Ansible directly on Windows.

✅ Why use WSL?

WSL (Windows Subsystem for Linux) is the ideal way to use Ansible on Windows:

  • Real Linux environment → Install Ansible just like on Ubuntu.
  • Full SSH support → Use SSH keys, ssh-agent, etc., without restrictions.
  • Integration with Windows → Edit files with VS Code, access shared folders.
  • Lightweight and fast → No need for a full VM or VirtualBox.

Installing and Configuring Ansible

Installation

Ansible is installed on your computer. To install it, open a WSL terminal and run:

  1. Ensure Python is installed, otherwise install it with:
sudo apt update
sudo apt install -y python3-pip python3-venv
  1. Install Ansible with pip and the Kubernetes module:
pip3 install --user ansible
pip3 install kubernetes

Make sure ~/.local/bin is in your PATH:

echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Verify the installation:

ansible --version

Expected output:

ansible [core 2.x.x]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0]

Configuring the target machine (VM* or edge device)

Important: Virtual machines require their own IP address for SSH connections, so use bridge mode networking.

Ansible connects via SSH. From the host:

From your host

  1. Generate an SSH key:
ssh-keygen -t rsa -b 4096
  1. Copy the public key to the VM:
ssh-copy-id -i /path/to/id_rsa.pub user@VM_IP
  1. If using root in WSL, copy the key to root’s folder:
mkdir -p /root/.ssh
cp /mnt/c/Git_repository/eium_ansible/.ssh/id_rsa /root/.ssh/
chmod 600 /root/.ssh/id_rsa
  1. Add the configuration to ~/.ssh/config:
Host <IP_ADDRESS>
    User <USER>
    IdentityFile <PATH_TO_GENERATED_KEY> (e.g. /root/.ssh/id_rsa)

On the VM or edge device

  1. Ensure the SSH server is installed and running:
sudo apt update
sudo apt install -y openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
  1. Check SSH permissions:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
  1. Verify SSH server configuration:
    In /etc/ssh/sshd_config make sure these lines are present:
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes

Restart SSH if changes were made:

sudo systemctl restart ssh
  1. Ensure port 22 is open:
sudo ufw allow ssh
sudo ufw enable
  1. Install Python and required modules for Ansible:
sudo apt update
sudo apt install -y python3 python3-pip python3-venv
pip3 install six

Final check

If everything is configured correctly, you can connect to the VM/edge from your host with:

ssh user@ip

without needing to enter the password.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published