mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Bump version of main to 12.0.0; execute announced deprecations (#10883)
* Bump version to 12.0.0. * Remove deprecated modules and plugins. * state is now required. * Change default of prepend_hash from auto to never. * Remove support for force=''. * Always delegate 'debug'. * Remove ignore_value_none and ctx_ignore_none parameters. * Remove parameters on_success and on_failure. * Update BOTMETA. * Adjust docs reference. * Forgot required=True. * Fix changelog fragment. * Adjust unit tests. * Fix changelog. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
# Copyright (c) Ansible Project
|
||||
# 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
|
||||
|
||||
azp/posix/1
|
||||
needs/target/callback
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# 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
|
||||
|
||||
dependencies:
|
||||
- setup_remote_tmp_dir
|
||||
@@ -1,143 +0,0 @@
|
||||
---
|
||||
####################################################################
|
||||
# WARNING: These are designed specifically for Ansible tests #
|
||||
# and should not be used as examples of how to write Ansible roles #
|
||||
####################################################################
|
||||
|
||||
# Copyright (c) Ansible Project
|
||||
# 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
|
||||
|
||||
- name: Write vault password to disk
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ remote_tmp_dir }}/vault-password"
|
||||
content: asdf
|
||||
|
||||
- name: Run tests
|
||||
include_role:
|
||||
name: callback
|
||||
vars:
|
||||
tests:
|
||||
- name: Basic run
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.yaml
|
||||
playbook: |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Sample task name
|
||||
debug:
|
||||
msg: sample debug msg
|
||||
expected_output:
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- ""
|
||||
- "TASK [Sample task name] ********************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " msg: sample debug msg"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
|
||||
- name: Test umlauts in multiline
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.yaml
|
||||
playbook: |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Umlaut output
|
||||
debug:
|
||||
msg: "äöü\néêè\nßï☺"
|
||||
expected_output:
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- ""
|
||||
- "TASK [Umlaut output] ***********************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " msg: |-"
|
||||
- " äöü"
|
||||
- " éêè"
|
||||
- " ßï☺"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
|
||||
- name: Test to_yaml
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.yaml
|
||||
playbook: !unsafe |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
data: |
|
||||
line 1
|
||||
line 2
|
||||
line 3
|
||||
tasks:
|
||||
- name: Test to_yaml
|
||||
debug:
|
||||
msg: "{{ data | to_yaml }}"
|
||||
expected_output:
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- ""
|
||||
- "TASK [Test to_yaml] ************************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " msg: |-"
|
||||
- " 'line 1"
|
||||
- " "
|
||||
- " line 2"
|
||||
- " "
|
||||
- " line 3"
|
||||
- " "
|
||||
- " '"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
- name: Some more fun with data tagging
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.yaml
|
||||
extra_cli_arguments: "--vault-password-file {{ remote_tmp_dir }}/vault-password"
|
||||
playbook: !unsafe |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
foo: bar
|
||||
baz: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
30393064316433636636373336363538663034643135363938646665393661353833633865313765
|
||||
3835366434646339313337663335393865336163663434310a316161313662666466333332353731
|
||||
64663064366461643162666137303737643164376134303034306366383830336232363837636638
|
||||
3830653338626130360a313639623231353931356563313065373661303262646337383534663932
|
||||
64353461663065333362346264326335373032313333343539646661656634653138646332313639
|
||||
3566313765626464613734623664663266336237646139373935
|
||||
tasks:
|
||||
- name: Test regular string
|
||||
debug:
|
||||
var: foo
|
||||
- name: Test vaulted string
|
||||
debug:
|
||||
var: baz
|
||||
expected_output:
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- ""
|
||||
- "TASK [Test regular string] *****************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " foo: bar"
|
||||
- ""
|
||||
- "TASK [Test vaulted string] *****************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " baz: aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
@@ -205,7 +205,7 @@ TC_RUNNER = dict(
|
||||
results="0-/-ni-/-nu"
|
||||
),
|
||||
),
|
||||
aa_bb_ignore_none_with_none=(
|
||||
aa_bb_with_none=(
|
||||
dict(
|
||||
args_bundle=dict(
|
||||
aa=dict(type="int", value=49, fmt_func=cmd_runner_fmt.as_opt_eq_val, fmt_arg="--answer"),
|
||||
@@ -214,7 +214,6 @@ TC_RUNNER = dict(
|
||||
runner_init_args=dict(default_args_order=['bb', 'aa']),
|
||||
runner_ctx_args=dict(
|
||||
args_order=['aa', 'bb'],
|
||||
ignore_value_none=True, # default
|
||||
),
|
||||
),
|
||||
dict(runner_ctx_run_args=dict(bb=None), rc=0, out="ni", err="nu"),
|
||||
@@ -224,25 +223,6 @@ TC_RUNNER = dict(
|
||||
),
|
||||
),
|
||||
),
|
||||
aa_bb_ignore_not_none_with_none=(
|
||||
dict(
|
||||
args_bundle=dict(
|
||||
aa=dict(type="int", value=49, fmt_func=cmd_runner_fmt.as_opt_eq_val, fmt_arg="--answer"),
|
||||
bb=dict(fmt_func=cmd_runner_fmt.as_bool, fmt_arg="--bb-here"),
|
||||
),
|
||||
runner_init_args=dict(default_args_order=['bb', 'aa']),
|
||||
runner_ctx_args=dict(
|
||||
args_order=['aa', 'bb'],
|
||||
ignore_value_none=False,
|
||||
),
|
||||
),
|
||||
dict(runner_ctx_run_args=dict(aa=None, bb=True), rc=0, out="ni", err="nu"),
|
||||
dict(
|
||||
run_info=dict(
|
||||
cmd=['/mock/bin/testing', '--answer=None', '--bb-here'],
|
||||
),
|
||||
),
|
||||
),
|
||||
aa_bb_fixed=(
|
||||
dict(
|
||||
args_bundle=dict(
|
||||
|
||||
@@ -23,12 +23,6 @@ CAUSE_CHG_DECO_PARAMS = ['deco_args', 'expect_exception', 'expect_changed']
|
||||
CAUSE_CHG_DECO = dict(
|
||||
none_succ=dict(deco_args={}, expect_exception=False, expect_changed=None),
|
||||
none_fail=dict(deco_args={}, expect_exception=True, expect_changed=None),
|
||||
onsucc_succ=dict(deco_args=dict(on_success=True), expect_exception=False, expect_changed=True),
|
||||
onsucc_fail=dict(deco_args=dict(on_success=True), expect_exception=True, expect_changed=None),
|
||||
onfail_succ=dict(deco_args=dict(on_failure=True), expect_exception=False, expect_changed=None),
|
||||
onfail_fail=dict(deco_args=dict(on_failure=True), expect_exception=True, expect_changed=True),
|
||||
onboth_succ=dict(deco_args=dict(on_success=True, on_failure=True), expect_exception=False, expect_changed=True),
|
||||
onboth_fail=dict(deco_args=dict(on_success=True, on_failure=True), expect_exception=True, expect_changed=True),
|
||||
whensucc_succ=dict(deco_args=dict(when="success"), expect_exception=False, expect_changed=True),
|
||||
whensucc_fail=dict(deco_args=dict(when="success"), expect_exception=True, expect_changed=None),
|
||||
whenfail_succ=dict(deco_args=dict(when="failure"), expect_exception=False, expect_changed=None),
|
||||
|
||||
Reference in New Issue
Block a user