Alpine LXC container's lack of ssh causes problems for automated installation

illegitimate-egg

New Member
May 25, 2025
3
1
3
Because Alpine's container doesn't ship with openssh, or configure it, it's difficult/impossible to use under automated conditions like under Ansible. When doing it by hand it's not such a big issue. Unfortunately, there's no easy way (I can find at least) that Ansible can login through the serial terminal and bootstrap SSH for later operations.

Other LXC images like Debian ship with sshd as an enabled service out of the box which makes it confusing why Alpine doesn't. It makes the pubkey parameter in the Ansible module somewhat redundant as whatever hook you have to run to install ssh could also do this
 
I built my own Alpine image with my own packages to have a working SSH setup. The default images are more a base image, which needs to be customized to have a streamlined automation experience.
 
  • Like
Reactions: Johannes S
I don't use Ansible, but can't you tell it to use something other than ssh. Maybe, ssh to the host first, and then use pct to execute commands inside the container?
 
I don't use Ansible, but can't you tell it to use something other than ssh. Maybe, ssh to the host first, and then use pct to execute commands inside the container?
If you don't use ansible, I cannot tell you what your other solution can or cannot do ;)
The ansible, IIRC there is/was a module that was able to pct exec into the container, yet I haven't used that.
 
  • Like
Reactions: Johannes S
Where would one find the alpine.yaml to edit? I'm good with yamls, but terribly new to proxmox.
I don't know. The yaml was mentioned by @illegitimate-egg.

I normally do the following steps (from my mind):
  • download the template via PVE itself,
  • unpack it in a folder,
  • chroot into it,
  • add packages and configuration,
  • exit chroot
  • pack the folder as a new template under a new name
  • test if it works as I intended to
  • be happy :)
 
  • Like
Reactions: Johannes S