Initial Lab Setup
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
- 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
|
||||
Reference in New Issue
Block a user