From ce7982192ffc27dcc1269b34139d0663fffc5c91 Mon Sep 17 00:00:00 2001
From: Harry Rybacki <hrybacki@redhat.com>
Date: Fri, 6 Jan 2017 14:07:26 -0500
Subject: [PATCH] Integrate undercloud_user var into oooq-extras

We need to differentiate local_working_dir from working_dir
as well as decouple the stack user from `ansible_user` var.
Both of these are causing issues as we begin to automate
deployments in more environments.

- Cleanup duplicate variables that are consumed via extras-common
  - Note: extras-common depends on the common role in OOOQ
- Cleanup redundant var and superfluous quotes from overcloud-scale
  role
- Cleanup redundant comments in <role>/defaults/main.yml

Closes-bug: 1654574
Change-Id: I9c7a3166ed1fc5042c11e420223134ea912b45c5
---
 .../defaults/main.yml                         |  1 -
 roles/baremetal-prep-overcloud/meta/main.yml  |  1 -
 .../baremetal-prep-virthost/defaults/main.yml |  3 +-
 roles/baremetal-prep-virthost/meta/main.yml   |  1 -
 roles/baremetal-undercloud/defaults/main.yml  |  3 +-
 roles/baremetal-undercloud/meta/main.yml      |  1 -
 roles/build-test-packages/defaults/main.yml   |  2 --
 roles/build-test-packages/meta/main.yml       |  1 -
 roles/collect-logs/defaults/main.yml          |  1 -
 roles/collect-logs/meta/main.yml              |  1 -
 roles/collect-logs/tasks/create-docs.yml      |  4 +--
 roles/extras-common/defaults/main.yml         |  9 ++----
 roles/gate-quickstart/defaults/main.yml       |  2 ++
 roles/modify-image/defaults/main.yml          |  2 +-
 roles/ovb-manage-stack/defaults/main.yml      |  3 --
 roles/ovb-manage-stack/meta/main.yml          |  1 -
 roles/overcloud-delete/defaults/main.yml      |  2 ++
 .../templates/overcloud_delete.sh.j2          |  2 +-
 roles/overcloud-deploy/defaults/main.yml      |  3 +-
 roles/overcloud-prep-config/defaults/main.yml |  2 --
 roles/overcloud-prep-config/meta/main.yml     |  1 -
 .../defaults/main.yml                         |  3 +-
 .../overcloud-prep-flavors/defaults/main.yml  |  2 ++
 roles/overcloud-prep-images/defaults/main.yml |  2 ++
 .../overcloud-prep-network/defaults/main.yml  |  2 ++
 roles/overcloud-scale/README.md               |  1 -
 roles/overcloud-scale/defaults/main.yml       |  2 --
 roles/overcloud-scale/meta/main.yml           |  1 -
 .../tasks/delete-original-node.yml            | 30 +++++++++----------
 roles/overcloud-scale/tasks/pre-scale.yml     | 24 +++++++--------
 roles/overcloud-scale/tasks/scale-nodes.yml   | 16 +++++-----
 .../templates/scale-deployment.j2             |  2 +-
 roles/overcloud-ssl/defaults/main.yml         |  3 +-
 roles/overcloud-ssl/meta/main.yml             |  1 -
 roles/overcloud-upgrade/defaults/main.yml     |  3 +-
 roles/overcloud-upgrade/meta/main.yml         |  1 -
 roles/repo-setup/defaults/main.yml            |  3 +-
 roles/repo-setup/meta/main.yml                |  1 -
 roles/undercloud-deploy/defaults/main.yml     |  2 ++
 roles/undercloud-setup/README.md              |  3 +-
 roles/undercloud-setup/defaults/main.yml      |  4 +--
 roles/undercloud-setup/meta/main.yml          |  2 ++
 .../tasks/non_root_user_setup.yml             |  2 +-
 .../templates/non_root_user_setup.sh.j2       | 10 +++----
 roles/validate-ha/defaults/main.yml           |  3 +-
 roles/validate-ha/meta/main.yml               |  1 -
 roles/validate-ipmi/defaults/main.yml         |  2 +-
 roles/validate-ipmi/meta/main.yml             |  1 -
 roles/validate-simple/defaults/main.yml       |  3 +-
 roles/validate-tempest/defaults/main.yml      |  3 +-
 roles/validate-tempest/meta/main.yml          |  1 -
 .../tasks/undercloud-config.yml               |  2 +-
 roles/validate-undercloud/defaults/main.yml   |  2 +-
 roles/virthost-full-cleanup/defaults/main.yml |  2 --
 roles/virthost-full-cleanup/meta/main.yml     |  1 -
 55 files changed, 80 insertions(+), 107 deletions(-)
 create mode 100644 roles/undercloud-setup/meta/main.yml

diff --git a/roles/baremetal-prep-overcloud/defaults/main.yml b/roles/baremetal-prep-overcloud/defaults/main.yml
index 281459c69..2d8edc7ff 100644
--- a/roles/baremetal-prep-overcloud/defaults/main.yml
+++ b/roles/baremetal-prep-overcloud/defaults/main.yml
@@ -1,5 +1,4 @@
 ---
-working_dir: /home/stack
 
 step_install_upstream_ipxe: false
 
diff --git a/roles/baremetal-prep-overcloud/meta/main.yml b/roles/baremetal-prep-overcloud/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/baremetal-prep-overcloud/meta/main.yml
+++ b/roles/baremetal-prep-overcloud/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/baremetal-prep-virthost/defaults/main.yml b/roles/baremetal-prep-virthost/defaults/main.yml
index 6f9d3dabf..b18ac945b 100644
--- a/roles/baremetal-prep-virthost/defaults/main.yml
+++ b/roles/baremetal-prep-virthost/defaults/main.yml
@@ -1,7 +1,6 @@
 ---
-# defaults file for ansible-role-tripleo-baremetal-prep-virthost
+
 virthost_provisioning_interface: eth1
 virthost_provisioning_ip: 192.168.122.1
 virthost_provisioning_netmask: 255.255.255.192
 virthost_provisioning_hwaddr: 52:54:00:00:76:00
-working_dir: /home/stack
diff --git a/roles/baremetal-prep-virthost/meta/main.yml b/roles/baremetal-prep-virthost/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/baremetal-prep-virthost/meta/main.yml
+++ b/roles/baremetal-prep-virthost/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/baremetal-undercloud/defaults/main.yml b/roles/baremetal-undercloud/defaults/main.yml
index c9d42bf8d..e677277f7 100644
--- a/roles/baremetal-undercloud/defaults/main.yml
+++ b/roles/baremetal-undercloud/defaults/main.yml
@@ -1,6 +1,5 @@
-working_dir: /home/stack
+---
 
-non_root_user: stack
 undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud"
 
 baremetal_provisioning_log: "{{ local_working_dir }}/baremetal_provision.log"
diff --git a/roles/baremetal-undercloud/meta/main.yml b/roles/baremetal-undercloud/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/baremetal-undercloud/meta/main.yml
+++ b/roles/baremetal-undercloud/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/build-test-packages/defaults/main.yml b/roles/build-test-packages/defaults/main.yml
index d557de045..1ce1deb7c 100644
--- a/roles/build-test-packages/defaults/main.yml
+++ b/roles/build-test-packages/defaults/main.yml
@@ -1,7 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-gate
 
-local_working_dir: "{{ lookup('env', 'HOME') }}/.quickstart"
 artg_dlrn_repo_url: "https://github.com/openstack-packages/DLRN.git"
 artg_rdoinfo_repo_url: "https://github.com/redhat-openstack/rdoinfo"
 artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
diff --git a/roles/build-test-packages/meta/main.yml b/roles/build-test-packages/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/build-test-packages/meta/main.yml
+++ b/roles/build-test-packages/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/collect-logs/defaults/main.yml b/roles/collect-logs/defaults/main.yml
index da31f1fd0..b21a213f8 100644
--- a/roles/collect-logs/defaults/main.yml
+++ b/roles/collect-logs/defaults/main.yml
@@ -1,6 +1,5 @@
 ---
 
-## collection related vars
 artcl_collect: true
 artcl_collect_list:
   - /var/log/
diff --git a/roles/collect-logs/meta/main.yml b/roles/collect-logs/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/collect-logs/meta/main.yml
+++ b/roles/collect-logs/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/collect-logs/tasks/create-docs.yml b/roles/collect-logs/tasks/create-docs.yml
index 04327c897..53ddba631 100644
--- a/roles/collect-logs/tasks/create-docs.yml
+++ b/roles/collect-logs/tasks/create-docs.yml
@@ -6,7 +6,7 @@
 
 - name: Unarchive shell scripts
   shell: >
-    gunzip "{{ artcl_collect_dir }}/undercloud/home/{{ ansible_user }}/{{ item }}.sh.gz";
+    gunzip "{{ artcl_collect_dir }}/undercloud/home/{{ undercloud_user }}/{{ item }}.sh.gz";
   with_items: "{{ artcl_create_docs_payload.included_deployment_scripts }}"
   ignore_errors: yes
   when:  artcl_gzip_only|bool
@@ -14,7 +14,7 @@
 - name: Generate rST docs from scripts and move to Sphinx src dir
   shell: >
      awk -f "{{ local_working_dir }}/usr/local/share/ansible/roles/collect-logs/scripts/doc_extrapolation.awk" \
-       "{{ artcl_collect_dir }}/undercloud/home/{{ ansible_user }}/{{ item }}.sh" > \
+       "{{ artcl_collect_dir }}/undercloud/home/{{ undercloud_user }}/{{ item }}.sh" > \
        "{{ artcl_docs_source_dir }}/{{ item }}.rst"
   with_items: "{{ artcl_create_docs_payload.included_deployment_scripts }}"
   ignore_errors: yes
diff --git a/roles/extras-common/defaults/main.yml b/roles/extras-common/defaults/main.yml
index ffbf4fc6b..629ab2f5b 100644
--- a/roles/extras-common/defaults/main.yml
+++ b/roles/extras-common/defaults/main.yml
@@ -1,11 +1,6 @@
+---
+
 overcloud_ipv6: false
 containerized_overcloud: false
 overcloud_templates_path: /usr/share/openstack-tripleo-heat-templates
 
-# TODO(hrybacki): remove after https://review.openstack.org/#/c/418998/ merges
-# The overcloud-deploy role had a dependency on the tripleo role (no longer
-# exists) which depdended on the common role which /has/ `enable_pacemaker`.
-# this workaround can be removed after https://review.openstack.org/#/c/413800/
-# is merged creating a dependency chain common<-extras-common<-overcloud-deploy
-enable_pacemaker: false
-
diff --git a/roles/gate-quickstart/defaults/main.yml b/roles/gate-quickstart/defaults/main.yml
index 1d974a442..a39c313e1 100644
--- a/roles/gate-quickstart/defaults/main.yml
+++ b/roles/gate-quickstart/defaults/main.yml
@@ -1,3 +1,5 @@
+---
+
 gated_projects:
   - openstack/tripleo-quickstart
   - openstack/tripleo-quickstart-extras
diff --git a/roles/modify-image/defaults/main.yml b/roles/modify-image/defaults/main.yml
index db57e411f..1a593fe66 100644
--- a/roles/modify-image/defaults/main.yml
+++ b/roles/modify-image/defaults/main.yml
@@ -1,4 +1,5 @@
 ---
+#  defaults file for modify-image
 
 # These variable do not have a default because there is no sane default. The
 # role will fail immediately if either is not specified.
@@ -23,4 +24,3 @@ vc_args: ""
 # modify_image_vc_cpu:
 modify_image_vc_verbose: false
 modify_image_vc_trace: false
-
diff --git a/roles/ovb-manage-stack/defaults/main.yml b/roles/ovb-manage-stack/defaults/main.yml
index b5b10386b..9117cc4dc 100644
--- a/roles/ovb-manage-stack/defaults/main.yml
+++ b/roles/ovb-manage-stack/defaults/main.yml
@@ -1,6 +1,4 @@
 ---
-# defaults for all ovb-stack related tasks
-local_working_dir: "{{ lookup('env', 'HOME') }}/.quickstart"
 
 release: mitaka
 
@@ -18,7 +16,6 @@ os_tenant_name: admin
 os_auth_url: 'http://10.0.1.10:5000/v2.0'
 cloud_name: qeos7
 
-ansible_user: stack
 stack_name: 'oooq-{{ prefix }}stack'
 rc_file: /home/{{ ansible_user }}/overcloudrc
 node_name: 'undercloud'
diff --git a/roles/ovb-manage-stack/meta/main.yml b/roles/ovb-manage-stack/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/ovb-manage-stack/meta/main.yml
+++ b/roles/ovb-manage-stack/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/overcloud-delete/defaults/main.yml b/roles/overcloud-delete/defaults/main.yml
index a59df720b..bca581cac 100644
--- a/roles/overcloud-delete/defaults/main.yml
+++ b/roles/overcloud-delete/defaults/main.yml
@@ -1,3 +1,5 @@
+---
+
 # Script and log locations used during the delete process.
 delete_script: overcloud_delete.sh.j2
 delete_log: "{{ working_dir }}/overcloud_delete.log"
diff --git a/roles/overcloud-delete/templates/overcloud_delete.sh.j2 b/roles/overcloud-delete/templates/overcloud_delete.sh.j2
index 848601c51..012f010ed 100644
--- a/roles/overcloud-delete/templates/overcloud_delete.sh.j2
+++ b/roles/overcloud-delete/templates/overcloud_delete.sh.j2
@@ -5,7 +5,7 @@
 ## * Gather informations on the deployment
 ## ::
 
-source {{ working_dir}}/stackrc
+source {{ working_dir }}/stackrc
 OVERCLOUD_NAME="overcloud"
 OVERCLOUD_ID=$(openstack stack list | grep "$OVERCLOUD_NAME" | awk '{print $2}')
 echo $OVERCLOUD_ID > {{ working_dir }}/overcloud_id
diff --git a/roles/overcloud-deploy/defaults/main.yml b/roles/overcloud-deploy/defaults/main.yml
index b352f5ede..120e8c934 100644
--- a/roles/overcloud-deploy/defaults/main.yml
+++ b/roles/overcloud-deploy/defaults/main.yml
@@ -1,5 +1,4 @@
-# set working dir so that the deployment can run independently
-working_dir: /home/stack
+---
 
 # Script and log locations used during the deploy process.
 deploy_script: overcloud-deploy.sh.j2
diff --git a/roles/overcloud-prep-config/defaults/main.yml b/roles/overcloud-prep-config/defaults/main.yml
index 4d11360d5..552a4fa62 100644
--- a/roles/overcloud-prep-config/defaults/main.yml
+++ b/roles/overcloud-prep-config/defaults/main.yml
@@ -1,5 +1,4 @@
 ---
-working_dir: /home/stack
 
 network_isolation: true
 
@@ -36,4 +35,3 @@ overcloud_custom_tht_log: overcloud_custom_tht_script.log
 
 bond_with_vlans_copy_nic_configs_script: bond-with-vlans-copy-nic-configs.sh.j2
 bond_with_vlans_nic_configs_log: bond_with_vlans_nic_configs_script_log
-
diff --git a/roles/overcloud-prep-config/meta/main.yml b/roles/overcloud-prep-config/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/overcloud-prep-config/meta/main.yml
+++ b/roles/overcloud-prep-config/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/overcloud-prep-containers/defaults/main.yml b/roles/overcloud-prep-containers/defaults/main.yml
index d02a2a95f..7d323a6d8 100644
--- a/roles/overcloud-prep-containers/defaults/main.yml
+++ b/roles/overcloud-prep-containers/defaults/main.yml
@@ -1,6 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-overcloud-prep-containers
-working_dir: /home/stack
+
 tripleo_common_dir: /usr/share/openstack-tripleo-common
 containerized_overcloud: false
 overcloud_prep_containers_script: overcloud-prep-containers.sh.j2
diff --git a/roles/overcloud-prep-flavors/defaults/main.yml b/roles/overcloud-prep-flavors/defaults/main.yml
index e1cf30a1b..32bb6a769 100644
--- a/roles/overcloud-prep-flavors/defaults/main.yml
+++ b/roles/overcloud-prep-flavors/defaults/main.yml
@@ -1,2 +1,4 @@
+---
+
 overcloud_prep_flavors_script: overcloud-prep-flavors.sh.j2
 overcloud_prep_flavors_log: "{{ working_dir }}/overcloud_prep_flavors.log"
diff --git a/roles/overcloud-prep-images/defaults/main.yml b/roles/overcloud-prep-images/defaults/main.yml
index 52e6b4a89..51156b3bd 100644
--- a/roles/overcloud-prep-images/defaults/main.yml
+++ b/roles/overcloud-prep-images/defaults/main.yml
@@ -1,3 +1,5 @@
+---
+
 overcloud_prep_images_script: overcloud-prep-images.sh.j2
 overcloud_prep_images_log: "{{ working_dir }}/overcloud_prep_images.log"
 
diff --git a/roles/overcloud-prep-network/defaults/main.yml b/roles/overcloud-prep-network/defaults/main.yml
index 74149d467..7daef181a 100644
--- a/roles/overcloud-prep-network/defaults/main.yml
+++ b/roles/overcloud-prep-network/defaults/main.yml
@@ -1,3 +1,5 @@
+---
+
 overcloud_prep_network_script: overcloud-prep-network.sh.j2
 overcloud_prep_network_log: "{{ working_dir }}/overcloud_prep_network.log"
 
diff --git a/roles/overcloud-scale/README.md b/roles/overcloud-scale/README.md
index 5393cea5a..84cb88d3f 100644
--- a/roles/overcloud-scale/README.md
+++ b/roles/overcloud-scale/README.md
@@ -19,7 +19,6 @@ A description of the settable variables for this role should go here, including
 
 - artosn_scale_nodes: <true> -- boolean value that will scale nodes if true
 - artosn_delete_original_node: <false> -- boolean value that will delete the original node of type that was scaled
-- artosn_working_dir: <'/home/stack'> -- working directory for the role. Assumes stackrc file is present at this location
 
 
 Dependencies
diff --git a/roles/overcloud-scale/defaults/main.yml b/roles/overcloud-scale/defaults/main.yml
index 7d3c5e370..5a0adcd2d 100644
--- a/roles/overcloud-scale/defaults/main.yml
+++ b/roles/overcloud-scale/defaults/main.yml
@@ -1,6 +1,4 @@
 ---
-# defaults file for ansible-role-tripleo-overcloud-scale-nodes
 
 artosn_scale_nodes: true
 artosn_delete_original_node: false
-artosn_working_dir: /home/stack
diff --git a/roles/overcloud-scale/meta/main.yml b/roles/overcloud-scale/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/overcloud-scale/meta/main.yml
+++ b/roles/overcloud-scale/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/overcloud-scale/tasks/delete-original-node.yml b/roles/overcloud-scale/tasks/delete-original-node.yml
index f2d417c92..29e624806 100644
--- a/roles/overcloud-scale/tasks/delete-original-node.yml
+++ b/roles/overcloud-scale/tasks/delete-original-node.yml
@@ -3,7 +3,7 @@
 # Delete the scaled node
 - name: Check the overcloud heat stack-list state
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
+    source {{ working_dir }}/stackrc;
     heat stack-list
   register: heat_stack_list_result
 
@@ -11,16 +11,16 @@
   fail: msg='Overcloud heat stack is not in a complete state'
   when: heat_stack_list_result.stdout.find('COMPLETE') == -1
 
-- name: Register uuid of original "{{ node_to_scale}}" node
+- name: Register uuid of original {{ node_to_scale }} node
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
-    nova list | grep -m 1 "{{ node_to_scale }}" | sed -e 's/|//g' | awk '{print $1}'
+    source {{ working_dir }}/stackrc;
+    nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}'
   register: node_id_to_delete
 
-- name: Register the Name of the original "{{ node_to_scale }}" node
+- name: Register the Name of the original {{ node_to_scale }} node
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
-    nova list | grep -m 1 "{{ node_to_scale }}" | sed -e 's/|//g' | awk '{print $2}'
+    source {{ working_dir }}/stackrc;
+    nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}'
   register: node_name_to_delete
 
 - name: Display node name to be deleted
@@ -29,18 +29,18 @@
 - name: Copy delete node script to undercloud
   template:
     src: delete-node.j2
-    dest: "{{ artosn_working_dir }}/delete-node.sh"
+    dest: "{{ working_dir }}/delete-node.sh"
     mode: 0755
 
 - name: Delete node by id
   shell: >
-    cat "{{ artosn_working_dir }}"/delete-node.sh;
-    "{{ artosn_working_dir }}"/delete-node.sh &> delete_node_scale_console.log;
+    cat {{ working_dir }}/delete-node.sh;
+    {{ working_dir }}/delete-node.sh &> delete_node_scale_console.log;
 
 # Verify the delete was successful
 - name: Poll heat stack-list to determine when node delete is complete
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
+    source {{ working_dir }}/stackrc;
     heat stack-list
   register: heat_stack_list_result
   until: heat_stack_list_result.stdout.find("COMPLETE") != -1
@@ -49,8 +49,8 @@
 
 - name: Determine the post scale node count
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
-    nova list | grep "{{ node_to_scale }}" | cut -f2- -d':' | wc -l
+    source {{ working_dir }}/stackrc;
+    nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
   register: post_scale_node_count
 
 - name: Remove deleted hosts from the host file
@@ -59,5 +59,5 @@
   delegate_to: localhost
 
 - name: Check that post delete node count is correct
-  fail: msg="Overcloud nova list does not show expected number of {{ node_to_scale }} services"
-  when: post_scale_node_count.stdout != "{{ initial_scale_value }}"
+  fail: msg=Overcloud nova list does not show expected number of {{ node_to_scale }} services
+  when: post_scale_node_count.stdout != {{ initial_scale_value }}
diff --git a/roles/overcloud-scale/tasks/pre-scale.yml b/roles/overcloud-scale/tasks/pre-scale.yml
index 5e2db53e8..68b7c283a 100644
--- a/roles/overcloud-scale/tasks/pre-scale.yml
+++ b/roles/overcloud-scale/tasks/pre-scale.yml
@@ -20,25 +20,25 @@
 # Prep for scaling overcloud
 - name: Determine initial number of node(s) that will be scaled
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
-    nova list | grep "{{ node_to_scale }}" | cut -f2- -d':' | wc -l
+    source {{ working_dir }}/stackrc;
+    nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
   register: initial_node_count
 
-- name: Register uuid of original "{{ node_to_scale}}" node
+- name: Register uuid of original {{ node_to_scale }} node
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
-    nova list | grep -m 1 "{{ node_to_scale }}" | sed -e 's/|//g' | awk '{print $1}'
+    source {{ working_dir }}/stackrc;
+    nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}'
   register: node_id_to_delete
 
-- name: Register the Name of the original "{{ node_to_scale }}" node
+- name: Register the Name of the original {{ node_to_scale }} node
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
-    nova list | grep -m 1 "{{ node_to_scale }}" | sed -e 's/|//g' | awk '{print $2}'
+    source {{ working_dir }}/stackrc;
+    nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}'
   register: node_name_to_delete
 
 - name: Register pre-scale nova list
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
+    source {{ working_dir }}/stackrc;
     nova list
   register: pre_scale_nova_list
 
@@ -49,12 +49,12 @@
 - name: Copy scale deployment template to undercloud
   template:
     src: scale-deployment.j2
-    dest: "{{ artosn_working_dir }}/scale-deployment.sh"
+    dest: "{{ working_dir }}/scale-deployment.sh"
     mode: 0755
 
 - name: Copy neutron l3 ha heat template
   when: enable_pacemaker|bool and number_of_controllers|int < 3
   template:
-    src: "neutronl3ha.yaml.j2"
-    dest: "{{ artosn_working_dir }}/neutronl3ha.yaml"
+    src: neutronl3ha.yaml.j2
+    dest: "{{ working_dir }}/neutronl3ha.yaml"
     mode: 0755
diff --git a/roles/overcloud-scale/tasks/scale-nodes.yml b/roles/overcloud-scale/tasks/scale-nodes.yml
index 75d0d9643..e4a010c42 100644
--- a/roles/overcloud-scale/tasks/scale-nodes.yml
+++ b/roles/overcloud-scale/tasks/scale-nodes.yml
@@ -3,12 +3,12 @@
 # Do the scale
 - name: Call scale deployment script
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
-    "{{ artosn_working_dir }}"/scale-deployment.sh &> overcloud_deployment_scale_console.log;
+    source {{ working_dir }}/stackrc;
+    {{ working_dir }}/scale-deployment.sh &> overcloud_deployment_scale_console.log;
 
 - name: Poll heat stack-list to determine when node scale is complete
   shell: >
-    source "{{ artosn_working_dir }}"/stackrc;
+    source {{ working_dir }}/stackrc;
     heat stack-list
   register: heat_stack_list_result
   until: heat_stack_list_result.stdout.find("COMPLETE") != -1
@@ -17,7 +17,7 @@
 
 - name: Register post-scale nova list
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
+    source {{ working_dir }}/stackrc;
     nova list
   register: post_scale_nova_list
 
@@ -28,10 +28,10 @@
 # Verify the scale
 - name: Determine the post scale node count
   shell: >
-    source "{{ artosn_working_dir }}/stackrc";
-    nova list | grep "{{ node_to_scale }}" | cut -f2- -d':' | wc -l
+    source {{ working_dir }}/stackrc;
+    nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
   register: post_scale_node_count
 
 - name: Check that post scale node count is correct
-  fail: msg="Overcloud nova list does not show expected number of {{ node_to_scale }} services"
-  when: post_scale_node_count.stdout != "{{ final_scale_value }}"
+  fail: msg=Overcloud nova list does not show expected number of {{ node_to_scale }} services
+  when: post_scale_node_count.stdout != {{ final_scale_value }}
diff --git a/roles/overcloud-scale/templates/scale-deployment.j2 b/roles/overcloud-scale/templates/scale-deployment.j2
index db8a3bde4..b16f7bb4e 100644
--- a/roles/overcloud-scale/templates/scale-deployment.j2
+++ b/roles/overcloud-scale/templates/scale-deployment.j2
@@ -10,7 +10,7 @@ set -eux
 ## * Source in undercloud credentials.
 ## ::
 
-source {{ artosn_working_dir }}/stackrc
+source {{ working_dir }}/stackrc
 
 ### --stop_docs
 
diff --git a/roles/overcloud-ssl/defaults/main.yml b/roles/overcloud-ssl/defaults/main.yml
index 28e6bc1f4..a6ab8ed2e 100644
--- a/roles/overcloud-ssl/defaults/main.yml
+++ b/roles/overcloud-ssl/defaults/main.yml
@@ -1,6 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-ssl
-working_dir: /home/stack
+
 ssl_overcloud: false
 
 overcloud_public_vip: 10.0.0.5
diff --git a/roles/overcloud-ssl/meta/main.yml b/roles/overcloud-ssl/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/overcloud-ssl/meta/main.yml
+++ b/roles/overcloud-ssl/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/overcloud-upgrade/defaults/main.yml b/roles/overcloud-upgrade/defaults/main.yml
index 3f2104519..94c2893d4 100644
--- a/roles/overcloud-upgrade/defaults/main.yml
+++ b/roles/overcloud-upgrade/defaults/main.yml
@@ -1,4 +1,5 @@
 ---
+
 network_isolation: true
 # pre upgrade settings:
 upgrade_overcloud_dns_server: 8.8.8.8
@@ -20,7 +21,7 @@ repos_url:
   - http://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/{{ upgrade_delorean_hash | default('current-passed-ci')}}/delorean.repo
   - http://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/delorean-deps.repo
 # upgrade settings:
-upgrade_working_dir: /home/stack
+upgrade_working_dir: {{ working_dir }}
 tht_dir: tripleo-heat-templates
 # scripts
 undercloud_upgrade_script: upgrade-undercloud.sh.j2
diff --git a/roles/overcloud-upgrade/meta/main.yml b/roles/overcloud-upgrade/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/overcloud-upgrade/meta/main.yml
+++ b/roles/overcloud-upgrade/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/repo-setup/defaults/main.yml b/roles/repo-setup/defaults/main.yml
index 815115fec..1ef0ecb27 100644
--- a/roles/repo-setup/defaults/main.yml
+++ b/roles/repo-setup/defaults/main.yml
@@ -1,4 +1,5 @@
-working_dir: /home/stack
+---
+
 repo_setup_script: repo_setup.sh.j2
 repo_setup_log: "{{ working_dir }}/repo_setup.log"
 repo_run_live: true
diff --git a/roles/repo-setup/meta/main.yml b/roles/repo-setup/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/repo-setup/meta/main.yml
+++ b/roles/repo-setup/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/undercloud-deploy/defaults/main.yml b/roles/undercloud-deploy/defaults/main.yml
index a77fcfd8c..03f476942 100644
--- a/roles/undercloud-deploy/defaults/main.yml
+++ b/roles/undercloud-deploy/defaults/main.yml
@@ -1,3 +1,5 @@
+---
+
 undercloud_config_file: undercloud.conf.j2
 undercloud_install_script: undercloud-install.sh.j2
 undercloud_post_install_script: undercloud-install-post.sh.j2
diff --git a/roles/undercloud-setup/README.md b/roles/undercloud-setup/README.md
index e34e4c3eb..a94758d9f 100644
--- a/roles/undercloud-setup/README.md
+++ b/roles/undercloud-setup/README.md
@@ -27,7 +27,8 @@ Role Variables
 --------------
 
 - local_working_dir: <"{{ lookup('env', 'HOME') }}/.quickstart"> -- Directory for quickstart.sh script
-- non_root_user: <stack>  -- Default user to execute TripleO Quickstart
+- non_root_user: <stack>  -- The non-root user operating on the virthost
+- undercloud_user: <stack> -- The non-root user operating on the undercloud
 - undercloud_key: <"{{ local_working_dir }}/id_rsa_undercloud"> -- Key to access the undercloud node/machine
 - non_root_user_setup: <true> -- Switch to setup a non-root user
 - toci_vxlan_networking: <false> -- Switch to setup the VXLAN networking from devstack-gate
diff --git a/roles/undercloud-setup/defaults/main.yml b/roles/undercloud-setup/defaults/main.yml
index 493991444..b4fe2a39b 100644
--- a/roles/undercloud-setup/defaults/main.yml
+++ b/roles/undercloud-setup/defaults/main.yml
@@ -1,6 +1,5 @@
-local_working_dir: "{{ lookup('env', 'HOME') }}/.quickstart"
+---
 
-non_root_user: stack
 undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud"
 non_root_user_setup: true
 
@@ -22,4 +21,3 @@ external_interface: eth2
 external_interface_ip: 10.0.0.1
 external_interface_netmask: 255.255.255.0
 custom_nameserver: 8.8.8.8
-
diff --git a/roles/undercloud-setup/meta/main.yml b/roles/undercloud-setup/meta/main.yml
new file mode 100644
index 000000000..819da26a3
--- /dev/null
+++ b/roles/undercloud-setup/meta/main.yml
@@ -0,0 +1,2 @@
+dependencies:
+  - extras-common
diff --git a/roles/undercloud-setup/tasks/non_root_user_setup.yml b/roles/undercloud-setup/tasks/non_root_user_setup.yml
index ce2fc5394..db85007b4 100644
--- a/roles/undercloud-setup/tasks/non_root_user_setup.yml
+++ b/roles/undercloud-setup/tasks/non_root_user_setup.yml
@@ -19,7 +19,7 @@
 
 - name: Configure non-root user authorized_keys on undercloud
   authorized_key:
-    user: "{{ non_root_user }}"
+    user: "{{ undercloud_user }}"
     key: "{{ item }}"
   with_file:
     - "{{ undercloud_key }}.pub"
diff --git a/roles/undercloud-setup/templates/non_root_user_setup.sh.j2 b/roles/undercloud-setup/templates/non_root_user_setup.sh.j2
index d32c33eec..a8bbd1eef 100644
--- a/roles/undercloud-setup/templates/non_root_user_setup.sh.j2
+++ b/roles/undercloud-setup/templates/non_root_user_setup.sh.j2
@@ -10,14 +10,14 @@ set -eux
 ## * Create non-root user on undercloud
 ## ::
 
-id -u "{{ non_root_user }}" || \
-sudo useradd -s /bin/bash -d /home/"{{ non_root_user }}" "{{ non_root_user }}"
+id -u "{{ undercloud_user }}" || \
+sudo useradd -s /bin/bash -d /home/"{{ undercloud_user }}" "{{ undercloud_user }}"
 
 ## * Grant sudo privileges to non-root user on undercloud
 ## ::
 
-echo "{{ non_root_user }} ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/{{ non_root_user }}
-sudo chown root:root  /etc/sudoers.d/{{ non_root_user }}
-sudo chmod 440 /etc/sudoers.d/{{ non_root_user }}
+echo "{{ undercloud_user }} ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/{{ undercloud_user }}
+sudo chown root:root  /etc/sudoers.d/{{ undercloud_user }}
+sudo chmod 440 /etc/sudoers.d/{{ undercloud_user }}
 
 ### --stop_docs
diff --git a/roles/validate-ha/defaults/main.yml b/roles/validate-ha/defaults/main.yml
index 354a46596..011fd36e3 100644
--- a/roles/validate-ha/defaults/main.yml
+++ b/roles/validate-ha/defaults/main.yml
@@ -1,6 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-overcloud-validate-ha
-working_dir: /home/stack
+
 overcloud_working_dir: /home/heat-admin
 
 environment_file: environment.j2
diff --git a/roles/validate-ha/meta/main.yml b/roles/validate-ha/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/validate-ha/meta/main.yml
+++ b/roles/validate-ha/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/validate-ipmi/defaults/main.yml b/roles/validate-ipmi/defaults/main.yml
index 2db07b0cf..716e8b545 100644
--- a/roles/validate-ipmi/defaults/main.yml
+++ b/roles/validate-ipmi/defaults/main.yml
@@ -1,3 +1,3 @@
 ---
+
 validate_ipmi_step: true
-working_dir: /home/stack
diff --git a/roles/validate-ipmi/meta/main.yml b/roles/validate-ipmi/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/validate-ipmi/meta/main.yml
+++ b/roles/validate-ipmi/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/validate-simple/defaults/main.yml b/roles/validate-simple/defaults/main.yml
index 9367d8962..10e6c03d7 100644
--- a/roles/validate-simple/defaults/main.yml
+++ b/roles/validate-simple/defaults/main.yml
@@ -1,6 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-overcloud-validate
-working_dir: /home/stack
+
 tenantrc: overcloudrc
 validate_script: overcloud-validate.sh.j2
 validate_template: tenantvm_floatingip.yaml.j2
diff --git a/roles/validate-tempest/defaults/main.yml b/roles/validate-tempest/defaults/main.yml
index 1e8de5979..4fda70b81 100644
--- a/roles/validate-tempest/defaults/main.yml
+++ b/roles/validate-tempest/defaults/main.yml
@@ -1,5 +1,5 @@
 ---
-# defaults file for ansible-role-tripleo-tempest
+
 configure_tempest: true
 floating_ip_cidr: "{{ undercloud_network_cidr|default('192.168.24.0/24') }}"
 public_net_pool_start: "{{ floating_ip_cidr|nthhost(100) }}"
@@ -7,7 +7,6 @@ public_net_pool_end: "{{ floating_ip_cidr|nthhost(120) }}"
 public_net_gateway: "{{ floating_ip_cidr|nthhost(1) }}"
 tempest_log_file: 'tempest_output.log'
 test_regex: '.*smoke'
-working_dir: '/home/stack'
 
 public_net_name: public
 public_network_type: flat
diff --git a/roles/validate-tempest/meta/main.yml b/roles/validate-tempest/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/validate-tempest/meta/main.yml
+++ b/roles/validate-tempest/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-
diff --git a/roles/validate-tempest/tasks/undercloud-config.yml b/roles/validate-tempest/tasks/undercloud-config.yml
index 82d22e35d..271a7c96f 100644
--- a/roles/validate-tempest/tasks/undercloud-config.yml
+++ b/roles/validate-tempest/tasks/undercloud-config.yml
@@ -24,4 +24,4 @@
 - name: Copy tempest input file to undercloud
   copy:
     src: "tempest-undercloud-config.conf"
-    dest: "/home/stack/{{ tempest_deployer_input_file }}"
+    dest: "{{ working_dir }}/{{ tempest_deployer_input_file }}"
diff --git a/roles/validate-undercloud/defaults/main.yml b/roles/validate-undercloud/defaults/main.yml
index 2158237db..9c683e56f 100644
--- a/roles/validate-undercloud/defaults/main.yml
+++ b/roles/validate-undercloud/defaults/main.yml
@@ -1,7 +1,7 @@
 ---
+
 undercloud_sanity_check_script: undercloud-sanity-check.sh.j2
 undercloud_sanity_check_log: "{{ working_dir }}/undercloud_sanity_check.log"
 undercloud_check_idempotency: false
 undercloud_check_sanity: false
 undercloud_reinstall_log: "{{ working_dir }}/undercloud_reinstall.log"
-
diff --git a/roles/virthost-full-cleanup/defaults/main.yml b/roles/virthost-full-cleanup/defaults/main.yml
index fe0883059..ed97d539c 100644
--- a/roles/virthost-full-cleanup/defaults/main.yml
+++ b/roles/virthost-full-cleanup/defaults/main.yml
@@ -1,3 +1 @@
 ---
-# defaults file for ansible-role-tripleo-cleanup-nfo
-non_root_user: stack
diff --git a/roles/virthost-full-cleanup/meta/main.yml b/roles/virthost-full-cleanup/meta/main.yml
index a1f0ecb27..819da26a3 100644
--- a/roles/virthost-full-cleanup/meta/main.yml
+++ b/roles/virthost-full-cleanup/meta/main.yml
@@ -1,3 +1,2 @@
 dependencies:
   - extras-common
-