mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Move unrelated connection test to separate target.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
shippable/posix/group2
|
||||
@@ -1,2 +0,0 @@
|
||||
[local]
|
||||
testhost
|
||||
@@ -1,19 +0,0 @@
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "use a connection plugin raising an exception, exception message contains Jinja template."
|
||||
connection: dummy
|
||||
command: /bin/true # command won't be executed
|
||||
register: result
|
||||
ignore_errors: True
|
||||
|
||||
- name: "check that Jinja template embedded in exception message isn't rendered"
|
||||
debug:
|
||||
msg: 'ok'
|
||||
when: result is failed
|
||||
register: debug_task
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
- debug_task is success
|
||||
@@ -1,46 +0,0 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
author:
|
||||
- John Doe
|
||||
connection: dummy
|
||||
short_description: defective connection plugin
|
||||
description:
|
||||
- defective connection plugin
|
||||
version_added: "2.0"
|
||||
options: {}
|
||||
"""
|
||||
import ansible.constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.plugins.connection import ConnectionBase
|
||||
|
||||
|
||||
class Connection(ConnectionBase):
|
||||
|
||||
transport = 'dummy'
|
||||
has_pipelining = True
|
||||
become_methods = frozenset(C.BECOME_METHODS)
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||
|
||||
raise AnsibleError('an error with {{ some Jinja }}')
|
||||
|
||||
def transport(self):
|
||||
pass
|
||||
|
||||
def _connect(self):
|
||||
pass
|
||||
|
||||
def exec_command(self, cmd, in_data=None, sudoable=True):
|
||||
pass
|
||||
|
||||
def put_file(self, in_path, out_path):
|
||||
pass
|
||||
|
||||
def fetch_file(self, in_path, out_path):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset -o errexit -o xtrace
|
||||
|
||||
ANSIBLE_CONNECTION_PLUGINS="$(pwd)/plugin" ansible-playbook -i inventory "$(pwd)/play.yml" -v "$@"
|
||||
Reference in New Issue
Block a user