Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -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 }}" |
Rouzbahan Rashidi-Tabrizi | 0f7eb2b | 2016-11-08 12:30:12 -0800 | [diff] [blame] | 12 | with_items: "{{ hosts }}" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 13 | tags: [common] |
| 14 | |
| 15 | - name: Latest apt packages |
| 16 | apt: |
| 17 | name: "{{ item }}" |
Rouzbahan Rashidi-Tabrizi | 0f7eb2b | 2016-11-08 12:30:12 -0800 | [diff] [blame] | 18 | with_items: "{{ use_latest_for }}" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 19 | tags: [common] |
| 20 | |
| 21 | - name: Services are not running |
| 22 | service: |
| 23 | name: "{{ item }}" |
| 24 | state: stopped |
| 25 | ignore_errors: yes |
Rouzbahan Rashidi-Tabrizi | 0f7eb2b | 2016-11-08 12:30:12 -0800 | [diff] [blame] | 26 | with_items: "{{ obsolete_services }}" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 27 | tags: [common] |
| 28 | |
David K. Bainbridge | a2a46ae | 2017-10-24 14:05:33 -0700 | [diff] [blame] | 29 | - name: Ensure SSH directory exists |
| 30 | file: |
| 31 | path: "{{ ansible_env['HOME'] }}/.ssh" |
| 32 | state: directory |
| 33 | owner: "{{ ansible_env['SUDO_USER'] }}" |
| 34 | group: "{{ ansible_env['SUDO_USER'] }}" |
| 35 | mode: 0700 |
| 36 | |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 37 | - name: Ensure known_hosts file is absent |
| 38 | file: |
Zsolt Haraszti | 1504408 | 2016-10-05 00:18:57 -0700 | [diff] [blame] | 39 | path: "{{ ansible_env['HOME'] }}/.ssh/known_hosts" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 40 | state: absent |
| 41 | |
| 42 | - name: Disable Known Host Checking |
| 43 | copy: |
| 44 | src: files/ssh_config |
Zsolt Haraszti | 1504408 | 2016-10-05 00:18:57 -0700 | [diff] [blame] | 45 | dest: "{{ ansible_env['HOME'] }}/.ssh/config" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 46 | owner: "{{ ansible_env['SUDO_USER'] }}" |
| 47 | group: "{{ ansible_env['SUDO_USER'] }}" |
| 48 | mode: 0600 |