forked from CCCHH/ansible-infra
Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
3553 changed files with 387444 additions and 2 deletions
|
|
@ -0,0 +1,6 @@
|
|||
# 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/4
|
||||
destructive
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
# 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_docker
|
||||
- setup_docker_sdk_for_python
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
# 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: Create random name prefix
|
||||
ansible.builtin.set_fact:
|
||||
name_prefix: "vieux/sshfs"
|
||||
plugin_names: []
|
||||
|
||||
- ansible.builtin.debug:
|
||||
msg: "Using name prefix {{ name_prefix }}"
|
||||
|
||||
- name: Check whether /dev/fuse exists
|
||||
ansible.builtin.stat:
|
||||
path: /dev/fuse
|
||||
register: dev_fuse_stat
|
||||
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: run-test.yml
|
||||
with_fileglob:
|
||||
- "tests/*.yml"
|
||||
loop_control:
|
||||
loop_var: test_name
|
||||
|
||||
always:
|
||||
- name: "Make sure plugin is removed"
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ item }}"
|
||||
state: absent
|
||||
with_items: "{{ plugin_names }}"
|
||||
|
||||
when: docker_api_version is version('1.25', '>=') and dev_fuse_stat.stat.exists
|
||||
|
||||
- ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_plugin tests!"
|
||||
when: not(docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# 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: "Loading tasks from {{ test_name }}"
|
||||
ansible.builtin.include_tasks: "{{ test_name }}"
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
---
|
||||
# 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: Registering plugin name
|
||||
ansible.builtin.set_fact:
|
||||
plugin_name: "{{ name_prefix }}"
|
||||
|
||||
- name: Registering container name
|
||||
ansible.builtin.set_fact:
|
||||
plugin_names: "{{ plugin_names + [plugin_name] }}"
|
||||
|
||||
############ basic test ############
|
||||
####################################
|
||||
|
||||
- name: Create a plugin (check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: present
|
||||
register: create_1_check
|
||||
check_mode: true
|
||||
|
||||
- name: Create a plugin
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: present
|
||||
register: create_1
|
||||
|
||||
- name: Create a plugin (Idempotent, check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: present
|
||||
register: create_2_check
|
||||
check_mode: true
|
||||
|
||||
- name: Create a plugin (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: present
|
||||
register: create_2
|
||||
|
||||
- name: Enable a plugin (check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: enable
|
||||
register: create_3_check
|
||||
check_mode: true
|
||||
|
||||
- name: Enable a plugin
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: enable
|
||||
register: create_3
|
||||
|
||||
- name: Enable a plugin (Idempotent, check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: enable
|
||||
register: create_4_check
|
||||
check_mode: true
|
||||
|
||||
- name: Enable a plugin (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: enable
|
||||
register: create_4
|
||||
|
||||
- name: Disable a plugin (check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: disable
|
||||
register: absent_1_check
|
||||
check_mode: true
|
||||
|
||||
- name: Disable a plugin
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: disable
|
||||
register: absent_1
|
||||
|
||||
- name: Disable a plugin (Idempotent, check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: disable
|
||||
register: absent_2_check
|
||||
check_mode: true
|
||||
|
||||
- name: Disable a plugin (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: disable
|
||||
register: absent_2
|
||||
|
||||
- name: Remove a plugin (check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
register: absent_3_check
|
||||
check_mode: true
|
||||
|
||||
- name: Remove a plugin
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
register: absent_3
|
||||
|
||||
- name: Remove a plugin (Idempotent, check mode)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
register: absent_4_check
|
||||
check_mode: true
|
||||
|
||||
- name: Remove a plugin (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
register: absent_4
|
||||
|
||||
- name: Cleanup
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
force_remove: true
|
||||
|
||||
- ansible.builtin.assert:
|
||||
that:
|
||||
- create_1_check is changed
|
||||
- create_1 is changed
|
||||
- create_2_check is not changed
|
||||
- create_2 is not changed
|
||||
- create_3_check is changed
|
||||
- create_3 is changed
|
||||
- create_4_check is not changed
|
||||
- create_4 is not changed
|
||||
- absent_1_check is changed
|
||||
- absent_1 is changed
|
||||
- absent_2_check is not changed
|
||||
- absent_2 is not changed
|
||||
- absent_3_check is changed
|
||||
- absent_3 is changed
|
||||
- absent_4_check is not changed
|
||||
- absent_4 is not changed
|
||||
|
||||
############ Plugin_Options ############
|
||||
########################################
|
||||
|
||||
- name: Install a plugin with options
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
plugin_options:
|
||||
DEBUG: '1'
|
||||
state: present
|
||||
register: create_1
|
||||
|
||||
- name: Install a plugin with options (idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
plugin_options:
|
||||
DEBUG: '1'
|
||||
state: present
|
||||
register: create_2
|
||||
|
||||
- name: Install a plugin with different options
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
plugin_options:
|
||||
DEBUG: '0'
|
||||
state: present
|
||||
register: update_1
|
||||
|
||||
- name: Install a plugin with different options (idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
plugin_options:
|
||||
DEBUG: '0'
|
||||
state: present
|
||||
register: update_2
|
||||
|
||||
- name: Cleanup
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
state: absent
|
||||
force_remove: true
|
||||
|
||||
- ansible.builtin.assert:
|
||||
that:
|
||||
- create_1 is changed
|
||||
- create_2 is not changed
|
||||
- update_1 is changed
|
||||
- update_2 is not changed
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
---
|
||||
# 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: Register plugin name and alias
|
||||
ansible.builtin.set_fact:
|
||||
plugin_name: "{{ name_prefix }}"
|
||||
alias: "test"
|
||||
|
||||
- name: Create a plugin with an alias
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: present
|
||||
register: create_1
|
||||
|
||||
- name: Create a plugin with an alias (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: present
|
||||
register: create_2
|
||||
|
||||
- name: Enable a plugin with an alias
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: enable
|
||||
register: create_3
|
||||
|
||||
- name: Enable a plugin with an alias (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: enable
|
||||
register: create_4
|
||||
|
||||
- name: Disable a plugin with an alias
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: disable
|
||||
register: absent_1
|
||||
|
||||
- name: Disable a plugin with an alias (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: disable
|
||||
register: absent_2
|
||||
|
||||
- name: Remove a plugin with an alias
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: absent
|
||||
register: absent_3
|
||||
|
||||
- name: Remove a plugin with an alias (Idempotent)
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: absent
|
||||
register: absent_4
|
||||
|
||||
- ansible.builtin.assert:
|
||||
that:
|
||||
- create_1 is changed
|
||||
- create_2 is not changed
|
||||
- create_3 is changed
|
||||
- create_4 is not changed
|
||||
- absent_1 is changed
|
||||
- absent_2 is not changed
|
||||
- absent_3 is changed
|
||||
- absent_4 is not changed
|
||||
|
||||
- name: Cleanup plugin with an alias
|
||||
community.docker.docker_plugin:
|
||||
plugin_name: "{{ plugin_name }}"
|
||||
alias: "{{ alias }}"
|
||||
state: absent
|
||||
force_remove: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue