Python3: PIP requirement
[csit.git] / resources / tools / testbed-setup / ansible / roles / common / tasks / main.yaml
1 ---
2 # file: roles/common/tasks/main.yaml
3
4 - name: Ensure the system exists in Cobbler
5   cobbler_system:
6     host: '{{ cobbler_hostname }}'
7     port: 60080
8     interfaces:
9       br1:
10         ipaddress: '{{ ansible_default_ipv4.address }}'
11         macaddress: '{{ ansible_default_ipv4.macaddress }}'
12     name: '{{ hostname }}'
13     password: '{{ cobbler_password }}'
14     properties:
15       hostname: '{{ hostname }}'
16       gateway: '{{ ansible_default_ipv4.gateway }}'
17       profile: '{{ cobbler_profile }}'
18       name_servers: '{{ name_servers }}'
19       name_servers_search: '{{ name_servers_search }}'
20       kickstart: '/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed'
21       kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
22       netboot_enabled: yes
23     username: '{{ cobbler_username }}'
24     use_ssl: no
25     validate_certs: no
26   when: provision_enabled
27   delegate_to: localhost
28   tags: cobbler-include
29
30 - name: Commit Cobbler changes
31   cobbler_sync:
32     host: '{{ cobbler_hostname }}'
33     port: 60080
34     password: '{{ cobbler_password }}'
35     username: '{{ cobbler_username }}'
36     use_ssl: no
37     validate_certs: no
38   run_once: yes
39   when: provision_enabled
40   delegate_to: localhost
41   register: __included_in_cobbler
42   notify:
43     - 'Boot from network'
44     - 'Reboot server'
45   tags: cobbler-include
46
47 - meta: flush_handlers
48
49 - name: Copy netplan network config file
50   template:
51     src: 'files/netplan_config'
52     dest: '/etc/netplan/01-netcfg.yaml'
53     owner: 'root'
54     group: 'root'
55     mode: '0644'
56   tags: copy-interface-file
57
58 - name: Add permanent proxy settings
59   lineinfile:
60     path: '/etc/environment'
61     state: 'present'
62     line: '{{ item.key }}={{ item.value }}'
63   with_dict: '{{ proxy_env }}'
64   when: proxy_env is defined
65
66 - name: Install distribution - release - machine prerequisites
67   include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
68   tags: [ install-csit-dependencies, copy-apt-sources ]
69
70 - name: Install CSIT PIP requirements
71   pip:
72     name:
73       - 'ecdsa==0.13.3'
74       - 'paramiko==2.6.0'
75       - 'pycrypto==2.6.1'
76       - 'pypcap==1.2.3'
77       - 'PyYAML==5.1.1'
78       - 'requests==2.22.0'
79       - 'robotframework==3.1.2'
80       - 'scapy==2.4.3'
81       - 'scp==0.13.2'
82       - 'ansible==2.7.8'
83       - 'dill==0.2.8.2'
84       - 'numpy==1.17.3'
85       - 'hdrhistogram==0.6.1'
86       - 'pandas==0.25.3'
87       - 'plotly==4.1.1'
88       - 'PTable==0.9.2'
89       - 'Sphinx==2.2.1'
90       - 'sphinx-rtd-theme==0.4.0'
91       - 'sphinxcontrib-programoutput==0.15'
92       - 'sphinxcontrib-robotdoc==0.11.0'
93       - 'alabaster==0.7.12'
94       - 'Babel==2.7.0'
95       - 'bcrypt==3.1.7'
96       - 'certifi==2019.9.11'
97       - 'cffi==1.13.2'
98       - 'chardet==3.0.4'
99       - 'cryptography==2.8'
100       - 'docutils==0.15.2'
101       - 'future==0.18.2'
102       - 'idna==2.8'
103       - 'imagesize==1.1.0'
104       - 'Jinja2==2.10.3'
105       - 'MarkupSafe==1.1.1'
106       - 'packaging==19.2'
107       - 'pbr==5.4.3'
108       - 'pycparser==2.19'
109       - 'Pygments==2.4.2'
110       - 'PyNaCl==1.3.0'
111       - 'pyparsing==2.4.4'
112       - 'python-dateutil==2.8.1'
113       - 'pytz==2019.3'
114       - 'retrying==1.3.3'
115       - 'six==1.13.0'
116       - 'snowballstemmer==2.0.0'
117       - 'sphinxcontrib-applehelp==1.0.1'
118       - 'sphinxcontrib-devhelp==1.0.1'
119       - 'sphinxcontrib-htmlhelp==1.0.2'
120       - 'sphinxcontrib-jsmath==1.0.1'
121       - 'sphinxcontrib-qthelp==1.0.2'
122       - 'sphinxcontrib-serializinghtml==1.1.3'
123       - 'urllib3==1.25.6'
124   tags: install-pip
125
126 - name: Install CSIT PIP requirements - SciPy workaround
127   pip:
128     name:
129       - 'scipy==1.1.0'
130   tags: install-pip
131
132 - name: Set sudoers admin
133   lineinfile:
134     path: '/etc/sudoers'
135     state: 'present'
136     regexp: '^%admin ALL='
137     line: '%admin ALL=(ALL) ALL'
138     validate: '/usr/sbin/visudo -cf %s'
139   tags: set-sudoers
140
141 - name: Set sudoers sudo
142   lineinfile:
143     path: '/etc/sudoers'
144     state: 'present'
145     regexp: '^%sudo'
146     line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
147     validate: '/usr/sbin/visudo -cf %s'
148   tags: set-sudoers
149
150 - name: Copy grub file
151   template:
152    src: 'files/grub_{{ ansible_machine }}'
153    dest: '/etc/default/grub'
154    owner: 'root'
155    group: 'root'
156    mode: '644'
157   notify:
158     - 'Update GRUB'
159     - 'Reboot server'
160   tags: copy-grub
161
162 - name: Mellanox Install - Driver
163   import_tasks: mellanox.yaml
164   tags: mellanox-install
165
166 - meta: flush_handlers