Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [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 }}" |
| 12 | with_items: "{{ hosts }}" |
| 13 | tags: [common] |
| 14 | |
| 15 | - name: Latest apt packages |
| 16 | apt: |
| 17 | name: "{{ item }}" |
| 18 | with_items: "{{ use_latest_for }}" |
| 19 | when: target != "cluster" |
| 20 | tags: [common] |
| 21 | |
| 22 | - name: Services are not running |
| 23 | service: |
| 24 | name: "{{ item }}" |
| 25 | state: stopped |
| 26 | ignore_errors: yes |
| 27 | with_items: "{{ obsolete_services }}" |
| 28 | tags: [common] |
| 29 | |
| 30 | - name: Ensure there is a .ssh directory for /root |
| 31 | file: |
| 32 | path: "{{ ansible_env['HOME'] }}/.ssh" |
| 33 | state: directory |
| 34 | owner: root |
| 35 | group: root |
| 36 | |
| 37 | - name: Ensure known_hosts file is absent |
| 38 | file: |
| 39 | path: "{{ ansible_env['HOME'] }}/.ssh/known_hosts" |
| 40 | state: absent |
| 41 | |
| 42 | - name: Disable Known Host Checking |
| 43 | copy: |
| 44 | src: files/ssh_config |
| 45 | dest: "{{ ansible_env['HOME'] }}/.ssh/config" |
| 46 | owner: root |
| 47 | group: root |
| 48 | mode: 0600 |