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 | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 17 | - name: Ensure Root User |
| 18 | become: yes |
| 19 | user: |
| 20 | name: root |
| 21 | password: '$6$o5YKQzd9CIadXU$KPaV6CcDd1XPr4cO.dRnWnMnrZl9mBEM84Pfhp9b1v6fLWHdoQ1gPJ4qa0lGvxpukcWtWtwiZezi3JWisMd4D.' |
| 22 | |
| 23 | - name: Ensure Directories |
| 24 | become: yes |
| 25 | file: |
| 26 | path: "{{ item }}" |
| 27 | owner: root |
| 28 | group: root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 29 | mode: "0755" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 30 | state: directory |
| 31 | with_items: |
| 32 | - /mnt/flash2 |
| 33 | - /etc/accton |
| 34 | |
| 35 | - name: Ensure Commands |
| 36 | become: yes |
| 37 | template: |
| 38 | src: files/{{ item }} |
| 39 | dest: /usr/bin/{{ item }} |
| 40 | owner: root |
| 41 | group: root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 42 | mode: "0755" |
David K. Bainbridge | 59bdb54 | 2016-07-01 11:07:45 -0700 | [diff] [blame] | 43 | with_items: |
| 44 | - persist |
| 45 | - savepersist |
| 46 | |
| 47 | - name: Ensure Root SSH |
| 48 | become: yes |
| 49 | lineinfile: |
| 50 | dest: "/etc/ssh/sshd_config" |
| 51 | regexp: "^PermitRootLogin" |
| 52 | line: "PermitRootLogin yes" |
| 53 | |
| 54 | - name: Ensure SSH Config |
| 55 | become: yes |
| 56 | service: |
| 57 | name: ssh |
| 58 | state: restarted |
| 59 | #failed_when: false |