diff options
Diffstat (limited to 'tests/fixtures/config')
4 files changed, 66 insertions, 0 deletions
diff --git a/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback.yaml b/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback.yaml new file mode 100644 index 000000000..50bbbbfc5 --- /dev/null +++ b/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback.yaml @@ -0,0 +1,4 @@ +- hosts: localhost + gather_facts: smart + tasks: + - command: echo test diff --git a/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback_plugins/test_callback.py b/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback_plugins/test_callback.py new file mode 100644 index 000000000..39ff7cd49 --- /dev/null +++ b/tests/fixtures/config/ansible-callbacks/git/common-config/playbooks/callback_plugins/test_callback.py @@ -0,0 +1,35 @@ +from ansible.plugins.callback import CallbackBase + +import os + +DOCUMENTATION = ''' + options: + file_name: + description: "" + ini: + - section: callback_test_callback + key: file_name + required: True + type: string +''' + + +class CallbackModule(CallbackBase): + CALLBACK_VERSION = 1.0 + CALLBACK_NEEDS_WHITELIST = True + + def __init__(self): + super(CallbackModule, self).__init__() + + def set_options(self, task_keys=None, var_options=None, direct=None): + super(CallbackModule, self).set_options(task_keys=task_keys, + var_options=var_options, + direct=direct) + + self.file_name = self.get_option('file_name') + + def v2_on_any(self, *args, **kwargs): + path = os.path.join(os.path.dirname(__file__), self.file_name) + self._display.display("Touching file: {}".format(path)) + with open(path, 'w'): + pass diff --git a/tests/fixtures/config/ansible-callbacks/git/common-config/zuul.yaml b/tests/fixtures/config/ansible-callbacks/git/common-config/zuul.yaml new file mode 100644 index 000000000..4acf6efb8 --- /dev/null +++ b/tests/fixtures/config/ansible-callbacks/git/common-config/zuul.yaml @@ -0,0 +1,21 @@ +- pipeline: + name: promote + manager: supercedent + post-review: true + trigger: + gerrit: + - event: change-merged + +- job: + name: callback-test + parent: null + run: playbooks/callback.yaml + nodeset: + nodes: + - name: ubuntu-xenial + label: ubuntu-xenial + +- project: + promote: + jobs: + - callback-test diff --git a/tests/fixtures/config/ansible-callbacks/main.yaml b/tests/fixtures/config/ansible-callbacks/main.yaml new file mode 100644 index 000000000..9d01f542f --- /dev/null +++ b/tests/fixtures/config/ansible-callbacks/main.yaml @@ -0,0 +1,6 @@ +- tenant: + name: tenant-one + source: + gerrit: + config-projects: + - common-config |