瀏覽代碼

current

master
父節點
當前提交
33c2340500
共有 3 個檔案被更改,包括 66 行新增0 行删除
  1. +7
    -0
      tasks/main.yaml
  2. +18
    -0
      tasks/setup_Debian.yml
  3. +41
    -0
      vars/main.yaml

+ 7
- 0
tasks/main.yaml 查看文件

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

- include: setup_{{ ansible_distribution }}.yml

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

+ 18
- 0
tasks/setup_Debian.yml 查看文件

@@ -0,0 +1,18 @@
---

- name: apt pkg snapd
apt:
pkg: snapd
register: _apt_snapd

- name: snap install lxd
command: snap install lxd
register: _snap_install_lxd
changed_when: not "is already installed" in _snap_install_lxd.stderr

# - name: snap lxd
# snap:
# name: lxd

- reboot:
when: _apt_snapd.changed

+ 41
- 0
vars/main.yaml 查看文件

@@ -1 +1,42 @@
---
lxd_config:

# Daemon settings
config:
#core.https_address: 192.168.1.1:9999
#core.trust_password: sekret
images.auto_update_interval: 6

# Storage pools
storage_pools:
- name: data
driver: zfs
config:
source: my-zfs-pool/my-zfs-dataset

# Network devices
networks:
- name: lxd-my-bridge
type: bridge
config:
ipv4.address: auto
ipv6.address: none

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

Loading…
取消
儲存