5c3ba8280a6aa418f0fb26fd9c1c18615cad0a3c
[csit.git] / resources / tools / testbed-setup / ansible / roles / common / tasks / main.yaml
1 ---
2 # file: roles/common/tasks/main.yaml
3
4 - name: Add permanent proxy settings
5   lineinfile:
6     path: "/etc/environment"
7     state: "present"
8     line: "{{ item.key }}={{ item.value }}"
9   with_dict: "{{ proxy_env }}"
10   when: proxy_env is defined
11   tags:
12     - set-proxy
13
14 - name: Inst - Update package cache (apt)
15   apt:
16     update_cache: yes
17     cache_valid_time: 3600
18   when:
19     - ansible_distribution|lower == 'ubuntu'
20   tags:
21     - common-inst-prerequisites
22
23 - name: Inst - Prerequisites
24   package:
25     name: "{{ packages | flatten(levels=1) }}"
26     state: latest
27   tags:
28     - common-inst-prerequisites
29
30 - name: Install CSIT PIP requirements
31   pip:
32     name:
33       - "ecdsa==0.13.3"
34       - "paramiko==2.6.0"
35       - "pycrypto==2.6.1"
36       - "pypcap==1.2.3"
37       - "PyYAML==5.1.1"
38       - "requests==2.22.0"
39       - "robotframework==3.1.2"
40       - "scapy==2.4.3"
41       - "scp==0.13.2"
42       - "ansible==2.10.7"
43       - "dill==0.2.8.2"
44       - "numpy==1.17.3"
45       - "hdrhistogram==0.6.1"
46       - "plotly==4.1.1"
47       - "PTable==0.9.2"
48       - "Sphinx==2.2.1"
49       - "sphinx-rtd-theme==0.4.0"
50       - "sphinxcontrib-programoutput==0.15"
51       - "sphinxcontrib-robotdoc==0.11.0"
52       - "alabaster==0.7.12"
53       - "Babel==2.7.0"
54       - "bcrypt==3.1.7"
55       - "certifi==2019.9.11"
56       - "cffi==1.13.2"
57       - "chardet==3.0.4"
58       - "cryptography==2.8"
59       - "docutils==0.15.2"
60       - "future==0.18.2"
61       - "idna==2.8"
62       - "imagesize==1.1.0"
63       - "Jinja2==2.10.3"
64       - "MarkupSafe==1.1.1"
65       - "packaging==19.2"
66       - "pbr==5.4.3"
67       - "pycparser==2.19"
68       - "Pygments==2.4.2"
69       - "PyNaCl==1.3.0"
70       - "pyparsing==2.4.4"
71       - "python-dateutil==2.8.1"
72       - "pytz==2019.3"
73       - "retrying==1.3.3"
74       - "six==1.13.0"
75       - "snowballstemmer==2.0.0"
76       - "sphinxcontrib-applehelp==1.0.1"
77       - "sphinxcontrib-devhelp==1.0.1"
78       - "sphinxcontrib-htmlhelp==1.0.2"
79       - "sphinxcontrib-jsmath==1.0.1"
80       - "sphinxcontrib-qthelp==1.0.2"
81       - "sphinxcontrib-serializinghtml==1.1.3"
82       - "urllib3==1.25.6"
83   tags:
84     - install-pip
85
86 - name: Install CSIT PIP requirements - Pandas and SciPy workaround
87   pip:
88     name:
89       - "pandas==0.25.3"
90       - "scipy==1.5.4"
91   tags:
92     - install-pip
93
94 - name: Install Meson (repository version is too old)
95   pip:
96     name:
97       - "meson==0.47.1"
98   tags:
99     - install-meson
100
101 - name: Set sudoers admin
102   lineinfile:
103     path: "/etc/sudoers"
104     state: "present"
105     regexp: "^%admin ALL="
106     line: "%admin ALL=(ALL) ALL"
107     validate: "/usr/sbin/visudo -cf %s"
108   tags:
109     - set-sudoers
110
111 - name: Set sudoers sudo
112   lineinfile:
113     path: "/etc/sudoers"
114     state: "present"
115     regexp: "^%sudo"
116     line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL"
117     validate: "/usr/sbin/visudo -cf %s"
118   tags:
119     - set-sudoers
120
121 - meta: flush_handlers