Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 1 | --- |
| 2 | # file: roles/common-prep/tasks/main.yml |
| 3 | |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 4 | - name: Upgrade system to current using apt |
| 5 | when: run_dist_upgrade |
| 6 | apt: |
| 7 | upgrade: dist |
| 8 | update_cache: yes |
| 9 | cache_valid_time: 3600 |
| 10 | |
| 11 | - name: Determine if a reboot if required |
| 12 | when: run_dist_upgrade |
| 13 | stat: path=/var/run/reboot-required |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 14 | register: reboot-required |
| 15 | |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 16 | - name: Perform a reboot if required |
| 17 | when: run_dist_upgrade and reboot-required.exists is defined |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 18 | debug: msg="System will reboot" |
Zack Williams | a9421e2 | 2016-03-02 13:53:37 -0700 | [diff] [blame] | 19 | notify: |
Zack Williams | 6c3b873 | 2016-03-15 09:57:07 -0700 | [diff] [blame] | 20 | - restart host |
| 21 | - wait for host |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 22 | |
| 23 | - name: Install standard packages |
Zack Williams | 7ec058b | 2016-05-02 10:10:39 -0700 | [diff] [blame] | 24 | apt: |
| 25 | pkg={{ item }} |
| 26 | state=present |
| 27 | update_cache=yes |
| 28 | cache_valid_time=3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 29 | with_items: |
| 30 | - tmux |
| 31 | - vim |
| 32 | |
Zack Williams | 1d8a682 | 2016-06-08 08:33:43 -0700 | [diff] [blame] | 33 | - name: Remove annoying default editors |
| 34 | apt: |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 35 | pkg: "{{ item }}" |
| 36 | state: absent |
| 37 | update_cache: yes |
| 38 | cache_valid_time: 3600 |
Zack Williams | 1d8a682 | 2016-06-08 08:33:43 -0700 | [diff] [blame] | 39 | with_items: |
| 40 | - nano |
| 41 | - jove |
| 42 | |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 43 | - name: Enable vim syntax highlighting |
| 44 | lineinfile: dest=/etc/vim/vimrc |
| 45 | regexp="^\s*syntax on" |
| 46 | line="syntax on" |
Zack Williams | a9421e2 | 2016-03-02 13:53:37 -0700 | [diff] [blame] | 47 | |
Zack Williams | f5d8caf | 2016-06-03 13:11:09 -0700 | [diff] [blame] | 48 | - name: Configure tmux |
| 49 | copy: |
| 50 | src=tmux.conf |
| 51 | dest="{{ ansible_user_dir }}/.tmux.conf" |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 52 | |