blob: 9ba77a42c9f78d858c306efa39f0b524e48ec1be [file] [log] [blame]
David K. Bainbridge317e7d72016-05-11 08:31:44 -07001---
2- name: Applications
3 become: yes
David K. Bainbridge73ff2c22016-05-18 17:13:09 -07004 apt: name={{ item }} state=latest force=yes
David K. Bainbridge317e7d72016-05-11 08:31:44 -07005 with_items:
6 - build-essential
David K. Bainbridgee9f284d2016-05-18 14:13:43 -07007 - git
8 - python-pip
9
10- name: Ensure Docker Ansible Support
11 become: yes
12 pip:
13 name=docker-py
14 version=0.3.1
David K. Bainbridge317e7d72016-05-11 08:31:44 -070015
16- name: Set Default Password
17 become: yes
18 user:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070019 name={{ ansible_user }}
David K. Bainbridge317e7d72016-05-11 08:31:44 -070020 password="$6$TjhJuOgh8xp.v$z/4GwFbn5koVmkD6Ex9wY7bgP7L3uP2ujZkZSs1HNdzQdz9YclbnZH9GvqMC/M1iwC0MceL05.13HoFz/bai0/"
David K. Bainbridge2a804222016-05-16 12:36:32 -070021 when: '"{{ ansible_user }}" == "ubuntu"'
David K. Bainbridge317e7d72016-05-11 08:31:44 -070022
David K. Bainbridge39d0c782016-05-11 13:27:57 -070023- name: Authorize SSH Key
24 become: yes
25 authorized_key:
26 key="{{ pub_ssh_key }}"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070027 user={{ ansible_user }}
David K. Bainbridge39d0c782016-05-11 13:27:57 -070028 state=present
29
30- name: Verify Private SSH Key
31 become: yes
32 stat:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070033 path=/home/{{ ansible_user }}/.ssh/id_rsa
David K. Bainbridge39d0c782016-05-11 13:27:57 -070034 register: private_key
35
David K. Bainbridgeb5415042016-05-13 17:06:10 -070036- name: Ensure SSH Key
David K. Bainbridge39d0c782016-05-11 13:27:57 -070037 become: yes
38 copy:
39 src=files/{{ item }}
David K. Bainbridgeb5415042016-05-13 17:06:10 -070040 dest=/home/{{ ansible_user }}/.ssh/{{ item }}
41 owner={{ ansible_user }}
42 group={{ ansible_user }}
David K. Bainbridge39d0c782016-05-11 13:27:57 -070043 mode=0600
44 with_items:
45 - id_rsa
46 - id_rsa.pub
47
48- name: Ensure CORD SUDO
49 become: yes
50 copy:
51 src=files/99-cord-sudoers
52 dest=/etc/sudoers.d/99-cord-sudoers
53 owner=root
54 group=root
55 mode=0600
56
David K. Bainbridge317e7d72016-05-11 08:31:44 -070057- name: Verify i40e Driver
58 command: modinfo --field=version i40e
59 register: i40e_version
60 changed_when: False
David K. Bainbridgeb5415042016-05-13 17:06:10 -070061 failed_when: False
David K. Bainbridge4ec841c2016-05-11 22:10:15 -070062 tags:
63 - interface_config
David K. Bainbridge317e7d72016-05-11 08:31:44 -070064
65- name: Update i40e Driver
66 include: tasks/i40e_driver.yml
67 when: i40e_version.stdout != '1.4.25'
David K. Bainbridge4ec841c2016-05-11 22:10:15 -070068 tags:
69 - interface_config
David K. Bainbridge317e7d72016-05-11 08:31:44 -070070
71- name: Consistent Interface Naming
72 become: yes
73 script: files/rename_ifaces.sh {{ fabric_ip }}
74 register: ifaces_changed
75 changed_when: ifaces_changed.stdout != "false"
David K. Bainbridge4ec841c2016-05-11 22:10:15 -070076 tags:
77 - interface_config
David K. Bainbridge317e7d72016-05-11 08:31:44 -070078
79- name: Reboot Required
80 become: yes
81 command: /sbin/reboot
David K. Bainbridgee9f284d2016-05-18 14:13:43 -070082 async: 1
David K. Bainbridgeb5e232a2016-05-17 13:55:24 -070083 poll: 0
84 ignore_errors: true
David K. Bainbridge317e7d72016-05-11 08:31:44 -070085 when: ifaces_changed.stdout != "false"
David K. Bainbridge4ec841c2016-05-11 22:10:15 -070086 tags:
87 - interface_config
David K. Bainbridgeb5e232a2016-05-17 13:55:24 -070088
89- name: Wait For Restart
David K. Bainbridgee9f284d2016-05-18 14:13:43 -070090 local_action: wait_for host={{ ansible_host }} state=started port=22 delay=30 search_regex=OpenSSH timeout=600