From 7e96d00028c49ce607f5799f68f0cc7a2c1fcf3c Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Wed, 15 Jan 2020 00:10:57 -0500 Subject: [PATCH] fix ansible user vars --- automation/roles/bubble/files/bubble_role.json | 2 +- .../roles/bubble/templates/refresh_bubble_ssh_keys.sh.j2 | 4 ++-- bubble-server/src/main/resources/ansible/install_local.sh.hbs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automation/roles/bubble/files/bubble_role.json b/automation/roles/bubble/files/bubble_role.json index 03a27ff5..944c3ddd 100644 --- a/automation/roles/bubble/files/bubble_role.json +++ b/automation/roles/bubble/files/bubble_role.json @@ -13,7 +13,7 @@ {"name": "bubble_version", "value": "[[configuration.version]]"}, {"name": "bubble_host", "value": "[[node.fqdn]]"}, {"name": "bubble_cname", "value": "[[network.networkDomain]]"}, - {"name": "admin_user", "value": "[[node.user]]"}, + {"name": "admin_user", "value": "[[node.ansibleUser]]"}, {"name": "db_encoding", "value": "UTF-8"}, {"name": "db_locale", "value": "en_US"}, {"name": "db_user", "value": "bubble"}, diff --git a/automation/roles/bubble/templates/refresh_bubble_ssh_keys.sh.j2 b/automation/roles/bubble/templates/refresh_bubble_ssh_keys.sh.j2 index f2fc70c1..912b73a5 100644 --- a/automation/roles/bubble/templates/refresh_bubble_ssh_keys.sh.j2 +++ b/automation/roles/bubble/templates/refresh_bubble_ssh_keys.sh.j2 @@ -36,9 +36,9 @@ for key in $(echo "${CURRENT_KEYS_SQL}" | PGPASSWORD="$(cat /home/bubble/.BUBBLE done # Retain self-generated ansible setup key -ANSIBLE_USER="{{node.user}}" +ANSIBLE_USER="{{admin_user}}" if [[ ! -z "${ANSIBLE_USER}" ]] ; then - PUB_FILE="$(cd ~{{node.user}} && pwd)/.ssh/bubble_rsa.pub" + PUB_FILE="$(cd "~{{admin_user}}" && pwd)/.ssh/bubble_rsa.pub" if [[ -f "${PUB_FILE}" ]] ; then cat "${PUB_FILE}" >> ${NEW_KEYS} fi diff --git a/bubble-server/src/main/resources/ansible/install_local.sh.hbs b/bubble-server/src/main/resources/ansible/install_local.sh.hbs index 7674f344..a9f5fd36 100644 --- a/bubble-server/src/main/resources/ansible/install_local.sh.hbs +++ b/bubble-server/src/main/resources/ansible/install_local.sh.hbs @@ -1,7 +1,7 @@ #!/bin/bash ANSIBLE_USER="{{node.user}}" -ANSIBLE_HOME="$(cd ~{{node.user}} && pwd)" +ANSIBLE_HOME="$(cd "~{{node.user}}" && pwd)" LOG="${ANSIBLE_HOME}/.ansible.log" function log {