Debian Codegraph @

hacking/README.md

raw
1 'Hacking' directory tools
2 =========================
3
4 env-setup
5 ---------
6
7 The 'env-setup' script modifies your environment to allow you to run
8 ansible from a git checkout using a supported Python version.
9
10 First, set up your environment to run from the checkout:
11
12 ```shell
13 source ./hacking/env-setup
14 ```
15
16 You will need some basic prerequisites installed. If you do not already have them
17 and do not wish to install them from your operating system package manager, you
18 can install them from pip
19
20 ```shell
21 python -Im ensurepip # if pip is not already available
22 pip install -r requirements.txt
23 ```
24
25 From there, follow ansible instructions on docs.ansible.com as normal.
26
27 test-module.py
28 --------------
29
30 'test-module.py' is a simple program that allows module developers (or testers) to run
31 a module outside of the ansible program, locally, on the current machine.
32
33 Example:
34
35 ```shell
36 ./hacking/test-module.py -m lib/ansible/modules/command.py -a "echo hi"
37 ```
38
39 This is a good way to insert a breakpoint into a module, for instance.
40
41 For more complex arguments such as the following yaml:
42
43 ```yaml
44 parent:
45 child:
46 - item: first
47 val: foo
48 - item: second
49 val: boo
50 ```
51
52 Use:
53
54 ```shell
55 ./hacking/test-module.py -m module \
56 -a '{"parent": {"child": [{"item": "first", "val": "foo"}, {"item": "second", "val": "bar"}]}}'
57 ```
58
59 return_skeleton_generator.py
60 ----------------------------
61
62 return_skeleton_generator.py helps in generating the RETURNS section of a module. It takes
63 JSON output of a module provided either as a file argument or via stdin.