Managing multiple servers or virtual machines can quickly become overwhelming. An Ansible Control Node gives you a central hub to orchestrate your entire infrastructure. From a single container, you can automate software installations, enforce consistent configurations, run maintenance tasks, and deploy updates across all your hosts.

Combined with VS Code Remote-SSH, this setup allows you to manage your infrastructure from any device – a high-end workstation, a laptop, or even a tablet – while keeping all automation logic safely centralized in your container.
Why this setup is powerful:
- Automate repetitive administrative tasks across multiple servers
- Keep a portable, client-independent management environment
- Reduce mental overhead by centralizing management in one place
It’s like having a control tower for your entire infrastructure – fast, flexible, and reliable.
Creating an LXC container
Running your Ansible Control Node inside an LXC container on Proxmox is lightweight and easy to manage. Choosing the right resources ensures smooth operation, especially if you plan to run VS Code Server and manage multiple hosts at once.
Here’s a simple reference for CPU, RAM, and storage:
Component | Minimum | Comfortable |
---|---|---|
CPU | 1 Core | 2–4 Cores |
RAM | 1 GB | 2–4 GB |
Storage | 10 GB | 20 GB+ |
Use a minimal Red Hat–based template such as AlmaLinux, CentOS, or Rocky Linux. Assign CPU, RAM, and storage according to the table.
SSH setup and user management
Security starts with SSH. Install the server and create a non-root user for daily use:
dnf install -y openssh-server openssh
systemctl enable sshd
systemctl start sshd
Create a dedicated ansible
user:
adduser ansible
passwd ansible
usermod -aG wheel ansible
Allow passwordless sudo for this user by editing /etc/sudoers
or placing a file in /etc/sudoers.d/ansible
.
Optionally adjust SSH settings for security:
PermitRootLogin no
PasswordAuthentication yes # or 'no' if using SSH keys
Reload SSH:
systemctl restart sshd
Generate SSH keys on your local machine and copy them to the container for seamless Remote-SSH access:
ssh-keygen
ssh-copy-id ansible@container_ip
Installing Ansible and essential utilities
Install utilities that make system management and networking easier:
dnf install -y epel-release
dnf install -y vim-enhanced nano wget git ansible tar
Verify Ansible:
ansible --version
This setup is enough to start managing hosts, write playbooks, and execute tasks remotely.
Setting Up VS Code with Remote-SSH
Install VS Code on your host system following the official instructions. Then install the Remote-SSH extension.
In VS Code:
- Press
F1
→Remote-SSH: Connect Current Window to Host
- Connect using the
ansible
user and your SSH key - Once connected, clone your Ansible repository:
git clone https://github.com/your-account/your-ansible-repo.git
cd your-ansible-repo
- Open the folder in VS Code and trust the authors
This setup allows you to work directly in the container as if it were local, while all automation tasks are executed from a centralized environment.
Optional enhancements for production
- Use dedicated non-root users with sudo privileges
- Set up firewall rules to limit SSH access
- Install Python 3 on managed hosts (
dnf install -y python3
) - Use SSH keys for all Ansible-managed hosts
- Regularly update packages (
dnf update -y
) to maintain security
This setup provides a robust, portable, and centralized way to manage your infrastructure, all from an LXC container. It’s perfect for testing, small labs, or even production environments if properly secured.