Infra: Ansible yaml lint cleanup
[csit.git] / fdio.infra.ansible / roles / common / tasks / main.yaml
1 ---
2 # file: roles/common/tasks/main.yaml
3
4 - name: Conf - 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     - common-conf-proxy
13
14 - name: Inst - Update package cache (apt)
15   apt:
16     update_cache: true
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: Inst - Meson (DPDK)
31   pip:
32     name:
33       - "meson==0.49.2"
34   tags:
35     - common-inst-meson
36
37 - name: Conf - sudoers admin
38   lineinfile:
39     path: "/etc/sudoers"
40     state: "present"
41     regexp: "^%admin ALL="
42     line: "%admin ALL=(ALL) ALL"
43     validate: "/usr/sbin/visudo -cf %s"
44   tags:
45     - common-conf-sudoers
46
47 - name: Conf - sudoers nopasswd
48   lineinfile:
49     path: "/etc/sudoers"
50     state: "present"
51     regexp: "^%sudo"
52     line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL"
53     validate: "/usr/sbin/visudo -cf %s"
54   tags:
55     - common-conf-sudoers