Debian Codegraph @

ansible_collections/community/sops/roles/install/tasks/github.yml

raw
1 ---
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4 # SPDX-FileCopyrightText: 2022, Felix Fontein
5
6 - name: Make sure that SOPS can be installed from GitHub
7 ansible.builtin.fail:
8 msg: >-
9 SOPS cannot be installed from GitHub for
10 {{ _community_sops_install_facts.distribution }} {{ _community_sops_install_facts.distribution_version }}.
11 when: not _community_sops_install_system_has_github
12
13 - name: Start determining SOPS version
14 ansible.builtin.set_fact:
15 _community_sops_install_effective_sops_version: '{{ "" if sops_version == "latest" else sops_version }}'
16
17 # This method uses the GitHub API, which is rate-limited.
18 - name: Determine latest version (fallback)
19 when:
20 - _community_sops_install_effective_sops_version == ''
21 - sops_github_latest_detection in ['auto', 'api']
22 ansible.builtin.include_tasks: github_api.yml
23
24 # This method asks GitHub for the latest release, which depends on the release to be
25 # correctly marked as "latest" in the GitHub UI. Fortunately this is not as aggressively
26 # rate-limited as the API (used in the fallback).
27 - name: Determine latest version
28 when:
29 - _community_sops_install_effective_sops_version == ''
30 - sops_github_latest_detection in ['auto', 'latest-release']
31 ansible.builtin.include_tasks: github_latest_release.yml
32
33 - name: Fail when latest version could not be selected
34 ansible.builtin.fail:
35 msg: Could not determine the latest GitHub release
36 when: _community_sops_install_effective_sops_version == ''
37
38 - name: Show selected version
39 ansible.builtin.debug:
40 msg: The latest SOPS version is SOPS {{ _community_sops_install_effective_sops_version }}.
41 when: sops_version == 'latest'
42
43 - name: Set variables
44 ansible.builtin.set_fact:
45 _community_sops_install_system_packages_actual: >-
46 {{ _community_sops_install_system_packages + _community_sops_install_system_packages_github }}
47 _community_sops_install_system_packages_unsigned_actual: >-
48 {{ _community_sops_install_system_packages_unsigned + _community_sops_install_system_packages_unsigned_github }}
49 _community_sops_install_system_package_deb_actual: >-
50 {{ _community_sops_install_system_package_deb_github }}