blob: 3e7e5a00fa0e31b6910576de45d148eaa4cf3631 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
---
# file: roles/common/tasks/main.yaml
- name: Ensure the system exists in Cobbler
cobbler_system:
host: '{{ cobbler_hostname }}'
port: 60080
interfaces:
br1:
ipaddress: '{{ ansible_default_ipv4.address }}'
macaddress: '{{ ansible_default_ipv4.macaddress }}'
name: '{{ hostname }}'
password: '{{ cobbler_password }}'
properties:
hostname: '{{ hostname }}'
gateway: '{{ ansible_default_ipv4.gateway }}'
profile: '{{ cobbler_profile }}'
name_servers: '{{ name_servers }}'
name_servers_search: '{{ name_servers_search }}'
kickstart: '/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed'
kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
netboot_enabled: yes
username: '{{ cobbler_username }}'
use_ssl: no
validate_certs: no
when: provision_enabled
delegate_to: localhost
tags: cobbler-include
- name: Commit Cobbler changes
cobbler_sync:
host: '{{ cobbler_hostname }}'
port: 60080
password: '{{ cobbler_password }}'
username: '{{ cobbler_username }}'
use_ssl: no
validate_certs: no
run_once: yes
when: provision_enabled
delegate_to: localhost
register: __included_in_cobbler
notify:
- 'Boot from network'
- 'Reboot server'
tags: cobbler-include
- meta: flush_handlers
- name: Copy netplan network config file
template:
src: 'files/netplan_config'
dest: '/etc/netplan/01-netcfg.yaml'
owner: 'root'
group: 'root'
mode: '0644'
tags: copy-interface-file
- name: Add permanent proxy settings
lineinfile:
path: '/etc/environment'
state: 'present'
line: '{{ item.key }}={{ item.value }}'
with_dict: '{{ proxy_env }}'
when: proxy_env is defined
- name: Install distribution - release - machine prerequisites
include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
tags: [ install-csit-dependencies, copy-apt-sources ]
- name: Install CSIT PIP requirements
pip:
name:
- 'docopt==0.6.2'
- 'ecdsa==0.13'
- 'enum34==1.1.2'
- 'ipaddress==1.0.16'
- 'paramiko==1.16.0'
- 'pexpect==4.6.0'
- 'pycrypto==2.6.1'
- 'pykwalify==1.5.0'
- 'pypcap==1.1.5'
- 'python-dateutil==2.4.2'
- 'PyYAML==3.11'
- 'requests==2.9.1'
- 'robotframework==2.9.2'
- 'scapy==2.3.1'
- 'scp==0.10.2'
- 'six==1.12.0'
- 'dill==0.2.8.2'
- 'numpy==1.14.5'
- 'aenum==2.1.2'
tags: install-pip
- name: Install CSIT PIP requirements - SciPy workaround
pip:
name:
- 'scipy==1.1.0'
tags: install-pip
- name: Set sudoers admin
lineinfile:
path: '/etc/sudoers'
state: 'present'
regexp: '^%admin ALL='
line: '%admin ALL=(ALL) ALL'
validate: '/usr/sbin/visudo -cf %s'
tags: set-sudoers
- name: Set sudoers sudo
lineinfile:
path: '/etc/sudoers'
state: 'present'
regexp: '^%sudo'
line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
validate: '/usr/sbin/visudo -cf %s'
tags: set-sudoers
- name: Copy grub file
template:
src: 'files/grub_{{ ansible_machine }}'
dest: '/etc/default/grub'
owner: 'root'
group: 'root'
mode: '644'
notify:
- 'Update GRUB'
- 'Reboot server'
tags: copy-grub
- name: Mellanox Install - Driver
import_tasks: mellanox.yaml
tags: mellanox-install
- meta: flush_handlers
|