---
# tasks file for roles/quobyte-base

- name: Remove Old Quobyte Repo
  become: true
  file:
    path: /etc/apt/sources.list.d/packages_quobyte_com_repo_3_dyW33dgsg05k40EvWxS3PBCn14MrdvfH_apt.list
    state: absent

- name: Quobyte Repo Key
  become: true
  apt_key:
    id: "{{ quobyte_repo_id_key_id }}"
    url: https://packages.quobyte.com/repo/3/{{ quobyte_repo_id }}/apt/pubkey.gpg
    state: present
    validate_certs: "{{ 'False' if ansible_python_version is version('2.7.9', '<') else 'True' }}"
  tags: software

# Cause apt_repository doesn't have a way to manage a whole file.
- name: Quobyte Repo
  become: true
  template:
    dest: /etc/apt/sources.list.d/quobyte.list
    src: etc/apt/sources.list.d/quobyte.list.j2
    mode: "0644"
  register: quobyte_repo_file
  tags: software

- name: Update Repo Data
  become: true
  apt:
    update_cache: true
  when: quobyte_repo_file['changed'] | default(false) | bool
  tags: software

- name: Quobyte Required Packages
  become: true
  apt:
    name:
      - apt-transport-https
      - chrony
    state: present
  tags: software

# vim: set ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>
