From ac44ccaff48a46b6369da88a55b9bfed07d5f7dd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 7 Apr 2018 17:27:45 +0200 Subject: [PATCH 1/1] work --- .gitignore | 1 + packages.yml => base.yml | 14 ++++++++++---- play | 8 ++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) rename packages.yml => base.yml (60%) create mode 100755 play diff --git a/.gitignore b/.gitignore index c04e2b6..b4b9e93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.retry +host_vars hosts diff --git a/packages.yml b/base.yml similarity index 60% rename from packages.yml rename to base.yml index d4b108f..7f03b5b 100644 --- a/packages.yml +++ 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 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" "$@" -- 2.30.2