mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-07 05:51:17 +07:00
Use native lxd connection instead of lxd exec
This commit is contained in:
parent
eaba343a5d
commit
c16d1a5a22
@ -18,6 +18,12 @@
|
||||
roles:
|
||||
- snap
|
||||
- lxd
|
||||
tags:
|
||||
- provision
|
||||
|
||||
- name: Terraform state
|
||||
hosts: controller
|
||||
roles:
|
||||
- tfstate
|
||||
tags:
|
||||
- provision
|
||||
|
@ -1,9 +1,8 @@
|
||||
- name: Create a tfstate container
|
||||
# TODO use var for lxd host
|
||||
run_once: true
|
||||
lxd_container:
|
||||
name: tfstate
|
||||
state: started
|
||||
url: "https://{{ hostvars[groups['metal'][0]]['ansible_host'] }}:8443"
|
||||
source:
|
||||
type: image
|
||||
mode: pull
|
||||
@ -16,14 +15,14 @@
|
||||
nictype: macvlan
|
||||
parent: eno1
|
||||
|
||||
# TODO Use native lxd connection instead of exec
|
||||
# - name: Add tfstate container to host list
|
||||
# delegate_to: metal0
|
||||
# add_host:
|
||||
# name: tfstate
|
||||
# groups: lxd
|
||||
# ansible_connection: lxd
|
||||
- name: Add tfstate container to host list
|
||||
add_host:
|
||||
name: tfstate
|
||||
groups: lxd
|
||||
ansible_connection: lxd
|
||||
ansible_lxd_remote: homelab
|
||||
|
||||
- name: Install etcd
|
||||
run_once: true
|
||||
command: lxc exec tfstate -- apt-get install -y etcd
|
||||
delegate_to: tfstate
|
||||
apt:
|
||||
name: etcd
|
||||
|
Loading…
Reference in New Issue
Block a user