add collections

This commit is contained in:
Gary Kwok
2024-02-01 11:40:42 +08:00
parent 0715d7c475
commit 7af4c56c96
3198 changed files with 455118 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# 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
skip/aix
skip/osx
skip/macos
skip/freebsd
skip/rhel

View File

@@ -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
dependencies:
- setup_mosquitto

View File

@@ -0,0 +1,14 @@
---
####################################################################
# 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
- include: ubuntu.yml
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_release not in ['focal', 'jammy']

View File

@@ -0,0 +1,147 @@
---
# 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: Install pip packages
pip:
name: paho-mqtt>=1.4.0
state: present
- name: MQTT non-TLS endpoint
mqtt:
topic: /node/s/bar/blurb
payload: foo
qos: 1
client_id: me001
register: result
- assert:
that:
- result is success
- name: Send a test message to TLS1.1 endpoint, no client version specified
mqtt:
topic: /node/s/bar/blurb
payload: foo-tls
qos: 1
client_id: me001
ca_certs: /tls/ca_certificate.pem
certfile: /tls/client_certificate.pem
keyfile: /tls/client_key.pem
port: 8883
register: result
- assert:
that:
- result is success
- name: Send a test message to TLS1.2 endpoint, no client version specified
mqtt:
topic: /node/s/bar/blurb
payload: foo-tls
qos: 1
client_id: me001
ca_certs: /tls/ca_certificate.pem
certfile: /tls/client_certificate.pem
keyfile: /tls/client_key.pem
port: 8884
register: result
- assert:
that:
- result is success
# TODO(Uncomment when TLS1.3 is supported in moquitto and ubuntu version)
#
# - name: Send a test message to TLS1.3 endpoint
# mqtt:
# topic: /node/s/bar/blurb
# payload: foo-tls
# qos: 1
# client_id: me001
# ca_certs: /tls/ca_certificate.pem
# certfile: /tls/client_certificate.pem
# keyfile: /tls/client_key.pem
# port: 8885
# register: result
#- assert:
# that:
# - result is success
- name: Send a message, client TLS1.1, server (required) TLS1.2 - Expected failure
mqtt:
topic: /node/s/bar/blurb
payload: foo-tls
qos: 1
client_id: me001
ca_certs: /tls/ca_certificate.pem
certfile: /tls/client_certificate.pem
keyfile: /tls/client_key.pem
tls_version: tlsv1.1
port: 8884
register: result
failed_when: result is success
- assert:
that:
- result is success
# TODO(Uncomment when TLS1.3 is supported in moquitto and ubuntu version)
#
# - name: Send a message, client TLS1.1, server (required) TLS1.3 - Expected failure
# mqtt:
# topic: /node/s/bar/blurb
# payload: foo-tls
# qos: 1
# client_id: me001
# ca_certs: /tls/ca_certificate.pem
# certfile: /tls/client_certificate.pem
# keyfile: /tls/client_key.pem
# tls_version: tlsv1.1
# port: 8885
# register: result
# failed_when: result is success
# - assert:
# that:
# - result is success
- name: Send a message, client TLS1.2, server (required) TLS1.1 - Expected failure
mqtt:
topic: /node/s/bar/blurb
payload: foo-tls
qos: 1
client_id: me001
ca_certs: /tls/ca_certificate.pem
certfile: /tls/client_certificate.pem
keyfile: /tls/client_key.pem
tls_version: tlsv1.2
port: 8883
register: result
failed_when: result is success
- assert:
that:
- result is success
# TODO(Uncomment when TLS1.3 is supported in moquitto and ubuntu version)
#
# - name: Send a message, client TLS1.2, server (required) TLS1.3 - Expected failure
# mqtt:
# topic: /node/s/bar/blurb
# payload: foo-tls
# qos: 1
# client_id: me001
# ca_certs: /tls/ca_certificate.pem
# certfile: /tls/client_certificate.pem
# keyfile: /tls/client_key.pem
# tls_version: tlsv1.2
# port: 8885
# register: result
# failed_when: result is success
# - assert:
# that:
# - result is success