use dist-named includes. fix apt-repository for rpi

Sat, 19 Mar 2016 03:11:11 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Sat, 19 Mar 2016 03:11:11 -0400
changeset 10
ee86092e374a
parent 9
40d4e3ca3b42
child 11
8e5dcc6e199a

use dist-named includes. fix apt-repository for rpi

roles/devbox/tasks/debian.yml file | annotate | diff | comparison | revisions
roles/devbox/tasks/dist-debian.yml file | annotate | diff | comparison | revisions
roles/devbox/tasks/main.yml file | annotate | diff | comparison | revisions
rename from roles/devbox/tasks/debian.yml
rename to roles/devbox/tasks/dist-debian.yml
--- a/roles/devbox/tasks/debian.yml
+++ b/roles/devbox/tasks/dist-debian.yml
@@ -1,5 +1,8 @@
 ---
 
+- name: add python-apt
+  apt: name=python-apt state=installed
+
 # Not used here, but nice to have ready
 - name: add backports repo
   apt_repository:
@@ -7,6 +10,7 @@
   tags: repos
 
 - name: add pgdg repo
+  when: ansible_architecture == 'amd64'
   apt_repository:
     repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main"
   tags: repos
@@ -16,7 +20,7 @@
   tags: packages, upgrade
 
 - name: Install base packages
-  apt: name={{item}} state=installed
+  apt: name={{item}} state=installed default_release={{ansible_distribution_release}}-backports
   with_items:
     - sudo
     - build-essential
@@ -31,7 +35,7 @@
 
 - name: Install GUI packages
   when: gui.enabled
-  apt: name={{item}} state=installed
+  apt: name={{item}} state=installed default_release={{ansible_distribution_release}}-backports
   with_items:
     - i3
     - vim-gtk
--- a/roles/devbox/tasks/main.yml
+++ b/roles/devbox/tasks/main.yml
@@ -1,7 +1,13 @@
 ---
 
-- include: debian.yml
-  when: ansible_distribution == 'Debian'
+- include: dist-debian.yml
+  when: ansible_os_family == 'Debian'
+
+- include: dist-macosx.yml
+  when: ansible_os_family == 'MacOSX'
+
+- include: dist-freebsd.yml
+  when: ansible_os_family == 'FreeBSD'
 
 
 # sudo may not be everywhere. wheel is a common alternative

mercurial