Jonathan Hart | 93956f5 | 2017-08-22 13:12:42 -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 | |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -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 }}" |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 28 | with_items: "{{ hosts }}" |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 29 | tags: [common] |
| 30 | |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 31 | - name: Latest apt packages |
| 32 | apt: |
| 33 | name: "{{ item }}" |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 34 | with_items: "{{ use_latest_for }}" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 35 | tags: [common] |
| 36 | |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 37 | - name: Services are not running |
| 38 | service: |
| 39 | name: "{{ item }}" |
| 40 | state: stopped |
| 41 | ignore_errors: yes |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 42 | with_items: "{{ obsolete_services }}" |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 43 | tags: [common] |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 44 | |
| 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 51 | mode: "0700" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 52 | 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 66 | mode: "0600" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 67 | tags: [common] |
| 68 | |