mirror of
https://github.com/khuedoan/homelab.git
synced 2025-02-24 21:52:36 +07:00
Add role to generate LXD client config
This commit is contained in:
parent
5bd503dbce
commit
6b60373ac4
@ -20,14 +20,6 @@ terraform {
|
||||
provider "lxd" {
|
||||
generate_client_certificates = true
|
||||
accept_remote_certificate = true
|
||||
|
||||
lxd_remote {
|
||||
name = "local"
|
||||
scheme = "https"
|
||||
address = "localhost"
|
||||
password = "1"
|
||||
default = true
|
||||
}
|
||||
}
|
||||
|
||||
provider "rke" {
|
||||
|
18
metal/roles/lxc-config/tasks/main.yml
Normal file
18
metal/roles/lxc-config/tasks/main.yml
Normal file
@ -0,0 +1,18 @@
|
||||
- name: Add remote
|
||||
command:
|
||||
argv:
|
||||
- lxc
|
||||
- remote
|
||||
- add
|
||||
- vagrant
|
||||
- "{{ hostvars[groups['metal'][0]]['ansible_host'] }}"
|
||||
- --accept-certificate
|
||||
- --password
|
||||
- 1
|
||||
- name: Change default remote
|
||||
command:
|
||||
argv:
|
||||
- lxc
|
||||
- remote
|
||||
- switch
|
||||
- vagrant
|
@ -1,3 +1,6 @@
|
||||
[controller]
|
||||
localhost ansible_connection=local
|
||||
|
||||
[metal]
|
||||
metal0 ansible_host=192.168.50.2
|
||||
metal1 ansible_host=192.168.50.3
|
||||
|
@ -4,3 +4,8 @@
|
||||
- tools
|
||||
- lxd
|
||||
- tfstate
|
||||
|
||||
- name: Generate LXD client config
|
||||
hosts: controller
|
||||
roles:
|
||||
- lxc-config
|
||||
|
Loading…
Reference in New Issue
Block a user