mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
win_optional_feature - support multiple feature in name (#54368)
This commit is contained in:
@@ -21,5 +21,20 @@
|
||||
register: run_tests
|
||||
|
||||
- name: run tests
|
||||
include_tasks: tests.yml
|
||||
when: run_tests.stdout | trim | bool
|
||||
block:
|
||||
- name: ensure we start test with removed features
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: absent
|
||||
- include_tasks: tests.yml
|
||||
|
||||
always:
|
||||
- name: make sure test features have been removed after test
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: absent
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
- name: fail with invalid feature name
|
||||
win_optional_feature:
|
||||
name:
|
||||
- TelnetClient
|
||||
- FakeFeature
|
||||
state: present
|
||||
register: invalid_name
|
||||
failed_when: invalid_name.msg != "Failed to find feature 'FakeFeature'"
|
||||
|
||||
- name: run with check_mode
|
||||
win_optional_feature:
|
||||
name: TelnetClient
|
||||
@@ -36,7 +45,7 @@
|
||||
include_parent: true
|
||||
register: real_feature_check
|
||||
|
||||
- name: assert feature installed
|
||||
- name: assert feature installed
|
||||
assert:
|
||||
that:
|
||||
- real_feature_check.changed
|
||||
@@ -53,6 +62,34 @@
|
||||
that:
|
||||
- not real_feature_check.changed
|
||||
|
||||
- name: install feature with list
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: present
|
||||
include_parent: true
|
||||
register: install_list
|
||||
|
||||
- name: assert install feature with list
|
||||
assert:
|
||||
that:
|
||||
- install_list is changed
|
||||
|
||||
- name: install feature with list (idempotent)
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: present
|
||||
include_parent: true
|
||||
register: install_list_again
|
||||
|
||||
- name: assert install feature with list (idempotent)
|
||||
assert:
|
||||
that:
|
||||
- not install_list_again is changed
|
||||
|
||||
- name: removal run with check_mode
|
||||
win_optional_feature:
|
||||
name: TelnetClient
|
||||
@@ -76,7 +113,7 @@
|
||||
that:
|
||||
- real_feature_check.changed
|
||||
|
||||
- name: test idempotence for removal
|
||||
- name: test idempotence for removal
|
||||
win_optional_feature:
|
||||
name: TelnetClient
|
||||
state: absent
|
||||
@@ -86,3 +123,29 @@
|
||||
assert:
|
||||
that:
|
||||
- not real_feature_check.changed
|
||||
|
||||
- name: remove feature with list
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: absent
|
||||
register: remove_feature_list
|
||||
|
||||
- name: assert remove feature with list
|
||||
assert:
|
||||
that:
|
||||
- remove_feature_list is changed
|
||||
|
||||
- name: remove feature with list (idempotent)
|
||||
win_optional_feature:
|
||||
name:
|
||||
- SimpleTCP
|
||||
- TelnetClient
|
||||
state: absent
|
||||
register: remove_feature_list_again
|
||||
|
||||
- name: assert remove feature with list (idempotent)
|
||||
assert:
|
||||
that:
|
||||
- not remove_feature_list_again is changed
|
||||
|
||||
Reference in New Issue
Block a user