aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/common/tasks/main.yaml
blob: 7418709c9900b59b9d6cf6f3d34dcdd81715ff2e (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
---
# file: roles/common/tasks/main.yaml

- name: Conf - Add permanent proxy settings
  lineinfile:
    path: "/etc/environment"
    state: "present"
    line: "{{ item.key }}={{ item.value }}"
  with_dict: "{{ proxy_env }}"
  when: proxy_env is defined
  tags:
    - common-conf-proxy

- name: Inst - Update package cache (apt)
  apt:
    update_cache: true
    cache_valid_time: 3600
  when:
    - ansible_distribution|lower == 'ubuntu'
  tags:
    - common-inst-prerequisites

- name: Inst - Prerequisites
  package:
    name: "{{ packages | flatten(levels=1) }}"
    state: latest
  tags:
    - common-inst-prerequisites

- name: Inst - Meson (DPDK)
  pip:
    name:
      - "meson==0.49.2"
  tags:
    - common-inst-meson

- name: Conf - sudoers admin
  lineinfile:
    path: "/etc/sudoers"
    state: "present"
    regexp: "^%admin ALL="
    line: "%admin ALL=(ALL) ALL"
    validate: "/usr/sbin/visudo -cf %s"
  tags:
    - common-conf-sudoers

- name: Conf - sudoers nopasswd
  lineinfile:
    path: "/etc/sudoers"
    state: "present"
    regexp: "^%sudo"
    line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL"
    validate: "/usr/sbin/visudo -cf %s"
  tags:
    - common-conf-sudoers