diff --git a/roles/collect-logs/templates/get_host_info.sh.j2 b/roles/collect-logs/templates/get_host_info.sh.j2 index 2d1c80822..7d373bc8d 100644 --- a/roles/collect-logs/templates/get_host_info.sh.j2 +++ b/roles/collect-logs/templates/get_host_info.sh.j2 @@ -27,9 +27,9 @@ find ~jenkins -iname tripleo-overcloud-passwords -execdir cat '{}' ';' sudo systemctl list-units --full --all -if [ -e /home/{{ undercloud_user }}/stackrc ] ; then +if [ -e {{ working_dir }}/stackrc ] ; then bash <<-EOF &>/var/log/postci.txt - source /home/{{ undercloud_user }}/stackrc + source {{ working_dir }}/stackrc openstack <<-EOC server list -f yaml workflow list -f yaml diff --git a/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 b/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 index 344571e54..a4c26d3f8 100644 --- a/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 +++ b/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source ${HOME}/stackrc +source {{ working_dir }}/stackrc # We did not have OVERCLOUD_ROLES var in the newton version of the # get-occ-config script. Instead we need to use CONTROLLER_HOSTS var. diff --git a/roles/overcloud-deploy/templates/overcloud-status.sh.j2 b/roles/overcloud-deploy/templates/overcloud-status.sh.j2 index 91d0fb43b..00a93d3b5 100644 --- a/roles/overcloud-deploy/templates/overcloud-status.sh.j2 +++ b/roles/overcloud-deploy/templates/overcloud-status.sh.j2 @@ -1,2 +1,2 @@ -source $HOME/stackrc +source {{ working_dir }}/stackrc openstack stack resource list -n5 overcloud | grep -v COMPLETE diff --git a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 index 1887342e6..0c496972f 100644 --- a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 +++ b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 @@ -187,7 +187,7 @@ introspect() done set +e - timeout $1 bash -c -- 'source $HOME/stackrc; \ + timeout $1 bash -c -- 'source {{ working_dir }}/stackrc; \ on_count=$(openstack baremetal node list -f json|jq -r ".[]| select(.[\"Power State\"] == \"power on\")| .[\"UUID\"]" | wc -l) ; \ while [ $on_count -gt 0 ]; do \ sleep 30s; \ diff --git a/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 b/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 index 0dc910538..cbbf5a400 100755 --- a/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 +++ b/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 @@ -48,7 +48,7 @@ openssl rsa -in {{ working_dir }}/server-key.pem \ ## the certificate ## :: -openssl x509 -req -in server-req.pem -days 365 \ +openssl x509 -req -in {{ working_dir }}/server-req.pem -days 365 \ -CA {{ working_dir }}/overcloud-cacert.pem \ -CAkey {{ working_dir }}/overcloud-ca-privkey.pem \ -set_serial 01 -out {{ working_dir }}/server-cert.pem \ diff --git a/roles/undercloud-deploy/tasks/post-install.yml b/roles/undercloud-deploy/tasks/post-install.yml index f50c2a786..ec721fad5 100644 --- a/roles/undercloud-deploy/tasks/post-install.yml +++ b/roles/undercloud-deploy/tasks/post-install.yml @@ -27,3 +27,13 @@ line: "export OS_PASSWORD={{ undercloud_admin_password.stdout }}" regexp: "OS_PASSWORD" +- name: Copy stackrc created at the UC user $HOME to the working dir + tags: + - undercloud-post-install + copy: + src: /home/{{ undercloud_user }}/stackrc + dest: "{{ working_dir }}/stackrc" + owner: "{{ undercloud_user }}" + mode: 0640 + become: true + when: containerized_undercloud|bool