Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 14 | - name: JQ is present |
| 15 | apt: |
| 16 | name: jq |
| 17 | force: yes |
Sergio Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 18 | when: target != "cluster" |
Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 19 | tags: [common] |
| 20 | |
| 21 | - name: Host is present |
| 22 | lineinfile: |
| 23 | dest: /etc/hosts |
| 24 | regexp: "^{{ item.host_ip }}" |
| 25 | line: "{{ item.host_ip }} {{ item.host_name }}" |
| 26 | with_items: "{{ hosts }}" |
| 27 | tags: [common] |
| 28 | |
Stephane Barbarie | 2cbffca | 2018-03-26 16:20:03 -0400 | [diff] [blame] | 29 | - name: GlusterFS repository is available |
| 30 | apt_repository: |
| 31 | repo: 'ppa:gluster/glusterfs-3.13' |
| 32 | when: target != "cluster" |
| 33 | tags: [common] |
| 34 | |
Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 35 | - name: Latest apt packages |
| 36 | apt: |
| 37 | name: "{{ item }}" |
| 38 | with_items: "{{ use_latest_for }}" |
| 39 | when: target != "cluster" |
| 40 | tags: [common] |
| 41 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 42 | #- name: Services are not running |
| 43 | # service: |
| 44 | # name: "{{ item }}" |
| 45 | # state: stopped |
| 46 | # ignore_errors: yes |
| 47 | # with_items: "{{ obsolete_services }}" |
| 48 | # tags: [common] |
Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 49 | |
| 50 | - name: Ensure there is a .ssh directory for /root |
| 51 | file: |
| 52 | path: "{{ ansible_env['HOME'] }}/.ssh" |
| 53 | state: directory |
| 54 | owner: root |
| 55 | group: root |
| 56 | |
| 57 | - name: Ensure known_hosts file is absent |
| 58 | file: |
| 59 | path: "{{ ansible_env['HOME'] }}/.ssh/known_hosts" |
| 60 | state: absent |
| 61 | |
| 62 | - name: Disable Known Host Checking |
| 63 | copy: |
| 64 | src: files/ssh_config |
| 65 | dest: "{{ ansible_env['HOME'] }}/.ssh/config" |
| 66 | owner: root |
| 67 | group: root |
| 68 | mode: 0600 |