5f264c6a6c4c1a1a0e56688fec7e4daf1f6767ce
[ansible.git] / roles / base / tasks / main.yml
1 # packages
2 - name: check minimal system version
3   when: not (ansible_distribution == "Debian" and ansible_lsb.major_release|int >= 9)
4   command: "false"
5 - name: detect if we have backports in the sources.list
6   command: fgrep backports /etc/apt/sources.list
7   register: backports
8   failed_when: backports.rc == 2
9   changed_when: False
10 - name: add backports repository
11   when: backports.rc != 0
12   apt_repository: repo='deb http://httpredir.debian.org/debian {{ansible_distribution_release}}-backports main contrib non-free' state=present update_cache=yes
13 - name: get rid of packages we do not want
14   apt: name=exim4-base,rpcbind state=absent autoremove=yes
15 - name: install needrestart (from backports)
16   apt: name=needrestart state=latest default_release={{ansible_distribution_release}}-backports
17 - name: install some basic tools
18   apt: name=aptitude,rsync,git,mercurial,curl,apt-transport-https,psmisc,dnsutils,tree,htop state=latest
19 # server-scripts
20 - name: clone server-scripts git repository
21   git:
22     dest: /root/server-scripts
23     repo: 'https://git.ralfj.de/server-scripts.git'
24     version: 07d301fd8adeaf8ad40591a418da394ad37816ce
25 # configuration
26 - name: configure root shell
27   copy:
28     dest: /root/{{ item }}
29     remote_src: True
30     src: /etc/skel/{{ item }}
31   loop:
32   - .profile
33   - .bashrc
34   - .bash_logout
35 - name: configure systemd-timesyncd
36   copy:
37     dest: /etc/systemd/timesyncd.conf
38     src: files/timesyncd.conf
39   notify: timesyncd