Commit Graph

397 Commits (1d640182c61af2d59cc1005f1ab5b217a56dcf15)

Author SHA1 Message Date
Adrian Likins cf39a1abab test-module _ansible_selinux_special_fs arg added
modules need to have _ansible_selinux_special_fs passed in
as an arg, so add the default to the args.
8 years ago
Brian Coca 72e6ffad47 added script to unify repos
in case i forget how to do this, can be deleted afterwards
8 years ago
cinerama70 db276373e5 gen_distribution_version_testcase.py should fail if ansible run fails (#17693)
Currently, "ansible localhost -m setup" can fail silently during the
run of gen_distribution_version_testcase.py, resulting in incorrect
output. Use check_output() rather than communicate() and handle
the exception if we get a nonzero return value.
8 years ago
cinerama70 02cec7dca9 Add os_family to test_distribution_version (#17620)
As suggested in feedback on
https://github.com/ansible/ansible/pull/17575, add
os_family to test_distribution_version. Add the
correct os_family to the existing testcase data
entries.

Also add os_family to the output of
gen_distribution_version_testcase.py so any new
generated entries will contain this data.
8 years ago
Toshio Kuratomi 4ed88512e4 Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because
of licensing.  So once created it we had two sets of functions that did
the same things but had different implementations.  To remedy that, this
change removes the ansible.utils.unicode versions of those functions.
8 years ago
Michael Scherer 619f3d13ef Add detection of python3 to hacking/env-setup (#17357)
People can still override the detection using PYTHON_BIN
8 years ago
scottb 235eab6609 Merge pull request #16316 from alikins/alikins_docsite_make
Fewer deps for 'make webdocs' from top level
8 years ago
Josh Smift 81d7e132f9 force deletion of .pyc files (#17109) 8 years ago
Matt Davis 525c0469d2 tweak hacking/env-setup to work under ash (#17054) 8 years ago
Toshio Kuratomi 48a2773463 Find places where ziploader is used and change them to ansiballz so that people aren't confused when they google for information.information (#16715) 8 years ago
Adrian Likins a1c21f8400 Fewer deps for 'make webdocs' from top level
Previously it also built the MANPAGES target
requiring asciidoc and libxml, before starting
a 'make docs' in docsite.

Also change the #! line in
hacking/dump_playbook_attributes.py to not specify
python2... yet.
8 years ago
André Pinto fa4011c6c3 Do not corrupt $MANPATH when it's not present (#16300)
Fixes #16299
8 years ago
Matt Davis ec2cb07988 Make 'required' optional in module docs (#15906)
Updated module dev docs, doc build, ansible-doc to match
8 years ago
Brian Coca 71a707fba5 quick yaml syntax checker 8 years ago
Brian Coca 478674cc57 typo fix 8 years ago
Brian Coca b7c874f81a enforce required 'required' in docs 8 years ago
Robin Roth 1d6608e84f Dist version fix for Red Hat and more tests (#15663)
* add tests for centos6, rhel6 and rhel7

* gen_distribution_version_testcase with python2.6

* remove unused imports

* fix redhat/vmware/... parsing

* add centos7 test case
8 years ago
Brett Inman 1f89a46b52 Make -q flag totally quiet for env-setup.fish
The first echo and setup.py steps are not quiet and result in output that is annoying if your Fish is configured to source the file.
8 years ago
Toshio Kuratomi 2762f12f7f Remove the duplicate modstyle parameter 8 years ago
Toshio Kuratomi bdd73e31dc Have test-module clean up the local temp dir when it exits
Get test-module's debugger switch to do something useful with ziploader modules
8 years ago
Toshio Kuratomi 7833b5bec4 Merge pull request #15420 from robinro/distribution_version_tests
Distribution version tests
8 years ago
Robin Roth 692bf51fde move gen_testcase to hacking/tests
* also use json instead of pprint
8 years ago
Toshio Kuratomi 669f3dc3a8 Cleanup. Since we no longer pass a lock, we no longer need to create it 8 years ago
Toshio Kuratomi d78ba34cf0 We switched away from passing the lock via the arguments to modify_module
Need to fix test-module to not pass the lock either
8 years ago
Toshio Kuratomi dcc5dfdf81 Controller-side module caching.
This makes our recursive, ast.parse performance measures as fast as
pre-ziploader baseline.

Since this unittest isn't testing that the returned module data is
correct we don't need to worry about os.rename not having any module
data.  Should devise a separate test for the module and caching code
8 years ago
Toshio Kuratomi b27c424fa1 Fixes to the documentation build (#15356)
* Could only have one alias before.  Subsequent aliases overrode the
  previous ones.  Now multiple aliases work.
* Fix BLACKLISTED_MODULES.   Previously, modules were listed in the
  generated documentation despite being blacklisted
* Deprecated modules form extras were showing the (E) tag and not the
  (D) tag. Reversed that now (Probably not necessary to also show the
  E tag).
* Sort the deprecated modules alphabetically in the Category docs as
  well as the list of all modules
* Optimization: Previously rendered the modules to rst twice once in all
  group and once in individual categories.  Fixed to only render them
  once.
* Add fireball to blacklist and remove async_status (as people need to
  use that).
8 years ago
Toshio Kuratomi a330a24ccc Python2.6 fix for test-module 8 years ago
Toshio Kuratomi 4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

* python3 compatible base64 encoding
* zipfile compression (still need to enable toggling this off for
  systems without zlib support in python)
* Allow non-wildcard imports (still need to make this recusrsive so that
  we can have module_utils code that imports other module_utils code.)
* Better tracebacks: module filename is kept and module_utils directory
  is kept so that tracebacks show the real filenames that the errors
  appear in.

* Make sure we import modules that are used into the module_utils files that they are used in.

* Set ansible version in a more pythonic way for ziploader than we were doing in module replacer

* Make it possible to set the module compression as an inventory var

This may be necessary on systems where python has been compiled without
zlib compression.

* Refactoring of module_common code:

* module replacer only replaces values that make sense for that type of
  file (example: don't attempt to replace python imports if we're in
  a powershell module).
* Implement configurable shebang support for ziploader wrapper
* Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG)
  via environment variable.
* Remove strip_comments param as we're never going to use it (ruins line
  numbering)

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

* Port test-module to the ziploader-aware modify_module()

* strip comments and blank lines from the wrapper so we send less over the wire.

* Comments cleanup

* Remember to output write the module line itself in powershell modules

* for line in lines strips the newlines so we have to add them back in
8 years ago
Brian Coca 6a85da7e0c avoid private attributes
hardcode adding with_ for tasks
8 years ago
Brian Coca e1faa78722 fixed typo 8 years ago
Brian Coca cbc797a7ed added missing : 8 years ago
Brian Coca a3489408a5 fixes to playbooks_directives generation
order is now predictable
now correctly substitutes loop for with_
adds local_action to action
8 years ago
Brian Coca 3e28ee0fd4 avoid printing internal loop and loop_args 8 years ago
Brian Coca fbdcb22e36 now generate list of playbook ojbect directives
TODO: needs links/info and conditionals added
8 years ago
Brian Coca fe09f7ee49 clarify that requirements are on host that runs it
fixes http://github.com/ansible/ansible-modules-core/issues/3061
8 years ago
Brian Coca 6414c967e4 now check for description and listify if needed
fixes #14371
9 years ago
Toshio Kuratomi 5cd3f71792 Handle utf-8 in module short desc 9 years ago
Jeremy Audet 5cac8efd73 Make "make webdocs" compatible with Python 3
The `webdocs` make target fails under Python 3. It fails due to a variety of
syntax errors, such as the use of `except Foo, e` and `print 'foo'`. Fix #13463
by making code compatible with both Python 2 and 3.
9 years ago
Patrik Lundin 9f9944e355 Replace -delete with portable -exec rm {} \;
Needed on OpenBSD which does not support -delete.
9 years ago
Alberto Gireud 52ded67db5 Update check mode argument 9 years ago
Brian Coca 4a206cdde9 force egg deletion 9 years ago
Brian Coca 5719912e7f added a skip for the test dir in module repos 9 years ago
Toshio Kuratomi 4203850d1a Break apart a looped dependency to show a warning when parsing playbooks
Display a warning when a dict key is overwritten by pyyaml
Fixes #12888
9 years ago
Toshio Kuratomi baa309309d Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 9 years ago
Brian Coca 3a0bf55ae3 better error catching for doc build 9 years ago
James Cammarata a431121f9f Tweak to hacking path fix to go back to subshell use 9 years ago
EC bcdb4e78ae Allow env-setup to use spaces in full path 9 years ago
Marius Gedminas 823677b490 Replace .iteritems() with six.iteritems()
Replace .iteritems() with six.iteritems() everywhere except in
module_utils (because there's no 'six' on the remote host).  And except
in lib/ansible/galaxy/data/metadata_template.j2, because I'm not sure
six is available there.
9 years ago
Luke Rohde cba4642d8d Use find ... -delete instead of non-portable globbing 9 years ago
Luke Rohde 647e48f776 Delete all compiled python files when running hacking/env-setup 9 years ago
Kevin Houdebert b8c9391d0c Change to python3 syntax 9 years ago
Jody Frankowski bc1e1d2cdc Fix rm call in hacking/env-setup. Since it is sourced from a user shell,
rm can have an alias to 'rm -i', which will make sourcing hang when '-q'
is enabled.
9 years ago
Abhijit Menon-Sen 114070c226 Add missing $ 9 years ago
Brian Coca 636f88fd31 Merge pull request #9438 from binarytemple/patch-1
export ANSIBLE_HOME so it can be used in scripts
9 years ago
Toshio Kuratomi 53ae326603 Port some things in test-module to v2.
In particular, fix arg parsing

Fixes #11820
9 years ago
Brian Coca f5c8055879 removed debug stuff 9 years ago
Brian Coca a78fdde32c better handling for weird doc corner cases (abscense of options, bad text objects, etc)
also updated extras to get some docfixes on the module side
9 years ago
bryan hunt 7a76fcb159 merged 9 years ago
Sheldon Hearn c800a1c68a Preserve OLDPWD 9 years ago
Brian Coca ae54792a35 Merge pull request #11688 from amenonsen/8935-rebase
8935 rebase: add «-o outputfile» and -n(oexec) options to hacking/test-module
9 years ago
Brian Coca d3fe9b3194 Merge pull request #11084 from echiu64/devel
More complex example of using test-module
9 years ago
Abhijit Menon-Sen 8342cc6b61 Fix existing typo, remove trailing space added by PR commit 9 years ago
Will Thames b05485d4b3 Add options to control output and execution of test-module
test-module is useful but sometimes you want to edit the
result before running it to e.g. set a debug point.

Added a noexecute option (i.e. just create the module script, don't
run it) and an output option to choose the filename of the result.
9 years ago
Brian Coca c40541964b Merge pull request #11637 from bcoca/moar_docs
Moar docs
9 years ago
Brian Coca 740f15cb0d just remove version_added when to old, not the whole option! 9 years ago
Brian Coca 9de086d16d removed merges from count 9 years ago
Brian Coca 173f27531c moar docs
added docs for new v2 features
restructures modules bar and core/extras info into their own pages
changed templates to refer to the new pages
added some missing ansible.cfg options
more info on gathering setting
9 years ago
Brian Coca 6ba706f753 minor doc reformatting
now version_added < 1.3 does not get shown, up from 1.0
option's version_added is also now filterd against this threshold
module version_added is more prominent
exaples now uses pure rst instead of intermingled with html formatting
aliases now shown in description for options
bad version fields now throw warnings instead of exceptions
ansible-doc errors now show traceback in very very verbose mode, for easier debugging
9 years ago
Brian Coca 811b10d132 docs will not mention versions older than 1.5 9 years ago
Brian Coca 1aeb66148b actually now does what it says as it was just sorting by name 9 years ago
Gerard Lynch 2f51f3bbc5 updated to use new loader 9 years ago
Brian Coca 95bf78d0e7 Merge pull request #11618 from halberom/test-module
hacking/test-module, updated to new location and non-classness of module_common
9 years ago
Gerard Lynch 3c7a502c50 updated to new location and non-classness of module_common 9 years ago
Brian Coca f146c7680f Merge pull request #10928 from gimoh/test-module-default-python
Use same interpreter for test-module and module it runs
9 years ago
Marc Abramowitz 3b0524e67d hacking/test-module: Style nit 9 years ago
Marc Abramowitz 5466ff8907 hacking/test-module: Deal with move of parse_kv 9 years ago
Marc Abramowitz ea6ec3bf2c Make test-module work in v2
- `jsonify` moved from `ansible.utils` to `ansible.parsing.utils.jsonify`
- I don't see `ansible.utils.parse_json` anymore so I used `json.loads`.
9 years ago
Brian Coca 0826106441 minor docs reformat
- clearer 'version added' for module options, now it sits under the option name
- made notes a section, so it now appears in toc
- moved requirements and made it a list, more prominent and more readable
9 years ago
James Cammarata 2bad888f28 Merge branch 'v2_final' into devel_switch_v2
Conflicts:
	lib/ansible/inventory/__init__.py
	lib/ansible/modules/core
	lib/ansible/utils/__init__.py
	lib/ansible/utils/module_docs.py
9 years ago
Edwin Chiu aef76cc701 More complex example of using test-module 9 years ago
Florian Apolloner 3010190592 Fixing up the hacking module_formatter code for v2 9 years ago
Michael Scherer 85aa984340 Fix error in the column name in the doc 9 years ago
gimoh 5489d172de Use same interpreter for test-module and module it runs
Default python interpreter to the same interpreter the test-module
script is executed with.  This is so that the interpreter doesn't have
to be specified twice in the command when using non-default python
(e.g. ``/path/to/python ./hacking/test-module -I python=/path/to/python ...``)
9 years ago
Toshio Kuratomi 4c8d27f7bb Make module formatting into links to the other module docs 9 years ago
Matt Martz 104b2036f7 egg_info is now written directly to lib 9 years ago
Brian Coca b6ec502983 added missing element to make google groups link a actual link 9 years ago
Ján Dzurek cf6155f1c2 rst.j2 template better core module source wording 9 years ago
Brian Coca c3076b8478 added module returnval documentation to web docs 9 years ago
Brian Coca 2cacac4b23 minor adjustments to formatting 9 years ago
Brian Coca 94909bd4a2 Added return values documentation to modules 9 years ago
Toshio Kuratomi caf2a96ef9 Merge pdksh fix to v2 9 years ago
Patrik Lundin 731b268cd6 env-setup: Don't use ${.sh.file} if shell is pdksh
The default ksh in OpenBSD throws the following error:
===
$ . hacking/env-setup
ksh: hacking/env-setup[23]: ${.sh.file}": bad substitution
[...]
===

The same error can be seen on Linux if pdksh is used.
9 years ago
bmoar 1eaa9d4a08 fix path in Test-module example 9 years ago
Brian Coca 68a06e542d Merge pull request #9666 from follower/patch-8
Correct typo of "actively" (Attempt #2)
9 years ago
Brian Coca ee08448b2e now module_formatter handles new expanded return values from the module_docs (still does not thing with new return value docs) 10 years ago
Alexey Shamrin b950a38e30 fix links to ansible-devel in documentation pages 10 years ago
Toshio Kuratomi 7c86db3187 Add KSH compat
cherry picked from https://github.com/ansible/ansible/pull/6899
10 years ago
ZhiFeng Hu e63c03d60f Move update.sh to hacking repository ,see #10081 10 years ago
rpe-github 0a73067153 Use basename -- $0 in case $0 starts with a dash.
For example, pdksh $0 contains '-ksh'.
10 years ago
Marco Ippolito 23da2f6415 Redundant file descriptor specifier 10 years ago
Marco Ippolito 4cd5be396d BUG! Incorrect order of redirection AND incorrect redirection syntax
The replaced code only created a text file called `1' in the
current directory, it did *not* redirect output.
10 years ago
Marco Ippolito bc0f0f838e More elegant output using here-document syntax
POSIX section 2.7.4 defines here-documents.
10 years ago
Marco Ippolito 7eb278e797 Identified two verbosity levels: info, silent
Conflicts:
	hacking/env-setup
10 years ago
Marco Ippolito 9bc1e1a4a0 Reserve capitalised identifiers for system variables
Conflicts:
	hacking/env-setup
10 years ago
Marco Ippolito 53fadd371b No need to prepend `.' to a relative path 10 years ago
Toshio Kuratomi 566a8d1b9d Fix issue with mixing quoting and glo9bbing. 10 years ago
Toshio Kuratomi 365af69c3e More quotes and reimplement without pushd/popd 10 years ago
Toshio Kuratomi dde32a826f Set default values for shell variables that we use
Fixes #9991
10 years ago
Toshio Kuratomi 09e556e9a4 Get rid of bash compound command to make more portable 10 years ago
Toshio Kuratomi 245f934629 Remove shebang and execute perms for env-setup since it must be sourced 10 years ago
Marco Ippolito b688570380 Corrected quoting of parameter expansions in hacking/env-setup
Conflicts:
	hacking/env-setup
10 years ago
Marco Ippolito b8921706f8 Prefer modern-style Bash command substitution in hacking/env-setup
Conflicts:
	hacking/env-setup
10 years ago
Marco Ippolito 31c8523371 Updated shebang from #!/bin/bash to #!/usr/bin/env bash (more flexible) 10 years ago
Brian Coca 88443d6dcf Merge pull request #7306 from abadger/feature/egg-info
Feature/egg info
10 years ago
Veres Lajos bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 10 years ago
follower 8b278fee51 Correct typo of "actively" (Attempt #2) 10 years ago
follower a1c5294882 Fix misspelled "necessarily" 10 years ago
Brian Coca 339d1ccc8b fixed issue with subclasses across the repos clobbering each other, they
now merge
10 years ago
Brian Coca 2ba5c3c66b added blank line before section to avoid sphinx warnings 10 years ago
Michael DeHaan c551fe8b50 Clarify module list footer. 10 years ago
Brian Coca 12393a4b47 subcategories are now Title case and _ gets changed to a space 10 years ago
Brian Coca 5f1ad79cd3 now correctly flags and sorts subcategory modules 10 years ago
Brian Coca 650048f7dd now displays subcategories correctly 10 years ago
Brian Coca 7bd2c945a7 now doc generation does not ignore subdirs of cloud 10 years ago
Brian Coca 80b1365d53 now correctly processes modules when in subdirs of cloud 10 years ago
Brian Coca f6d9aa7a8f corrected text/flag 10 years ago
Brian Coca 023f5fd7e0 Added note explaning the module tagging 10 years ago
Brian Coca 44f0279d0a Now adds flags for non core and deprecated modules in listing 10 years ago
Brian Coca 86de59235f bypass core/extras text when module is deprecated 10 years ago
Brian Coca 8b5b97d066 now docs handle deprecated modules but still ignore aliases 10 years ago
Brian Coca 27d741102c Created Deprecated module category that only appears when there is
something to show
10 years ago
Bryan Hunt e5f651c458 export ANSIBLE_HOME so it can be used in scripts
In order that scripts like this can work 
```
#!/bin/bash
ansible -vvvv tag_instance_type_foo-training -i "${ANSIBLE_HOME}/plugins/inventory/ec2.py" --private-key=~/Downloads/foo-training.pem -u ec2-user -m ping
```
10 years ago
Brian Coca 5ab4467708 module formatter skips modules with leading underscore to avoid
documenting them. Soon will be patched to recognize them as either
deprecated or an alias
10 years ago
Toshio Kuratomi 1e12d3028c Merge pull request #9384 from insaneirish/devel
Change "usuable" to "usable".
10 years ago
insaneirish 3d257bc695 Change "usuable" to "usable". 10 years ago
Igor Vuk e19f3f8a5c Typo: greatful -> grateful 10 years ago
Baptiste Mathus 2845f0c455 Typo: recieve -> receive. 10 years ago
Michael DeHaan 2211ae113c Update rst.j2
typo fix
10 years ago
Martin Ueding dc750e6526 Fix link in reST template
There was a missing trailing underscore (`_`) that would have marked the
content in the backticks as a link. This adds it and fixes the link on
every core module page.
10 years ago
Michael DeHaan ffee9a8fe0 Docsite formatting 10 years ago
Michael DeHaan 7f6ab89b5b hacking/env-setup no longer needs to set library since modules appear as git submodules. 10 years ago
Michael DeHaan e8fe306cef Some various comments about the new repos, more to likely come. 10 years ago
Michael DeHaan bceb0026a5 Updating the module formatter to deal with the new repo structure. 10 years ago
Michael DeHaan b818fbb305 Modules are almost always written now by mutliple authors, so don't show this field on website, since it grows obsolete and does not take into account all contributors.
Contributors are still listed on github module source and in repo, and original authors still in the file for when development questions arise, but want
to funnel support questions to the mailing list versus directly to them.
10 years ago
Michael Salmon e827ec702e Fix issue #8578. Setting envvar in ""'s ensures the PYTHONPATH is set to
include the lib/ directory.

Before - PYTHONPATH is empty.. ansible fails to run

    $ source hacking/env-setup.fish
    Appending PYTHONPATH

    Setting up Ansible to run out of checkout...

    PATH=/Volumes/opt/src/ansible/bin /usr/local/share/python3 /usr/local/bin
    /usr/bin /bin /usr/sbin /sbin /usr/local/bin /opt/X11/bin /usr/bin /sbin
    /usr/local/bin /Users/ms/bin/
    PYTHONPATH=
    ANSIBLE_LIBRARY=/Volumes/opt/src/ansible/library
    ...

    Traceback (most recent call last):
      File "/Volumes/opt/src/ansible/bin/ansible", line 25, in <module>
          from ansible.runner import Runner
          ImportError: No module named ansible.runner

After change - it's set.. ansible runs.

    source hacking/env-setup.fish
    Appending PYTHONPATH

    Setting up Ansible to run out of checkout...

    PATH=/Volumes/opt/src/ansible/bin /usr/local/share/python3 /usr/local/bin
    /usr/bin /bin /usr/sbin /sbin /usr/local/bin /opt/X11/bin /usr/bin /sbin
    /usr/local/bin /Users/ms/bin/
    PYTHONPATH=/Volumes/opt/src/ansible/lib:
    ANSIBLE_LIBRARY=/Volumes/opt/src/ansible/library
    ....

    $ ansible
    Usage: ansible <host-pattern> [options]
10 years ago
Hector Acosta b8cbf1370f Add checkmode support for test-module script
Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
10 years ago
Michael DeHaan dfd4f18095 Docsite things. 10 years ago
Toshio Kuratomi 6a6060ac55 Teach env-setup how to create egg-info for ansible so that pkg_resources works 10 years ago
Felix Kaiser 3b06ab84e3 Make test-module interpret --args='{...' as yaml 10 years ago
Max Riveiro 9f7342d46d
Add tesing deps installation into hacking/README
Signed-off-by: Max Riveiro <kavu13@gmail.com>
10 years ago