blob: 8048e082103602ea0fd0fd15b9fca565ba8d351b [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -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
David K. Bainbridgeb5415042016-05-13 17:06:10 -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 }}"
David K. Bainbridge17248c02016-08-29 17:04:34 -070028 with_items: "{{ hosts }}"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070029 tags: [common]
30
David K. Bainbridge59bdb542016-07-01 11:07:45 -070031- name: Latest apt packages
32 apt:
33 name: "{{ item }}"
David K. Bainbridge17248c02016-08-29 17:04:34 -070034 with_items: "{{ use_latest_for }}"
David K. Bainbridge59bdb542016-07-01 11:07:45 -070035 tags: [common]
36
David K. Bainbridgeb5415042016-05-13 17:06:10 -070037- name: Services are not running
38 service:
39 name: "{{ item }}"
40 state: stopped
41 ignore_errors: yes
David K. Bainbridge17248c02016-08-29 17:04:34 -070042 with_items: "{{ obsolete_services }}"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070043 tags: [common]
David K. Bainbridge59bdb542016-07-01 11:07:45 -070044
45- name: Ensure SSH Directory
46 file:
47 path: /home/{{ ansible_user }}/.ssh
48 state: directory
49 owner: "{{ ansible_user }}"
50 group: "{{ ansible_user }}"
David K. Bainbridge8b179042016-11-30 15:38:42 -080051 mode: "0700"
David K. Bainbridge59bdb542016-07-01 11:07:45 -070052 tags: [common]
53
54- name: Ensure known_hosts file is absent
55 file:
56 path: /home/vagrant/.ssh/known_hosts
57 state: absent
58 tags: [common]
59
60- name: Ignore Known Hosts for SSH
61 copy:
62 src: files/ssh-config
63 dest: /home/{{ ansible_user }}/.ssh/config
64 owner: "{{ ansible_user }}"
65 group: "{{ ansible_user }}"
David K. Bainbridge8b179042016-11-30 15:38:42 -080066 mode: "0600"
David K. Bainbridge59bdb542016-07-01 11:07:45 -070067 tags: [common]
68