proxmox-ansible
Terraform + Ansible setup for various LXCs managed by Proxmox and based on Debian. Mountpoints on non-priviledged containers will require lxcid mappings to users with mountpoint access. I use a base container template with appropriate config; manually would work too. Sample & details in lxc.base.tf.bu
.
Terraform
cd terraform
initialize and setup
terraform init
terraform apply
# or if using clones and resource gets locked, limit parallelism:
terraform apply -parallelism=2
apply single resource
terraform apply -target=proxmox_lxc.RESOURCE_NAME
destroy container
terraform destroy -target=proxmox_lxc.RESOURCE_NAME
forget container
terraform state rm 'proxmox_lxc.HOST_NAME'
Ansible
cd ansible
run a single playbook
ansible-playbook ./playbooks/NAME.playbook.yml
run all playbooks
ansible-playbook ./site.yml
update known hosts
ssh-keygen -R "traefik.max.local" && \
ssh-keygen -R "plex.max.local"
# etc...
debug connection to hosts
ansible -i production.yml -m ping HOST_NAME.max.local -u root -vvvv
sshd fix for base template
# /usr/lib/tmpfiles.d/sshd.conf
d /run/sshd 0755 root root
TODO
- dash
- readarr
- nextcloud
- wireguard
- plexmetamanager
- vaultwarden
- vscode server
Misc
get pid of LXCs
lxc-ls -f -Fname,pid
access fs of LXC from host
cd /proc/PID_OF_LXC/root