mirror of
https://github.com/khuedoan/homelab.git
synced 2025-07-04 15:27:52 +07:00
Add ugly fix for ansible LXD connection
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
- name: Create a tfstate container
|
- name: Create a tfstate container
|
||||||
delegate_to: localhost
|
# TODO use var for lxd host
|
||||||
|
run_once: true
|
||||||
lxd_container:
|
lxd_container:
|
||||||
name: tfstate
|
name: tfstate
|
||||||
state: started
|
state: started
|
||||||
@ -9,14 +10,20 @@
|
|||||||
server: https://images.linuxcontainers.org
|
server: https://images.linuxcontainers.org
|
||||||
alias: ubuntu/focal/amd64
|
alias: ubuntu/focal/amd64
|
||||||
wait_for_ipv4_addresses: yes
|
wait_for_ipv4_addresses: yes
|
||||||
url: "https://{{ hostvars[groups['metal'][0]]['ansible_host'] }}:8443"
|
|
||||||
devices:
|
devices:
|
||||||
eth0:
|
eth0:
|
||||||
type: nic
|
type: nic
|
||||||
nictype: macvlan
|
nictype: macvlan
|
||||||
parent: eno1
|
parent: eno1
|
||||||
|
|
||||||
# - ansible.builtin.raw: dpkg -s python
|
# TODO Use native lxd connection instead of exec
|
||||||
# delegate_to: tfstate
|
# - name: Add tfstate container to host list
|
||||||
|
# delegate_to: metal0
|
||||||
|
# add_host:
|
||||||
|
# name: tfstate
|
||||||
|
# groups: lxd
|
||||||
|
# ansible_connection: lxd
|
||||||
|
|
||||||
# apt install -y etcd
|
- name: Install etcd
|
||||||
|
run_once: true
|
||||||
|
command: lxc exec tfstate -- apt-get install -y etcd
|
||||||
|
Reference in New Issue
Block a user