Browse Source

working setup

master
parent
commit
ae9b3532c7
4 changed files with 31 additions and 18 deletions
  1. +1
    -0
      defaults/main.yaml
  2. +2
    -2
      tasks/main.yaml
  3. +12
    -0
      tasks/setup_Debian.yml
  4. +16
    -16
      vars/main.yaml

+ 1
- 0
defaults/main.yaml View File

@@ -1 +1,2 @@
--- ---
lxd_ipv6_nat: false

+ 2
- 2
tasks/main.yaml View File

@@ -1,8 +1,8 @@
--- ---


- include: setup_{{ ansible_distribution }}.yml
- include_tasks: setup_{{ ansible_distribution }}.yml


- name: lxd init - name: lxd init
command: lxd init --preseed command: lxd init --preseed
vars:
args:
stdin: "{{ lxd_config | to_json }}" stdin: "{{ lxd_config | to_json }}"

+ 12
- 0
tasks/setup_Debian.yml View File

@@ -11,3 +11,15 @@
- name: snap lxd - name: snap lxd
snap: snap:
name: lxd name: lxd

- name: link lxc binary
file:
src: /snap/bin/lxc
dest: /usr/local/bin/lxc
state: link

- name: link lxd binary
file:
src: /snap/bin/lxd
dest: /usr/local/bin/lxd
state: link

+ 16
- 16
vars/main.yaml View File

@@ -9,34 +9,34 @@ lxd_config:


# Storage pools # Storage pools
storage_pools: storage_pools:
- name: data
driver: zfs
- name: default
description: default storage pool
driver: btrfs
config: config:
source: my-zfs-pool/my-zfs-dataset
source: /lxd


# Network devices # Network devices
networks: networks:
- name: lxd-my-bridge
- name: lxdbr0
description: default lxd bridge
type: bridge type: bridge
config: config:
ipv4.address: auto ipv4.address: auto
ipv6.address: none
ipv6.address: "{{lxd_ipv6_address|default('auto')}}"
ipv6.nat: "{{ lxd_ipv6_nat }}"


# Profiles # Profiles
profiles: profiles:
- name: default - name: default
devices:
root:
path: /
pool: data
type: disk
- name: test-profile
description: "Test profile"
description: default profile
config: config:
limits.memory: 2GB limits.memory: 2GB
devices: devices:
test0:
name: test0
nictype: bridged
parent: lxd-my-bridge
eth0:
name: eth0
network: lxdbr0
type: nic type: nic
root:
path: /
pool: default
type: disk

Loading…
Cancel
Save