aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/packages/tasks/main.yml
blob: 798eafa978cab83bafe333683dd922db30c917df (plain) (blame)
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

# workstation ~~ roles/_workstation/packages/tasks/main.yml
# install packages for all distributions

---

- name: install packages for Archlinux
  shell: |
    pacman --noconfirm --needed -Sy {{ item | join(" ") }}
  loop:
    - "{{ pkgs_common }}"
    - "{{ pkgs_archlinux }}"
  no_log: true
  register: out
  ignore_errors: true
  when: ansible_distribution == "Archlinux"

- name: install packages for OpenBSD
  shell: pkg_add -z {{ item | join(" ") }}
  loop:
    - "{{ pkgs_common }}"
    - "{{ pkgs_openbsd }}"
  no_log: true
  register: out
  ignore_errors: true
  when: ansible_distribution == "OpenBSD"

- name: packages installation output
  debug:
    msg: |
      {% for item in out.results %}
      - {{ item.cmd }}
      {% for type in ["stdout_lines", "stderr_lines"] if item[type] %}
      -- {{ type }}
      {% for line in item[type] %}
      --- {{ line }}
      {% endfor %}
      {% endfor %}
      {% endfor %}
  when: out is defined

- name: show installation informations
  debug:
    msg: |
      {% if out is defined %}
      Installed all packages for system : {{ ansible_distribution }}
      {% else %}
      No installation methode for system : {{ ansible_distribution }}. Please patch and commit.
      {% endif %}
remember that computers suck.