[CORD-1145]
Option to enable apt-cache, conform feature toggles

Change-Id: I560808f4bf292063f9a5d6826b247520e5df3a04
diff --git a/roles/compute-prep/defaults/main.yml b/roles/compute-prep/defaults/main.yml
index dc0af11..68d52a6 100644
--- a/roles/compute-prep/defaults/main.yml
+++ b/roles/compute-prep/defaults/main.yml
@@ -5,3 +5,5 @@
 
 pod_sshkey_name: "headnode"
 
+use_maas: False
+
diff --git a/roles/compute-prep/tasks/main.yml b/roles/compute-prep/tasks/main.yml
index 0a5274b..13dc7ab 100644
--- a/roles/compute-prep/tasks/main.yml
+++ b/roles/compute-prep/tasks/main.yml
@@ -16,7 +16,7 @@
     groups: adm
 
 - name: Add pod public key to user accounts
-  when: not on_maas
+  when: not use_maas
   authorized_key:
     user: "{{ item }}"
     key: "{{ lookup('file', '{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub') }}"
@@ -25,7 +25,7 @@
     - ubuntu
 
 - name: Add pod public key to user accounts (MaaS)
-  when: on_maas
+  when: use_maas
   authorized_key:
     user: "{{ item }}"
     key: "{{ lookup('file', '/opt/cord_profile/node_key.pub') }}"
@@ -34,7 +34,7 @@
     - ubuntu
 
 - name: Copy over CA certs from head node (MaaS)
-  when: on_maas
+  when: use_maas
   synchronize:
     src: "/usr/local/share/ca-certificates/"
     dest: "/usr/local/share/ca-certificates/"
diff --git a/roles/cord-profile/defaults/main.yml b/roles/cord-profile/defaults/main.yml
index 0f71033..6a30e58 100644
--- a/roles/cord-profile/defaults/main.yml
+++ b/roles/cord-profile/defaults/main.yml
@@ -22,7 +22,7 @@
 use_openstack: True
 
 # Will be overridden if doing a full pod build
-on_maas: False
+use_maas: False
 
 # set to True to create the xos_redis container in the bootstrap context
 use_redis: True
diff --git a/roles/create-lxd/defaults/main.yml b/roles/create-lxd/defaults/main.yml
index 891ed45..f4974cb 100644
--- a/roles/create-lxd/defaults/main.yml
+++ b/roles/create-lxd/defaults/main.yml
@@ -10,3 +10,4 @@
 hwaddr_prefix: "c2a4"
 mgmt_ipv4_first_octets: "192.168.200"
 
+use_maas: False
diff --git a/roles/create-lxd/tasks/main.yml b/roles/create-lxd/tasks/main.yml
index ecf095a..b27e08c 100644
--- a/roles/create-lxd/tasks/main.yml
+++ b/roles/create-lxd/tasks/main.yml
@@ -55,19 +55,19 @@
   with_items: "{{ head_lxd_list }}"
 
 - name: fetch IP of DHCP harvester
-  when: on_maas
+  when: use_maas
   command: docker-ip harvester
   register: harvester_ip
   changed_when: False
 
 - name: force a harvest to get container name resolution
-  when: on_maas
+  when: use_maas
   uri:
     url: http://{{ harvester_ip.stdout }}:8954/harvest
     method: POST
 
 - name: wait for container name resolution
-  when: on_maas
+  when: use_maas
   host_dns_check:
     hosts: "{{ head_lxd_list | map(attribute='name') | list | to_json }}"
     command_on_fail: "curl -sS --connect-timeout 3 -XPOST http://{{ harvester_ip.stdout }}:8954/harvest"
diff --git a/roles/head-prep/defaults/main.yml b/roles/head-prep/defaults/main.yml
index 17a4e22..f6ac6cc 100644
--- a/roles/head-prep/defaults/main.yml
+++ b/roles/head-prep/defaults/main.yml
@@ -1,7 +1,7 @@
 ---
 # head-prep/defaults/main.yml
 
-on_maas: false
+use_maas: false
 
 ssh_pki_dir: "{{ playbook_dir }}/ssh_pki"
 ssh_keytype: rsa
diff --git a/roles/lxd-finish/defaults/main.yml b/roles/lxd-finish/defaults/main.yml
index 0f65371..619335d 100644
--- a/roles/lxd-finish/defaults/main.yml
+++ b/roles/lxd-finish/defaults/main.yml
@@ -1,6 +1,8 @@
 ---
 # lxd-finish/defaults/main.yml
 
+use_apt_cache: True
+
 apt_cacher_name: apt-cache
 
 run_dist_upgrade: False
diff --git a/roles/lxd-finish/tasks/main.yml b/roles/lxd-finish/tasks/main.yml
index 4c02bce..d3fa47b 100644
--- a/roles/lxd-finish/tasks/main.yml
+++ b/roles/lxd-finish/tasks/main.yml
@@ -25,6 +25,7 @@
     - skip_ansible_lint # running a sub job
 
 - name: Have containers use the apt-cache
+  when: use_apt_cache
   command: >
     ansible containers -b -u ubuntu
      -m lineinfile
diff --git a/roles/ssh-install-maas/defaults/main.yml b/roles/ssh-install-maas/defaults/main.yml
index 15abf98..41cbff6 100644
--- a/roles/ssh-install-maas/defaults/main.yml
+++ b/roles/ssh-install-maas/defaults/main.yml
@@ -8,4 +8,4 @@
 # name of master ssh key for this pod
 pod_sshkey_name: "headnode"
 
-on_maas: False
+use_maas: False
diff --git a/roles/ssh-install-maas/tasks/main.yml b/roles/ssh-install-maas/tasks/main.yml
index 96d952d..f47ce35 100644
--- a/roles/ssh-install-maas/tasks/main.yml
+++ b/roles/ssh-install-maas/tasks/main.yml
@@ -5,7 +5,7 @@
 # users/perms may seem off, but is identical to that role
 
 - name: Create ssh key directory for MaaS
-  when: on_maas
+  when: use_maas
   file:
     dest: "/etc/maas/.ssh/"
     mode: 0755
@@ -14,7 +14,7 @@
     state: directory
 
 - name: Copy ssh private key for MaaS
-  when: on_maas
+  when: use_maas
   copy:
     src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
     dest: "/etc/maas/.ssh/cord_rsa"
@@ -24,7 +24,7 @@
     backup: true
 
 - name: Copy ssh public key for MaaS
-  when: on_maas
+  when: use_maas
   copy:
     src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub"
     dest: "/etc/maas/.ssh/cord_rsa.pub"
diff --git a/roles/ssh-install/defaults/main.yml b/roles/ssh-install/defaults/main.yml
index 1fbddfa..5459cd4 100644
--- a/roles/ssh-install/defaults/main.yml
+++ b/roles/ssh-install/defaults/main.yml
@@ -8,4 +8,4 @@
 # name of master ssh key for this pod
 pod_sshkey_name: "headnode"
 
-on_maas: False
+use_maas: False