Files
lab-rack/playbooks/deploy_monitoring_lxc.yml
T

33 lines
870 B
YAML
Raw Normal View History

2026-07-06 16:45:51 +02:00
---
- name: Infrastructure - Deploy Monitoring Container
hosts: lxc_hosts
become: true
pre_tasks:
- name: Ensure Host has LXC Python bindings
apt:
name: python3-lxc
state: present
update_cache: yes
tasks:
- name: Provision Debian 13 LXC
community.general.lxc_container:
name: monitoring-srv
template: debian
state: started
template_options: --release trixie
container_config:
- "lxc.net.0.type = veth"
- "lxc.net.0.link = lxcbr0" # Adjust to your bridge name
- "lxc.start.auto = 1"
- name: Wait for Network
pause:
seconds: 10
- name: Prepare Container for Ansible
shell: |
lxc-attach -n monitoring-srv -- apt-get update
lxc-attach -n monitoring-srv -- apt-get install -y python3 openssh-server