Debian Codegraph @

ansible_collections/community/sops/roles/_install_age/tasks/main.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: Gather required information on localhost
7 when: sops_install_on_localhost
8 ansible.builtin.setup:
9 gather_subset:
10 - '!all'
11 - '!min'
12 - architecture
13 - distribution
14 - distribution_major_version
15 - distribution_version
16 - os_family
17 delegate_to: localhost
18 delegate_facts: true
19 run_once: true
20
21 - vars:
22 _community_sops_install_age_facts: >-
23 {{ hostvars['localhost' if sops_install_on_localhost else inventory_hostname].ansible_facts }}
24 block:
25 - name: Show system information
26 ansible.builtin.debug:
27 msg: |-
28 Architecture: {{ _community_sops_install_age_facts.architecture }}
29 Distribution: {{ _community_sops_install_age_facts.distribution }} {{ _community_sops_install_age_facts.distribution_major_version }}
30 Distribution version: {{ _community_sops_install_age_facts.distribution_version }}
31 OS family: {{ _community_sops_install_age_facts.os_family }}
32
33 - name: Include distribution specific variables
34 ansible.builtin.include_vars: '{{ lookup("ansible.builtin.first_found", params) }}'
35 vars:
36 params:
37 files:
38 - >-
39 D-{{ _community_sops_install_age_facts.distribution }}-{{ _community_sops_install_age_facts.distribution_version }}.yml
40 - >-
41 D-{{ _community_sops_install_age_facts.distribution }}-{{ _community_sops_install_age_facts.distribution_major_version }}.yml
42 - >-
43 D-{{ _community_sops_install_age_facts.distribution }}.yml
44 - >-
45 OS-{{ _community_sops_install_age_facts.os_family }}-{{ _community_sops_install_age_facts.distribution_major_version }}.yml
46 - >-
47 OS-{{ _community_sops_install_age_facts.os_family }}.yml
48 - default.yml
49 paths:
50 - '{{ role_path }}/vars'
51
52 - name: Install system packages
53 ansible.builtin.package:
54 name: '{{ _community_sops_install_age_system_packages }}'
55 become: '{{ sops_become_on_install }}'
56 delegate_to: '{{ "localhost" if sops_install_on_localhost else omit }}'
57 run_once: '{{ sops_install_on_localhost }}'
58 when: _community_sops_install_age_system_packages | length > 0
59
60 - name: Set results
61 ansible.builtin.set_fact:
62 age_installed: "{{ _community_sops_install_age_has_age }}"
63 delegate_to: '{{ "localhost" if sops_install_on_localhost else omit }}'
64 delegate_facts: '{{ true if sops_install_on_localhost else omit }}'