Compare commits
2 Commits
707b014ae9
...
1d0e5df155
Author | SHA1 | Date |
---|---|---|
![]() |
1d0e5df155 | |
![]() |
95d9d08762 |
|
@ -16,10 +16,9 @@
|
||||||
- "zfsutils-linux"
|
- "zfsutils-linux"
|
||||||
|
|
||||||
- ansible.builtin.include_role:
|
- ansible.builtin.include_role:
|
||||||
name: init_lxd
|
name: init_lxd
|
||||||
#vars:
|
#vars:
|
||||||
# - lxd_init_template_config_path="/path/to/my/template"
|
# - lxd_init_template_config_path="/path/to/my/custom/template"
|
||||||
|
|
||||||
|
|
||||||
## Rollback
|
## Rollback
|
||||||
- hosts: ubuntu_lxd
|
- hosts: ubuntu_lxd
|
||||||
|
@ -28,4 +27,11 @@
|
||||||
tasks:
|
tasks:
|
||||||
- shell: "snap remove --purge lxd"
|
- shell: "snap remove --purge lxd"
|
||||||
become: true
|
become: true
|
||||||
|
- name: Install packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{item}}"
|
||||||
|
state: absent
|
||||||
|
with_items:
|
||||||
|
- "ansible"
|
||||||
|
- "zfsutils-linux"
|
||||||
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
language: python
|
|
||||||
python: "2.7"
|
|
||||||
|
|
||||||
# Use the new container infrastructure
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
# Install ansible
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- python-pip
|
|
||||||
|
|
||||||
install:
|
|
||||||
# Install ansible
|
|
||||||
- pip install ansible
|
|
||||||
|
|
||||||
# Check ansible version
|
|
||||||
- ansible --version
|
|
||||||
|
|
||||||
# Create ansible.cfg with correct roles_path
|
|
||||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
|
||||||
|
|
||||||
script:
|
|
||||||
# Basic role syntax check
|
|
||||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
@ -1,4 +1,14 @@
|
||||||
---
|
---
|
||||||
# defaults file for roles/init_lxd
|
# defaults file for roles/init_lxd
|
||||||
|
|
||||||
lxd_init_template_config_path: "templates/default_config.yml.j2"
|
lxd_init_template_config_path: "templates/default_config.yml.j2"
|
||||||
lxd_init_template_processed_path: "/tmp/default_config.yml"
|
lxd_init_template_processed_path: "/tmp/default_config.yml"
|
||||||
|
|
||||||
|
## LXD Default
|
||||||
|
lxd_project_name: "default"
|
||||||
|
# - Storage
|
||||||
|
storage_pool_name: "default"
|
||||||
|
storage_pool_driver: "zfs"
|
||||||
|
storage_pool_size: "20GB"
|
||||||
|
# - Network
|
||||||
|
network_default_name: "lxdbr0"
|
|
@ -7,7 +7,7 @@
|
||||||
classic: yes
|
classic: yes
|
||||||
|
|
||||||
- ansible.builtin.debug:
|
- ansible.builtin.debug:
|
||||||
var:
|
var: hostvars[inventory_hostname]['ansible_default_ipv6']['address']
|
||||||
verbosity: 1
|
verbosity: 1
|
||||||
|
|
||||||
- delegate_to: localhost
|
- delegate_to: localhost
|
||||||
|
@ -33,4 +33,3 @@
|
||||||
|
|
||||||
- ansible.builtin.debug:
|
- ansible.builtin.debug:
|
||||||
var: lxd_init_output
|
var: lxd_init_output
|
||||||
verbosity: 2
|
|
||||||
|
|
|
@ -4,39 +4,36 @@ config:
|
||||||
|
|
||||||
# --
|
# --
|
||||||
networks:
|
networks:
|
||||||
- config:
|
- name: {{network_default_name}}
|
||||||
# IPv4
|
project: {{lxd_project_name}}
|
||||||
|
type: bridge
|
||||||
|
config:
|
||||||
|
# IPv4
|
||||||
ipv4.nat: "true"
|
ipv4.nat: "true"
|
||||||
ipv4.address: {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}
|
ipv4.address: {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}
|
||||||
# IPv6
|
# IPv6
|
||||||
ipv6.nat: "true"
|
ipv6.nat: "true"
|
||||||
ipv6.address: {{ hostvars[inventory_hostname]['ansible_default_ipv6']['address'] }}
|
|
||||||
name: lxdbr0
|
|
||||||
type: bridge
|
|
||||||
project: default
|
|
||||||
|
|
||||||
# --
|
# --
|
||||||
storage_pools:
|
storage_pools:
|
||||||
- config:
|
- name: {{storage_pool}}
|
||||||
size: 20GB
|
driver: {{storage_pool_driver}}
|
||||||
|
config:
|
||||||
|
size: {{storage_pool_size}}
|
||||||
source: /var/snap/lxd/common/lxd/disks/default.img
|
source: /var/snap/lxd/common/lxd/disks/default.img
|
||||||
name: default
|
|
||||||
driver: zfs
|
|
||||||
|
|
||||||
# --
|
# --
|
||||||
profiles:
|
profiles:
|
||||||
- config: {}
|
- name: {{lxd_project_name}}
|
||||||
description: Default LXD profile
|
|
||||||
devices:
|
devices:
|
||||||
eth0:
|
eth0:
|
||||||
name: eth0
|
name: eth0
|
||||||
network: lxdbr0
|
network: {{network_default_name}}
|
||||||
type: nic
|
type: nic
|
||||||
root:
|
root:
|
||||||
path: /
|
path: /
|
||||||
pool: default
|
pool: {{storage_pool}}
|
||||||
type: disk
|
type: disk
|
||||||
name: default
|
|
||||||
|
|
||||||
# --
|
# --
|
||||||
projects:
|
projects:
|
||||||
|
@ -45,5 +42,4 @@ projects:
|
||||||
features.networks: "true"
|
features.networks: "true"
|
||||||
features.profiles: "true"
|
features.profiles: "true"
|
||||||
features.storage.volumes: "true"
|
features.storage.volumes: "true"
|
||||||
description: Default LXD project
|
name: {{lxd_project_name}}
|
||||||
name: default
|
|
1902
Playbooks/test.json
1902
Playbooks/test.json
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue