Only run leader preseed on the first node

This commit is contained in:
Khue Doan
2021-02-21 11:27:12 +07:00
parent 1b54cc22db
commit b57b41c236
3 changed files with 10 additions and 3 deletions

View File

@ -2,7 +2,14 @@
snap:
name: lxd
- name: Init LXD
- name: Init LXD on leader node
command:
cmd: lxd init --preseed
stdin: "{{ lookup('template', 'preseed.yaml.j2') }}"
cmd: /snap/bin/lxd init --preseed
stdin: "{{ lookup('template', 'leader.yaml.j2') }}"
when: inventory_hostname == groups['metal'][0]
- name: Init LXD on member nodes
command:
cmd: /snap/bin/lxd init --preseed
stdin: "{{ lookup('template', 'member.yaml.j2') }}"
when: inventory_hostname != groups['metal'][0]

View File