work
authorRalf Jung <post@ralfj.de>
Sat, 7 Apr 2018 15:27:45 +0000 (17:27 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 8 Apr 2018 08:20:24 +0000 (10:20 +0200)
.gitignore
base.yml [moved from packages.yml with 60% similarity]
play [new file with mode: 0755]

index c04e2b6b6563a35bb14595c9ec0c2f427ddecf12..b4b9e9344c7bcb97ac65181c07c73474dca21bc8 100644 (file)
@@ -1,2 +1,3 @@
 *.retry
+host_vars
 hosts
similarity index 60%
rename from packages.yml
rename to base.yml
index d4b108f047b46b2f2c407790c2130eb3a0707558..7f03b5b040f519b809d2c86517078097108b340f 100644 (file)
+++ b/base.yml
@@ -1,14 +1,20 @@
-# basic system package preparation
+# basic system preparation
 - hosts: all
   tasks:
+  # packages
   - name: detect if we have backports in the sources.list
     command: fgrep backports /etc/apt/sources.list
-    ignore_errors: True
     register: backports
+    failed_when: backports.rc == 2
   - name: add backports repository
     apt_repository: repo='deb http://httpredir.debian.org/debian {{ansible_distribution_release}}-backports main contrib non-free' state=present update_cache=yes
-    when: backports is failed
+    when: backports.rc != 0
   - name: get rid of packages we do not want
     apt: name=exim4-base,rpcbind state=absent autoremove=yes
   - name: install latest version of some packages, coming from backports if possible
-    apt: name=needrestart state=latest default_release={{ansible_distribution_release}}-backports
+    apt: name=needrestart,git state=latest default_release={{ansible_distribution_release}}-backports
+  # server-scripts
+  - name: clone server-scripts git repository
+    git:
+      repo: 'git://ralfj.de/server-scripts'
+      dest: /root/server-scripts
diff --git a/play b/play
new file mode 100755 (executable)
index 0000000..a24d672
--- /dev/null
+++ b/play
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+
+HOST="$1"
+shift
+
+echo "Playing on $HOST"
+ansible-playbook --diff -l "$HOST" "$@"