---
- block:
    - name: Install dbus for debian system
      apt:
        name: dbus

    - name: Install packages needed for unprivileged mode
      apt:
        name: "{{ item }}"
      loop:
        - libssl-dev
        - python3-pip
        - vim
      when: not kayobe_control_host_become | bool
  when:
    - ansible_facts.os_family == 'Debian'
  become: true

- block:
    # NOTE(mgoddard): The CentOS image used in CI has epel-release installed,
    # but the configure-mirrors role used by Zuul disables epel. We no longer
    # install EPEL by default, but let's just be sure it's disabled.
    - name: Ensure dnf-plugins-core is installed
      package:
        name: dnf-plugins-core
        state: present

    - name: Enable the EPEL repository
      command: dnf config-manager --disable epel

    - name: Install packages needed for unprivileged mode
      package:
        name: "{{ item }}"
        state: present
      loop:
        - openssl-devel
      when: not kayobe_control_host_become | bool

  when: ansible_facts.os_family == 'RedHat'
  become: true
