Browse Source

Split out install from PPA behaviour

master
Chris Smith 10 years ago
parent
commit
3206b31c06
2 changed files with 21 additions and 13 deletions
  1. 5
    13
      playbooks/includes/install-fish
  2. 16
    0
      playbooks/includes/install-from-ppa

+ 5
- 13
playbooks/includes/install-fish View File

@@ -1,16 +1,8 @@
1 1
 ---
2 2
 # Adds the fish-shell release PPA and installs fish.
3 3
 
4
-- name: install python-pycurl (needed to add fish PPA)
5
-  apt: pkg=python-pycurl
6
-
7
-- name: add fish PPA (Debian)
8
-  apt_repository: repo='ppa:fish-shell/release-2' update_cache=yes
9
-  when: ansible_os_family == 'Debian'
10
-
11
-- name: add fish PPA (Mint)
12
-  apt_repository: repo='deb http://ppa.launchpad.net/fish-shell/release-2/ubuntu raring main' update_cache=yes
13
-  when: ansible_os_family == 'Linuxmint'
14
-
15
-- name: install fish
16
-  apt: pkg=fish
4
+- include: install-from-ppa
5
+  vars:
6
+    ppa: 'ppa:fish-shell/release-2'
7
+    ppa_mint: 'deb http://ppa.launchpad.net/fish-shell/release-2/ubuntu raring main'
8
+    package: 'fish'

+ 16
- 0
playbooks/includes/install-from-ppa View File

@@ -0,0 +1,16 @@
1
+---
2
+# Adds a PPA and installs a package
3
+
4
+- name: install python-pycurl (needed to add {{ package }} PPA)
5
+  apt: pkg=python-pycurl
6
+
7
+- name: add PPA for {{ package }} (Debian)
8
+  apt_repository: repo="{{ ppa }}" update_cache=yes
9
+  when: ansible_os_family == 'Debian'
10
+
11
+- name: add PPA for {{ package }} (Mint)
12
+  apt_repository: repo="{{ ppa_mint }}" update_cache=yes
13
+  when: ansible_os_family == 'Linuxmint'
14
+
15
+- name: install {{ package }}
16
+  apt: pkg={{ package }} force=yes

Loading…
Cancel
Save