Skip to content

Add env-vars.sh on openstack config deployment #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ansible/deploy-openstack-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
tags:
- multinode.sh

- name: Ensure env-vars.sh script is present
ansible.builtin.template:
src: "templates/env-vars.sh.j2"
dest: "{{ ansible_env.HOME }}/env-vars.sh"
mode: "0755"

- name: Ensure root_domain is defined
ansible.builtin.lineinfile:
path: "{{ src_directory }}/{{ kayobe_config_name }}/etc/kayobe/environments/{{ kayobe_config_environment }}/inventory/group_vars/all/main.yml"
Expand Down
6 changes: 6 additions & 0 deletions ansible/templates/env-vars.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
export KAYOBE_VAULT_PASSWORD=$(cat {{ ansible_env.HOME }}/vault.password)
source {{ ansible_env.HOME }}/venvs/kayobe/bin/activate
source {{ src_directory }}/{{ kayobe_config_name }}/kayobe-env --environment {{ kayobe_config_environment }}
source <(kayobe complete)
cd {{ src_directory }}/{{ kayobe_config_name }}/etc/kayobe/