blob: 6d4cab159ee64099a99faf6ea45bedc8dd75c24f [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# 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.
Zsolt Haraszti3d163532016-09-08 15:57:32 -070014- name: JQ is present
15 apt:
16 name: jq
17 force: yes
18 tags: [common]
19
20- name: Host is present
21 lineinfile:
22 dest: /etc/hosts
23 regexp: "^{{ item.host_ip }}"
24 line: "{{ item.host_ip }} {{ item.host_name }}"
Rouzbahan Rashidi-Tabrizi0f7eb2b2016-11-08 12:30:12 -080025 with_items: "{{ hosts }}"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070026 tags: [common]
27
28- name: Latest apt packages
29 apt:
30 name: "{{ item }}"
Rouzbahan Rashidi-Tabrizi0f7eb2b2016-11-08 12:30:12 -080031 with_items: "{{ use_latest_for }}"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070032 tags: [common]
33
34- name: Services are not running
35 service:
36 name: "{{ item }}"
37 state: stopped
38 ignore_errors: yes
Rouzbahan Rashidi-Tabrizi0f7eb2b2016-11-08 12:30:12 -080039 with_items: "{{ obsolete_services }}"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070040 tags: [common]
41
David K. Bainbridgea2a46ae2017-10-24 14:05:33 -070042- name: Ensure SSH directory exists
43 file:
44 path: "{{ ansible_env['HOME'] }}/.ssh"
45 state: directory
46 owner: "{{ ansible_env['SUDO_USER'] }}"
47 group: "{{ ansible_env['SUDO_USER'] }}"
48 mode: 0700
49
Zsolt Haraszti3d163532016-09-08 15:57:32 -070050- name: Ensure known_hosts file is absent
51 file:
Zsolt Haraszti15044082016-10-05 00:18:57 -070052 path: "{{ ansible_env['HOME'] }}/.ssh/known_hosts"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070053 state: absent
54
55- name: Disable Known Host Checking
56 copy:
57 src: files/ssh_config
Zsolt Haraszti15044082016-10-05 00:18:57 -070058 dest: "{{ ansible_env['HOME'] }}/.ssh/config"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070059 owner: "{{ ansible_env['SUDO_USER'] }}"
60 group: "{{ ansible_env['SUDO_USER'] }}"
61 mode: 0600