36 lines
1004 B
YAML
36 lines
1004 B
YAML
---
|
|
- name: LXD Playbook
|
|
hosts: lxd_hosts
|
|
become: true
|
|
tasks:
|
|
- name: Create lxd containers
|
|
community.general.lxd_container:
|
|
name: '{{ item }}'
|
|
state: started
|
|
source:
|
|
type: image
|
|
mode: pull
|
|
server: https://cloud-images.ubuntu.com/minimal/releases/
|
|
protocol: simplestreams # if you get a 404, try setting protocol: simplestreams
|
|
alias: focal
|
|
profiles: ['default']
|
|
wait_for_ipv4_addresses: true
|
|
timeout: 600
|
|
with_items:
|
|
- haproxy
|
|
- gitea
|
|
- name: Create haproxy port forwards
|
|
community.general.lxd_container:
|
|
name: haproxy
|
|
devices:
|
|
map_port_80:
|
|
type: proxy
|
|
listen: tcp:0.0.0.0:80
|
|
connect: tcp:127.0.0.1:80
|
|
proxy_protocol: 'true'
|
|
map_port_443:
|
|
type: proxy
|
|
listen: tcp:0.0.0.0:443
|
|
connect: tcp:127.0.0.1:443
|
|
proxy_protocol: 'true'
|