collection 교체

This commit is contained in:
정훈 변
2024-02-23 16:37:40 +09:00
parent b494779b5b
commit 3fd554eee9
38862 changed files with 220204 additions and 6600073 deletions

View File

@@ -3,7 +3,8 @@
# Copyright 2016 Dino Occhialini <dino.occhialini@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -18,6 +19,13 @@ description:
author:
- "Dino Occhialini (@dinoocch)"
- "Michael Aldridge (@the-maldridge)"
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
@@ -37,56 +45,68 @@ options:
that they are not required by other packages and were not
explicitly installed by a user.
type: bool
default: no
default: false
update_cache:
description:
- Whether or not to refresh the master package lists. This can be
run as part of a package installation or as a separate step.
- Alias C(update-cache) has been deprecated and will be removed in community.general 5.0.0.
aliases: ['update-cache']
type: bool
default: yes
default: true
upgrade:
description:
- Whether or not to upgrade whole system
type: bool
default: no
default: false
upgrade_xbps:
description:
- Whether or not to upgrade the xbps package when necessary.
Before installing new packages,
xbps requires the user to update the xbps package itself.
Thus when this option is set to C(no),
Thus when this option is set to V(false),
upgrades and installations will fail when xbps is not up to date.
type: bool
default: yes
default: true
version_added: '0.2.0'
'''
EXAMPLES = '''
- name: Install package foo (automatically updating the xbps package if needed)
community.general.xbps: name=foo state=present
community.general.xbps:
name: foo
state: present
- name: Upgrade package foo
community.general.xbps: name=foo state=latest update_cache=yes
community.general.xbps:
name: foo
state: latest
update_cache: true
- name: Remove packages foo and bar
community.general.xbps: name=foo,bar state=absent
community.general.xbps:
name:
- foo
- bar
state: absent
- name: Recursively remove package foo
community.general.xbps: name=foo state=absent recurse=yes
community.general.xbps:
name: foo
state: absent
recurse: true
- name: Update package cache
community.general.xbps: update_cache=yes
community.general.xbps:
update_cache: true
- name: Upgrade packages
community.general.xbps: upgrade=yes
community.general.xbps:
upgrade: true
- name: Install a package, failing if the xbps package is out of date
community.general.xbps:
name: foo
state: present
upgrade_xbps: no
upgrade_xbps: false
'''
RETURN = '''
@@ -160,7 +180,7 @@ def upgrade(module, xbps_path):
rc, stdout, stderr = module.run_command(cmdneedupgrade, check_rc=False)
if rc == 0:
if(len(stdout.splitlines()) == 0):
if len(stdout.splitlines()) == 0:
module.exit_json(changed=False, msg='Nothing to upgrade')
elif module.check_mode:
module.exit_json(changed=True, msg='Would have performed upgrade')
@@ -286,10 +306,8 @@ def main():
'removed']),
recurse=dict(default=False, type='bool'),
upgrade=dict(default=False, type='bool'),
update_cache=dict(
default=True, aliases=['update-cache'], type='bool',
deprecated_aliases=[dict(name='update-cache', version='5.0.0', collection_name='community.general')]),
upgrade_xbps=dict(default=True, type='bool')
update_cache=dict(default=True, type='bool'),
upgrade_xbps=dict(default=True, type='bool'),
),
required_one_of=[['name', 'update_cache', 'upgrade']],
supports_check_mode=True)