From: Ralf Jung Date: Sat, 7 Apr 2018 15:27:45 +0000 (+0200) Subject: work X-Git-Url: https://git.ralfj.de/ansible.git/commitdiff_plain/ac44ccaff48a46b6369da88a55b9bfed07d5f7dd?ds=sidebyside work --- 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" "$@"