mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 21:24:52 +07:00
Export metal secrets to an env file
This commit is contained in:
parent
7e22d2455f
commit
9d30d0e328
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
.vagrant/
|
||||
.venv/
|
||||
build/
|
||||
metal/secrets/
|
||||
|
||||
*.log
|
||||
.terraform*
|
||||
|
@ -35,22 +35,18 @@
|
||||
creates: /var/snap/lxd/common/lxd/server.crt
|
||||
when: inventory_hostname != groups['metal'][0]
|
||||
|
||||
# - name: Add remote
|
||||
# command:
|
||||
# argv:
|
||||
# - lxc
|
||||
# - remote
|
||||
# - add
|
||||
# - vagrant
|
||||
# - "{{ hostvars[groups['metal'][0]]['ansible_host'] }}"
|
||||
# - --accept-certificate
|
||||
# - --password
|
||||
# - 1
|
||||
- name: Add LXD server to environment variables
|
||||
lineinfile:
|
||||
path: "{{ playbook_dir }}/secrets/env"
|
||||
line: "LXD_ADDR={{ hostvars[groups['metal'][0]]['ansible_host'] }}"
|
||||
create: yes
|
||||
delegate_to: localhost
|
||||
run_once: yes
|
||||
|
||||
# - name: Change default remote
|
||||
# command:
|
||||
# argv:
|
||||
# - lxc
|
||||
# - remote
|
||||
# - switch
|
||||
# - vagrant
|
||||
- name: Add LXD password to environment variables
|
||||
lineinfile:
|
||||
path: "{{ playbook_dir }}/secrets/env"
|
||||
line: "LXD_PASSWORD={{ lxd_password }}"
|
||||
create: yes
|
||||
delegate_to: localhost
|
||||
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