mirror of
https://github.com/khuedoan/homelab.git
synced 2025-03-10 04:47:09 +07:00
Merge remote-tracking branch 'origin/layers-secrets-share'
This commit is contained in:
commit
d2472f5fff
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
.vagrant/
|
.vagrant/
|
||||||
.venv/
|
.venv/
|
||||||
build/
|
build/
|
||||||
|
metal/secrets/
|
||||||
|
|
||||||
*.log
|
*.log
|
||||||
.terraform*
|
.terraform*
|
||||||
|
@ -6,7 +6,9 @@ init:
|
|||||||
terraform init
|
terraform init
|
||||||
|
|
||||||
plan:
|
plan:
|
||||||
terraform plan
|
source ../metal/secrets/env \
|
||||||
|
&& terraform plan
|
||||||
|
|
||||||
apply:
|
apply:
|
||||||
terraform apply
|
source ../metal/secrets/env \
|
||||||
|
&& terraform apply
|
||||||
|
@ -35,22 +35,18 @@
|
|||||||
creates: /var/snap/lxd/common/lxd/server.crt
|
creates: /var/snap/lxd/common/lxd/server.crt
|
||||||
when: inventory_hostname != groups['metal'][0]
|
when: inventory_hostname != groups['metal'][0]
|
||||||
|
|
||||||
# - name: Add remote
|
- name: Add LXD server to environment variables
|
||||||
# command:
|
lineinfile:
|
||||||
# argv:
|
path: "{{ playbook_dir }}/secrets/env"
|
||||||
# - lxc
|
line: "LXD_ADDR={{ hostvars[groups['metal'][0]]['ansible_host'] }}"
|
||||||
# - remote
|
create: yes
|
||||||
# - add
|
delegate_to: localhost
|
||||||
# - vagrant
|
run_once: yes
|
||||||
# - "{{ hostvars[groups['metal'][0]]['ansible_host'] }}"
|
|
||||||
# - --accept-certificate
|
|
||||||
# - --password
|
|
||||||
# - 1
|
|
||||||
|
|
||||||
# - name: Change default remote
|
- name: Add LXD password to environment variables
|
||||||
# command:
|
lineinfile:
|
||||||
# argv:
|
path: "{{ playbook_dir }}/secrets/env"
|
||||||
# - lxc
|
line: "LXD_PASSWORD={{ lxd_password }}"
|
||||||
# - remote
|
create: yes
|
||||||
# - switch
|
delegate_to: localhost
|
||||||
# - vagrant
|
run_once: yes
|
||||||
|
2
metal/roles/lxd/templates/env
Normal file
2
metal/roles/lxd/templates/env
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
LXD_ADDR={{ hostvars[groups['metal'][0]]['ansible_host'] }}
|
||||||
|
LXD_PASSWORD={{ lxd_password }}
|
Loading…
Reference in New Issue
Block a user