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