Matteo Scandolo | 60b640f | 2017-08-08 13:05:22 -0700 | [diff] [blame] | 1 | |
| 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 Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 17 | - 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 Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 28 | with_items: "{{ hosts }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 29 | tags: [common] |
| 30 | |
Zsolt Haraszti | 06ecaa4 | 2016-05-31 16:46:37 -0700 | [diff] [blame] | 31 | - name: Latest apt packages |
| 32 | apt: |
| 33 | name: "{{ item }}" |
Scott Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 34 | with_items: "{{ use_latest_for }}" |
Zsolt Haraszti | 06ecaa4 | 2016-05-31 16:46:37 -0700 | [diff] [blame] | 35 | tags: [common] |
| 36 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 37 | - name: Services are not running |
| 38 | service: |
| 39 | name: "{{ item }}" |
| 40 | state: stopped |
| 41 | ignore_errors: yes |
Scott Baker | 781d28b | 2016-11-01 11:01:47 -0700 | [diff] [blame] | 42 | with_items: "{{ obsolete_services }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 43 | tags: [common] |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 44 | |
| 45 | - name: Ensure known_hosts file is absent |
| 46 | file: |
Andy Bavier | 99c11d3 | 2016-09-14 17:21:20 -0400 | [diff] [blame] | 47 | path: "/home/vagrant/.ssh/known_hosts" |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 48 | state: absent |
| 49 | |
alshabib | 18704b0 | 2016-09-29 15:58:26 -0700 | [diff] [blame] | 50 | - name: Create .ssh directory |
| 51 | file: path={{ ansible_env['PWD'] }}/.ssh state=directory mode=0755 |
| 52 | |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 53 | - name: Disable Known Host Checking |
| 54 | copy: |
| 55 | src: files/ssh_config |
Andy Bavier | 99c11d3 | 2016-09-14 17:21:20 -0400 | [diff] [blame] | 56 | dest: "/home/vagrant/.ssh/config" |
Andy Bavier | 3833dde | 2016-08-31 16:09:27 -0400 | [diff] [blame] | 57 | owner: "{{ ansible_env['SUDO_USER'] }}" |
| 58 | group: "{{ ansible_env['SUDO_USER'] }}" |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 59 | mode: 0600 |