From 675bb34386e8b0b5df53e69dfe4537d00749c4be Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 17 Feb 2017 15:53:52 +0000 Subject: [PATCH] Use env lookup to determine HOME for SSH pubkey Following the merge of https://github.com/openstack/bifrost/commit/1236d9343ec16b4166f923bd62e3153ad86fd350, facts are no longer gathered in the deploy-dynamic.yaml playbook. The default value for the ssh_public_key_path variable references a host fact (ansible_env) which is therefore now invalid. This change uses the env lookup to determine the HOME environment variable, since we are actually referring to the home of the user executing Ansible rather than the remote user. Change-Id: I3642186e188f8a880246965dbf667ada992cc135 Closes-Bug: #1665681 --- playbooks/inventory/group_vars/baremetal | 2 +- playbooks/inventory/group_vars/localhost | 2 +- playbooks/inventory/group_vars/target | 2 +- playbooks/roles/bifrost-configdrives-dynamic/defaults/main.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/inventory/group_vars/baremetal b/playbooks/inventory/group_vars/baremetal index 575a06c42..15663b44a 100644 --- a/playbooks/inventory/group_vars/baremetal +++ b/playbooks/inventory/group_vars/baremetal @@ -9,7 +9,7 @@ # The path to the SSH key to be utilized for testing and burn-in # to configuration drives. When set, it should be set in both baremetal # and localhost groups, however this is only an override to the default. -# ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" +# ssh_public_key_path: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub" # Normally this user should be root, however if cirros is used, # a user may wish to define a specific user for testing VM diff --git a/playbooks/inventory/group_vars/localhost b/playbooks/inventory/group_vars/localhost index 94a4358b2..3165c75b2 100644 --- a/playbooks/inventory/group_vars/localhost +++ b/playbooks/inventory/group_vars/localhost @@ -17,7 +17,7 @@ mysql_password: # The path to the SSH key to be utilized for testing and burn-in # to configuration drives. When set, it should be set in both baremetal # and localhost groups, however this is only an override to the default. -# ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" +# ssh_public_key_path: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub" # If testing is true, then the environment is setup for using libvirt # virtual machines for the hardware instead of real hardware. diff --git a/playbooks/inventory/group_vars/target b/playbooks/inventory/group_vars/target index 94a4358b2..3165c75b2 100644 --- a/playbooks/inventory/group_vars/target +++ b/playbooks/inventory/group_vars/target @@ -17,7 +17,7 @@ mysql_password: # The path to the SSH key to be utilized for testing and burn-in # to configuration drives. When set, it should be set in both baremetal # and localhost groups, however this is only an override to the default. -# ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" +# ssh_public_key_path: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub" # If testing is true, then the environment is setup for using libvirt # virtual machines for the hardware instead of real hardware. diff --git a/playbooks/roles/bifrost-configdrives-dynamic/defaults/main.yml b/playbooks/roles/bifrost-configdrives-dynamic/defaults/main.yml index e33e95815..b4a89797b 100644 --- a/playbooks/roles/bifrost-configdrives-dynamic/defaults/main.yml +++ b/playbooks/roles/bifrost-configdrives-dynamic/defaults/main.yml @@ -6,7 +6,7 @@ write_interfaces_file: false http_boot_folder: /httpboot # Default location to the ssh public key for the user operating Bifrost. -ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" +ssh_public_key_path: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub" # Default interface name # TODO(TheJulia): Remove this default.