diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70e6297..d204d7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: matrix: include: - distro: debian10 + ansible-version: '>=9, <10' - distro: debian11 - distro: debian12 - distro: ubuntu1804 diff --git a/README.md b/README.md index 67d10c0..9607256 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ Set up [Insync](https://www.insynchq.com) in Debian-like systems. * `software-properties-common` (will be installed) * `dirmngr` (will be installed) +* `apt-transport-https` (will be installed) + * `apt-utils` (will be installed) * `procps` (will be installed) diff --git a/tasks/repository.yml b/tasks/repository.yml index 5f1567e..fbe7c8c 100644 --- a/tasks/repository.yml +++ b/tasks/repository.yml @@ -1,26 +1,37 @@ # tasks file --- -- name: repository | dependencies +- name: repository | install dependencies (pre) ansible.builtin.apt: name: "{{ insync_dependencies_pre }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" tags: - - insync-repository-dependencies + - insync-repository-install-dependencies -- name: repository | add public key +- name: repository | (keyrings) directory | create + ansible.builtin.file: + path: "{{ insync_keyring_dst | dirname }}" + state: directory + owner: root + group: root + mode: 0755 + tags: + - insync-repository-keyrings-directory-create + +- name: repository | (keyring) file | download ansible.builtin.apt_key: - id: A684470CACCAF35C + id: "{{ insync_keyring_id }}" keyserver: "{{ apt_key_keyserver | default('keyserver.ubuntu.com') }}" + keyring: "{{ insync_keyring_dst }}" state: present tags: - - insync-repository-public-key + - insync-repository-keyring-file-download - name: repository | add ansible.builtin.apt_repository: repo: "{{ item.type }} {{ item.url }} {{ item.component }}" - state: present + state: "{{ item.state | default('present') }}" update_cache: true mode: 0644 with_items: "{{ insync_repositories }}" diff --git a/vars/main.yml b/vars/main.yml index 6c85932..18a0e0d 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,14 +1,21 @@ # vars file --- +insync_keyring_id: A684470CACCAF35C +insync_keyring_dst: /usr/share/keyrings/insync.gpg insync_repositories: + - type: "deb [signed-by={{ insync_keyring_dst }}]" + url: "http://apt.insync.io/{{ ansible_distribution | lower }} {{ ansible_distribution_release }}" + component: 'non-free contrib' + # TODO: Remove in next major release - type: deb url: "http://apt.insync.io/{{ ansible_distribution | lower }} {{ ansible_distribution_release }}" component: 'non-free contrib' + state: absent insync_dependencies_pre: - software-properties-common - dirmngr - - gpg-agent + - apt-transport-https - apt-utils - procps