Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/supervisorctl/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Install/Uninstall supervisorctl block
12 environment:
13 PATH: "{{ pip_scripts_path }}"
14 block:
15 - tempfile:
16 state: directory
17 suffix: supervisorctl-tests
18 register: supervisord_sock_path
19
20 - command: 'echo {{ remote_tmp_dir }}'
21 register: echo
22 - set_fact:
23 remote_dir: '{{ echo.stdout }}'
24
25 - include_vars: '{{ item }}'
26 with_first_found:
27 - files:
28 - '{{ ansible_facts.distribution }}.yml'
29 - '{{ ansible_facts.os_family }}.yml'
30 - 'defaults.yml'
31
32 - include_tasks: '{{ item }}'
33 with_first_found:
34 - files:
35 - 'install_{{ ansible_facts.distribution }}.yml' # CentOS
36 - 'install_{{ ansible_facts.os_family }}.yml' # RedHat
37 - 'install_{{ ansible_facts.system }}.yml' # Linux
38
39 - include_tasks: test.yml
40 with_items:
41 - { username: '', password: '' }
42 - { username: 'testétest', password: 'passéword' } # non-ASCII credentials
43 loop_control:
44 loop_var: credentials
45
46 always:
47 - include_tasks: '{{ item }}'
48 with_first_found:
49 - files:
50 - 'uninstall_{{ ansible_facts.distribution }}.yml' # CentOS
51 - 'uninstall_{{ ansible_facts.os_family }}.yml' # RedHat
52 - 'uninstall_{{ ansible_facts.system }}.yml' # Linux
53
54 - file:
55 path: '{{ supervisord_sock_path.path }}'
56 state: absent