From 9d9a8b39d314d3ee54cf34f17b6cc78db2dd39bd Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Thu, 22 Sep 2016 00:16:49 +0200 Subject: [PATCH] Loading sources files from server and not creating it locally. Templates for sources files are regenerated by server. --- roles/base/tasks/apt-sources.yml | 20 ------- roles/base/tasks/main.yml | 5 -- .../templates/ansible-ansible-trusty.list | 2 - roles/base/templates/sources.list | 56 ------------------- roles/prereq/tasks/repos.yml | 29 +++++----- 5 files changed, 13 insertions(+), 99 deletions(-) delete mode 100644 roles/base/tasks/apt-sources.yml delete mode 100644 roles/base/templates/ansible-ansible-trusty.list delete mode 100644 roles/base/templates/sources.list diff --git a/roles/base/tasks/apt-sources.yml b/roles/base/tasks/apt-sources.yml deleted file mode 100644 index e0bf876..0000000 --- a/roles/base/tasks/apt-sources.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Manage Repository changes (but only for physical machines) - -- name: Change repository sources - template: - src: sources.list - dest: /etc/apt/sources.list - when: ansible_product_name != "VirtualBox" - -- name: Adding/changing ansible ppa local mirror - get_url: - url: "http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-ansible-trusty.list" - dest: /etc/apt/sources.list.d/ansible-ansible-trusty.list - owner: root - group: root - mode: 0644 - when: ansible_product_name != "VirtualBox" - -- name: Updating package database - apt: update_cache=yes diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 508f879..978bb0b 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -5,11 +5,6 @@ # Requires fact execpath, already set by prereq role. -- include: apt-sources.yml - tags: - - base - - apt-sources - - include: virtualbox-guest-addons.yml tags: - base diff --git a/roles/base/templates/ansible-ansible-trusty.list b/roles/base/templates/ansible-ansible-trusty.list deleted file mode 100644 index 9b3f377..0000000 --- a/roles/base/templates/ansible-ansible-trusty.list +++ /dev/null @@ -1,2 +0,0 @@ -deb http://{{ execpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main -# deb-src http://{{ execpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main diff --git a/roles/base/templates/sources.list b/roles/base/templates/sources.list deleted file mode 100644 index 82a2d4d..0000000 --- a/roles/base/templates/sources.list +++ /dev/null @@ -1,56 +0,0 @@ -#deb cdrom:[Edubuntu 14.04 LTS _Trusty Tahr_ - Release i386 (20140417)]/ trusty main multiverse restricted universe - -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty main restricted -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates main restricted -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty universe -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty universe -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates universe -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty multiverse -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty multiverse -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates multiverse -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse -deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse - -deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted -deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted -deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security universe -deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security universe -deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security multiverse -deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://{{ execpath }}archive.canonical.com/ubuntu trusty partner -# deb-src http://{{ execpath }}archive.canonical.com/ubuntu trusty partner - -## This software is not part of Ubuntu, but is offered by third-party -## developers who want to ship their latest software. -deb http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main -deb-src http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main diff --git a/roles/prereq/tasks/repos.yml b/roles/prereq/tasks/repos.yml index a681716..5e8637e 100644 --- a/roles/prereq/tasks/repos.yml +++ b/roles/prereq/tasks/repos.yml @@ -2,22 +2,19 @@ # Fixing all the stuff around repositories. # Provide a clean and ordered sources.list -- name: Replace sources.list with a clean one. - template: - src: sources.list +- name: Change main repositories + get_url: + url: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/sources.list" dest: /etc/apt/sources.list -- name: Adding Ansible repo - template: - src: ansible.list - dest: /etc/apt/sources.list.d/ansible.list +- name: Adding additional repositories + get_url: + src: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/{{ item }}" + dest: "/etc/apt/sources.list.d/{{ item }}" + with_items: + - ansible-ansible-trusty.list + - libreoffice-ppa-trusty.list + - bglug-trusty.list -- name: Adding LibreOffice repo - template: - src: libreoffice.list - dest: /etc/apt/sources.list.d/libreoffice.list - -- name: Adding BgLUG repo - template: - src: bglug.list - dest: /etc/apt/sources.list.d/bglug.list +- name: Updating package database + apt: update_cache=yes