Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 1 | - name: JQ is present |
| 2 | apt: |
| 3 | name: jq |
| 4 | force: yes |
| 5 | tags: [common] |
| 6 | |
| 7 | - name: Host is present |
| 8 | lineinfile: |
| 9 | dest: /etc/hosts |
| 10 | regexp: "^{{ item.host_ip }}" |
| 11 | line: "{{ item.host_ip }} {{ item.host_name }}" |
Scott Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 12 | with_items: "{{ hosts }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 13 | tags: [common] |
| 14 | |
Zsolt Haraszti | 06ecaa4 | 2016-05-31 16:46:37 -0700 | [diff] [blame] | 15 | - name: Latest apt packages |
| 16 | apt: |
| 17 | name: "{{ item }}" |
Scott Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 18 | with_items: "{{ use_latest_for }}" |
Zsolt Haraszti | 06ecaa4 | 2016-05-31 16:46:37 -0700 | [diff] [blame] | 19 | tags: [common] |
| 20 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 21 | - name: Services are not running |
| 22 | service: |
| 23 | name: "{{ item }}" |
| 24 | state: stopped |
| 25 | ignore_errors: yes |
Scott Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 26 | with_items: "{{ obsolete_services }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 27 | tags: [common] |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 28 | |
| 29 | - name: Ensure known_hosts file is absent |
| 30 | file: |
Andy Bavier | 99c11d3 | 2016-09-14 17:21:20 -0400 | [diff] [blame] | 31 | path: "/home/vagrant/.ssh/known_hosts" |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 32 | state: absent |
| 33 | |
alshabib | 18704b0 | 2016-09-29 15:58:26 -0700 | [diff] [blame] | 34 | - name: Create .ssh directory |
| 35 | file: path={{ ansible_env['PWD'] }}/.ssh state=directory mode=0755 |
| 36 | |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 37 | - name: Disable Known Host Checking |
| 38 | copy: |
| 39 | src: files/ssh_config |
Andy Bavier | 99c11d3 | 2016-09-14 17:21:20 -0400 | [diff] [blame] | 40 | dest: "/home/vagrant/.ssh/config" |
Andy Bavier | 3833dde | 2016-08-31 16:09:27 -0400 | [diff] [blame] | 41 | owner: "{{ ansible_env['SUDO_USER'] }}" |
| 42 | group: "{{ ansible_env['SUDO_USER'] }}" |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 43 | mode: 0600 |