Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/setup_pkg_mgr/tasks/main.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 ####################################################################
7 # WARNING: These are designed specifically for Ansible tests #
8 # and should not be used as examples of how to write Ansible roles #
9 ####################################################################
10
11 - ansible.builtin.set_fact:
12 pkg_mgr: community.general.pkgng
13 ansible_pkg_mgr: community.general.pkgng
14 cacheable: true
15 when: ansible_facts.os_family == "FreeBSD"
16
17 - ansible.builtin.set_fact:
18 pkg_mgr: community.general.zypper
19 ansible_pkg_mgr: community.general.zypper
20 cacheable: true
21 when: ansible_facts.os_family == "Suse"
22
23 - ansible.builtin.shell:
24 # noqa: command-instead-of-module
25 cmd: |
26 sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo
27 sed -i 's%#baseurl=http://mirror.centos.org/%baseurl=https://vault.centos.org/%g' /etc/yum.repos.d/*.repo
28 when: ansible_facts.distribution in 'CentOS' and ansible_facts.distribution_major_version == '7'
29
30 - ansible.builtin.shell:
31 # noqa: command-instead-of-module
32 cmd: |
33 sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*.repo
34 sed -i 's%#baseurl=http://mirror.centos.org/$contentdir/$releasever/%baseurl=https://vault.centos.org/8.4.2105/%g' /etc/yum.repos.d/CentOS-Linux-*.repo
35 ignore_errors: true # This fails for CentOS Stream 8
36 when: ansible_facts.distribution in 'CentOS' and ansible_facts.distribution_major_version == '8'