add basic packages playbook; work on upgrade playbook; provide script to run it on...
authorRalf Jung <post@ralfj.de>
Thu, 5 Apr 2018 08:10:23 +0000 (10:10 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 8 Apr 2018 08:20:00 +0000 (10:20 +0200)
.gitignore
packages.yml [new file with mode: 0644]
playall [new file with mode: 0755]
upgrade.yml

index ab476012443e79ef3aa8cd439ce730fd763f39f8..c04e2b6b6563a35bb14595c9ec0c2f427ddecf12 100644 (file)
@@ -1,2 +1,2 @@
 *.retry
 *.retry
-
+hosts
diff --git a/packages.yml b/packages.yml
new file mode 100644 (file)
index 0000000..d4b108f
--- /dev/null
@@ -0,0 +1,14 @@
+# basic system package preparation
+- hosts: all
+  tasks:
+  - name: detect if we have backports in the sources.list
+    command: fgrep backports /etc/apt/sources.list
+    ignore_errors: True
+    register: backports
+  - 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
+  - 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
diff --git a/playall b/playall
new file mode 100755 (executable)
index 0000000..b4abf6b
--- /dev/null
+++ b/playall
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+
+for HOST in $(fgrep 'all:' hosts | sed 's/.*all: *//g'); do
+  echo "Playing on $HOST"
+  ansible-playbook --diff -l "$HOST" "$@"
+  echo
+done
index 5da075998e294ad7c9cf4f7f81f40db86019f699..31f6619df20dce2f29ccf122a902a7d92871341b 100644 (file)
@@ -6,3 +6,5 @@
       autoclean: yes
       update_cache: yes
       upgrade: dist
       autoclean: yes
       update_cache: yes
       upgrade: dist
+    environment:
+      NEEDRESTART_MODE: automatically