Merge remote-tracking branch 'origin/layers-secrets-share'

This commit is contained in:
Khue Doan 2021-03-21 18:26:16 +07:00
commit d2472f5fff
4 changed files with 21 additions and 20 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.vagrant/ .vagrant/
.venv/ .venv/
build/ build/
metal/secrets/
*.log *.log
.terraform* .terraform*

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,2 @@
LXD_ADDR={{ hostvars[groups['metal'][0]]['ansible_host'] }}
LXD_PASSWORD={{ lxd_password }}