work around the odd way that ansible does conditional roles
Change-Id: Iaa89dcb15c0dd967fb3c66ee957fe30327b79c1e
diff --git a/roles/local-ubuntu-repository/tasks/main.yml b/roles/local-ubuntu-repository/tasks/main.yml
index a91dd1a..dd9be2b 100644
--- a/roles/local-ubuntu-repository/tasks/main.yml
+++ b/roles/local-ubuntu-repository/tasks/main.yml
@@ -4,7 +4,7 @@
template:
backup: yes
dest: /etc/apt/sources.list
- src: files/sources.list.j2
+ src: sources.list.j2
group: root
owner: root
mode: 0644
@@ -22,25 +22,25 @@
changed_when: false
when: ubuntu_apt_repo is defined
-#- name: Backup Existing Respositories
-# become: yes
-# copy:
-# remote_src: True
-# src: "{{ item }}"
-# dest: "{{ item }}.{{ timestamp }}~"
-# with_items: "{{ existing_repo_lists.stdout_lines }}"
-# when: ubuntu_apt_repo is defined
+- name: Backup Existing Respositories
+ become: yes
+ copy:
+ remote_src: True
+ src: "{{ item }}"
+ dest: "{{ item }}.{{ timestamp }}~"
+ with_items: "{{ existing_repo_lists['stdout_lines'] | default([]) }}"
+ when: ubuntu_apt_repo is defined
-#- name: Remove Existing Repositories
-# become: yes
-# file:
-# state: absent
-# path: "{{ item }}"
-# with_items: "{{ existing_repo_lists.stdout_lines }}"
-# when: ubuntu_apt_repo is defined
+- name: Remove Existing Repositories
+ become: yes
+ file:
+ state: absent
+ path: "{{ item }}"
+ with_items: "{{ existing_repo_lists['stdout_lines'] | default([]) }}"
+ when: ubuntu_apt_repo is defined
-#- name: Ensure Update Repository List
-# become: yes
-# apt:
-# update_cache: yes
-# when: ubuntu_apt_repo is defined
+- name: Ensure Update Repository List
+ become: yes
+ apt:
+ update_cache: yes
+ when: ubuntu_apt_repo is defined