blob: b17790ab482380e1930fa3af3325dd78a79229bd [file] [log] [blame]
Matteo Scandolo60b640f2017-08-08 13:05:22 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Zsolt Harasztiec7df102016-05-05 13:34:18 -070017- name: JQ is present
18 apt:
19 name: jq
20 force: yes
21 tags: [common]
22
23- name: Host is present
24 lineinfile:
25 dest: /etc/hosts
26 regexp: "^{{ item.host_ip }}"
27 line: "{{ item.host_ip }} {{ item.host_name }}"
Scott Baker781d28b2016-11-01 11:01:47 -070028 with_items: "{{ hosts }}"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070029 tags: [common]
30
Zsolt Haraszti06ecaa42016-05-31 16:46:37 -070031- name: Latest apt packages
32 apt:
33 name: "{{ item }}"
Scott Baker781d28b2016-11-01 11:01:47 -070034 with_items: "{{ use_latest_for }}"
Zsolt Haraszti06ecaa42016-05-31 16:46:37 -070035 tags: [common]
36
Zsolt Harasztiec7df102016-05-05 13:34:18 -070037- name: Services are not running
38 service:
39 name: "{{ item }}"
40 state: stopped
41 ignore_errors: yes
Scott Baker781d28b2016-11-01 11:01:47 -070042 with_items: "{{ obsolete_services }}"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070043 tags: [common]
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070044
45- name: Ensure known_hosts file is absent
46 file:
Andy Bavier99c11d32016-09-14 17:21:20 -040047 path: "/home/vagrant/.ssh/known_hosts"
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070048 state: absent
49
alshabib18704b02016-09-29 15:58:26 -070050- name: Create .ssh directory
51 file: path={{ ansible_env['PWD'] }}/.ssh state=directory mode=0755
52
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070053- name: Disable Known Host Checking
54 copy:
55 src: files/ssh_config
Andy Bavier99c11d32016-09-14 17:21:20 -040056 dest: "/home/vagrant/.ssh/config"
Andy Bavier3833dde2016-08-31 16:09:27 -040057 owner: "{{ ansible_env['SUDO_USER'] }}"
58 group: "{{ ansible_env['SUDO_USER'] }}"
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070059 mode: 0600