David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 1 | --- |
| 2 | - name: Applications |
| 3 | become: yes |
| 4 | apt: name={{ item }} state=present |
| 5 | with_items: |
| 6 | - build-essential |
| 7 | |
| 8 | - name: Set Default Password |
| 9 | become: yes |
| 10 | user: |
| 11 | name=ubuntu |
| 12 | password="$6$TjhJuOgh8xp.v$z/4GwFbn5koVmkD6Ex9wY7bgP7L3uP2ujZkZSs1HNdzQdz9YclbnZH9GvqMC/M1iwC0MceL05.13HoFz/bai0/" |
| 13 | |
David K. Bainbridge | 39d0c78 | 2016-05-11 13:27:57 -0700 | [diff] [blame] | 14 | - name: Authorize SSH Key |
| 15 | become: yes |
| 16 | authorized_key: |
| 17 | key="{{ pub_ssh_key }}" |
| 18 | user=ubuntu |
| 19 | state=present |
| 20 | |
| 21 | - name: Verify Private SSH Key |
| 22 | become: yes |
| 23 | stat: |
| 24 | path=/home/ubuntu/.ssh/id_rsa |
| 25 | register: private_key |
| 26 | |
| 27 | - name: Ensure Private SSH Key |
| 28 | become: yes |
| 29 | copy: |
| 30 | src=files/{{ item }} |
| 31 | dest=/home/ubuntu/.ssh/{{ item }} |
| 32 | owner=ubuntu |
| 33 | group=ubuntu |
| 34 | mode=0600 |
| 35 | with_items: |
| 36 | - id_rsa |
| 37 | - id_rsa.pub |
| 38 | |
| 39 | - name: Ensure CORD SUDO |
| 40 | become: yes |
| 41 | copy: |
| 42 | src=files/99-cord-sudoers |
| 43 | dest=/etc/sudoers.d/99-cord-sudoers |
| 44 | owner=root |
| 45 | group=root |
| 46 | mode=0600 |
| 47 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 48 | - name: Verify i40e Driver |
| 49 | command: modinfo --field=version i40e |
| 50 | register: i40e_version |
| 51 | changed_when: False |
David K. Bainbridge | 4ec841c | 2016-05-11 22:10:15 -0700 | [diff] [blame] | 52 | tags: |
| 53 | - interface_config |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 54 | |
| 55 | - name: Update i40e Driver |
| 56 | include: tasks/i40e_driver.yml |
| 57 | when: i40e_version.stdout != '1.4.25' |
David K. Bainbridge | 4ec841c | 2016-05-11 22:10:15 -0700 | [diff] [blame] | 58 | tags: |
| 59 | - interface_config |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 60 | |
| 61 | - name: Consistent Interface Naming |
| 62 | become: yes |
| 63 | script: files/rename_ifaces.sh {{ fabric_ip }} |
| 64 | register: ifaces_changed |
| 65 | changed_when: ifaces_changed.stdout != "false" |
David K. Bainbridge | 4ec841c | 2016-05-11 22:10:15 -0700 | [diff] [blame] | 66 | tags: |
| 67 | - interface_config |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 68 | |
| 69 | - name: Reboot Required |
| 70 | become: yes |
| 71 | command: /sbin/reboot |
| 72 | when: ifaces_changed.stdout != "false" |
David K. Bainbridge | 4ec841c | 2016-05-11 22:10:15 -0700 | [diff] [blame] | 73 | tags: |
| 74 | - interface_config |