---
- name: Install cockpit-ws
  yum:
    name: "{{ item }}"
    state: present
  with_items:
    - cockpit-ws
    - cockpit-shell
    - cockpit-bridge
    - "{{ cockpit_plugins }}"
  when: ansible_pkg_mgr == "yum"

- name: Install cockpit-ws
  dnf:
    name: "{{ item }}"
    state: present
  with_items:
    - cockpit-ws
    - cockpit-shell
    - cockpit-bridge
    - "{{ cockpit_plugins }}"
  when: ansible_pkg_mgr == "dnf"

- name: Enable cockpit-ws
  service:
    name: cockpit.socket
    enabled: true
    state: started