Add role to generate LXD client config

This commit is contained in:
Khue Doan 2021-02-21 22:28:06 +07:00
parent 5bd503dbce
commit 6b60373ac4
4 changed files with 26 additions and 8 deletions

View File

@ -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" {

View 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

View File

@ -1,3 +1,6 @@
[controller]
localhost ansible_connection=local
[metal]
metal0 ansible_host=192.168.50.2
metal1 ansible_host=192.168.50.3

View File

@ -4,3 +4,8 @@
- tools
- lxd
- tfstate
- name: Generate LXD client config
hosts: controller
roles:
- lxc-config