Compare commits

...

2704 Commits
0.7 ... v1.1

Author SHA1 Message Date
2f944d87f6 Merge pull request #2547 from jsmartin/cloudformation
Typo in cloudformation module documentation.
2013-04-01 14:01:51 -07:00
319b69075a Typo in documentation. 2013-04-01 15:15:40 -04:00
f5b9e4deec Merge pull request #2543 from b6d/postgresql_user-docfix
postgresql_user: fix docstrings
2013-04-01 05:58:01 -07:00
8456cb8e52 postgresql_user: fix docstrings
Change documentation of "state" param to refer to user (role) state instead of
database state.

Change 2 function docstrings to reflect the code
2013-04-01 13:56:37 +02:00
1ad61b3e19 Merge pull request #2541 from lorin/apt-upgrade
Use aptitude safe-upgrade for apt upgrade=yes
2013-03-31 19:20:11 -07:00
9289db18b4 upgrade should obey check mode 2013-03-31 21:48:08 -04:00
614642f8e9 Use aptitude safe-upgrade for apt upgrade=yes
Use aptitude safe-upgrade instead of apt-get upgrade to implement
apt: upgrade=yes. Using aptitude ensures that missing dependencies
will also be installed.

Fixes #2540
2013-03-31 21:41:58 -04:00
304c447bd2 Merge pull request #2530 from mavimo/patch-1
Vagrant module - fixed version_added
2013-03-31 07:43:23 -07:00
a325741ab0 Merge pull request #2531 from Afterburn/devel
Suppressed output and updated documentation
2013-03-31 07:42:58 -07:00
4b2a26c4c9 Merge pull request #2533 from mavimo/documentation-version_added
Double quoted version_added in documentation
2013-03-31 07:34:24 -07:00
207439ef6c Merge pull request #2534 from victorcoder/devel
Examples must use "name" parameter instead of "guest" for virt module, b...
2013-03-31 07:33:50 -07:00
fe34bebbbb Merge pull request #2535 from mavimo/documentation-description-formatting
Chnge description as list inside string
2013-03-31 07:33:24 -07:00
00a94024f4 Chnge description as list inside string 2013-03-30 20:53:28 +01:00
199da48504 Examples must use "name" parameter instead of "guest" for virt module, both works though but code explicitly expects name as the guest VM identifier. 2013-03-30 20:52:56 +01:00
cafc12c680 Double quoted version_added in documentation 2013-03-30 20:44:34 +01:00
6d5852529b Suppressed output and updated documentation 2013-03-30 11:57:53 -06:00
2f318b604c Fixed error in version_added
SSIA
2013-03-30 14:01:53 +01:00
36bcfb5d49 Merge branch 'lineinfile' of git://github.com/Tinche/ansible into lif 2013-03-29 21:39:57 -04:00
f9890c9973 Show other way to ignore command/shell errors 2013-03-29 21:38:33 -04:00
bccab0f2b7 Merge pull request #2514 from raphinou/patch-1
replaced && by ||
2013-03-29 18:36:53 -07:00
d994c9fd90 Merge pull request #2527 from mavimo/patch-1
Docs generator: fixed option (type) validation error
2013-03-29 18:36:15 -07:00
a53259a797 Fixed option validation error
Fixed error on validation that block javascript documentation generation.
2013-03-29 16:30:33 +01:00
befad8f71f Merge pull request #2442 from lwade/vol_os_detection
add better OS detection for BDM
2013-03-29 05:48:05 -07:00
cdf5e006ff Merge pull request #2508 from tgerla/devel
Add some examples for local_action and rsync
2013-03-29 05:46:40 -07:00
50bd8a82fa Merge pull request #2507 from inittab/devel
Install example config file under /etc/ansible
2013-03-29 05:46:09 -07:00
1015d3b043 Merge pull request #2522 from abulimov/lvg-module-doc
fixed and extended documentation for lvg module
2013-03-29 05:44:01 -07:00
853d4f43cb Merge pull request #2524 from victorcoder/devel
Place ad-hoc stuff from docs under context
2013-03-29 05:43:35 -07:00
ceede2f71f Place ad-hoc stuff from docs under context 2013-03-28 16:39:06 +01:00
0fee59dc86 fixed and extended documentation for lvg module 2013-03-28 13:55:01 +04:00
ba2582fff6 replaced && by ||
In the example, you want /bin/true to be executed if the first command has an error return code. Combining command with && will run the second only if the first is successful. Combining them with ||, the second will be run only of the first fails, what is wanted here.
2013-03-27 14:37:31 +01:00
d3a7c729ab Add a note regarding rsync and ssh-agent/passphrase-less keys 2013-03-26 19:37:06 -07:00
4552fa8592 Merge pull request #2511 from bcoca/user_checkmode_fix
user module check mode bug fix
2013-03-26 19:31:02 -07:00
5ad3c0603d now check moded returnes 'changed' instead of failure when there are
modifications needed.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-26 22:04:04 -04:00
tin
ca581840ef Added additional lineinfile documentation.
A little more unit testing.
2013-03-27 01:31:58 +01:00
tin
f9b70822d2 Fixed to the lineinfile module.
Added the backrefs parameter to the lineinfile module.
Added tests for the backrefs functionality of the lineinfile module.
2013-03-27 01:31:58 +01:00
868af1a892 Merge pull request #2505 from johanwiren/obsdpkg_docs
Fixed webdocs rendering error
2013-03-26 16:31:38 -07:00
0e01085ab6 Add some examples for local_action and rsync 2013-03-26 13:34:16 -07:00
40451b8f68 Install example config file under /etc/ansible 2013-03-26 20:25:03 +01:00
550cf2979e Fixed webdocs rendering error 2013-03-26 18:22:15 +01:00
9c5028eb8b Merge pull request #2501 from sergevanginderachter/devel
gitignore and clean up authors file to  since it was removed from version control
2013-03-26 05:53:28 -07:00
7d08ad5e82 Merge pull request #2502 from b6d/gem-module-fix
"gem"-module: replace python 2.5 language feature
2013-03-26 05:53:05 -07:00
fd6b4c2257 "gem"-module: replace python 2.5 language feature
replace conditional expression with python 2.4-compatible if/else
statements
2013-03-26 11:45:47 +01:00
ec6236a107 add clean up authors file to make clean 2013-03-26 08:19:45 +01:00
0aba811cf2 add authors file to gitignore since it was removed from version control 2013-03-26 08:14:07 +01:00
b066e9c15c Remove authors file from version control (can still be built from 'make authors') 2013-03-25 23:36:53 -04:00
42b0e51223 Upgrade callbacks further, now '.play', '.task', and so on are also available! 2013-03-25 22:56:32 -04:00
5b845510b3 Update changelog 2013-03-25 22:48:12 -04:00
0d11f53eff Let the callbacks see the playbook and (current) runner objects. 2013-03-25 22:47:06 -04:00
b0a64973b6 update changelog 2013-03-25 22:40:47 -04:00
2d8078140d Merge branch 'test_basedir' into devel 2013-03-25 22:32:45 -04:00
84b641c96d Add state to rhn_channel docs 2013-03-25 22:32:34 -04:00
783a12cc0e Resolve merge commit. 2013-03-25 22:32:01 -04:00
6f2a0c60f7 Merge branch 'ansible_inventory_basedir' of git://github.com/stoned/ansible into test_basedir
Conflicts:
	lib/ansible/runner/__init__.py
2013-03-25 22:30:06 -04:00
28570f922e Merge pull request #2498 from jcftang/devel
Fix reinplace in macports package to work on both 10.7 and 10.8
2013-03-25 19:26:19 -07:00
774bf8abe6 Add state to rhn_channel docs 2013-03-25 22:24:30 -04:00
3c5890f42b Ensure that when transferring a file to a directory the name of the file is the correct basename and not 'source'. 2013-03-25 22:19:35 -04:00
7044e53e07 Allow conditionals on BYPASS_HOST_LOOP plugins like add_host 2013-03-25 21:16:18 -04:00
2dce6089c4 Fix reinplace in macports package to work on both 10.7 and 10.8
reinplace on OSX 10.8 seems to behave differently, this change has been tested
on a few 10.8 and 10.7 machines.
2013-03-25 17:08:40 +00:00
cd0dd2a6ad Merge pull request #2496 from lorin/mycnf-quotes
Strip quotes when parsing my.cnf
2013-03-25 08:15:58 -07:00
fee201428f Fix RHN module YAML docs formatting 2013-03-25 11:03:38 -04:00
861bee3e36 Quoting 2013-03-25 10:56:57 -04:00
518007a1ba Fix version added attribute, update docs URL 2013-03-25 10:56:32 -04:00
c9990b801e Strip quotes when parsing my.cnf
Remove leading/trailing single or double quotes when parsing the my.cnf
file in mysql_user and mysql_db.

Do this so that these modules parse the my.cnf file the same way that
the mysql client does.

From: http://dev.mysql.com/doc/refman/5.0/en/option-files.html

    You can optionally enclose the value within single quotation marks
    or double quotation marks, which is useful if the value contains a
    “#” comment character.

Fixes #2405
2013-03-25 09:53:04 -04:00
9be44c201a Merge pull request #2455 from robparrott/debuggin-help
inject a dictionary of avaiable variables and the environment into executor
2013-03-24 14:49:37 -07:00
fe2f506514 Merge pull request #2462 from sfromm/issue2461
Make logging to journal match what goes to syslog on non-systemd hosts
2013-03-24 14:46:10 -07:00
7f4718bca4 Merge pull request #2490 from szinck/devel
Added SunOS (Solaris, illumos, etc) service management
2013-03-24 14:45:07 -07:00
4f4ee3693f Merge pull request #2440 from jochu/service-chkconfig-add
attempt to add service to chkconfig when suggested
2013-03-24 14:33:17 -07:00
97d2c955a8 Merge pull request #2437 from hspencer77/additional-ec2-instance-attribute-support
Added additional filter options for instances for EC2 and Eucalyptus
2013-03-24 14:31:50 -07:00
3d5aa5dc2c Merge pull request #2487 from dorfsmay/20130322
fixed doc regarding wild card pattern on groups.
2013-03-24 14:26:07 -07:00
c163f5af9e Minor consistency tweak, pwd => password 2013-03-24 16:43:03 -04:00
ecda87cb63 Fixup docsite links 2013-03-24 16:41:20 -04:00
e086d6fd89 Doc updates 2013-03-24 16:41:20 -04:00
b68f81a727 Merge pull request #2489 from vincentvdk/devel
rhn_channel module
2013-03-24 13:36:02 -07:00
b5f3881e01 Merge pull request #2491 from tones111/to-upstream
Support systemd template service unit files
2013-03-24 13:35:36 -07:00
8a6ef8c69a service: fix typo 'err' in SunOS service class 2013-03-24 13:47:56 -05:00
81a113ad6b Removed false info 2013-03-24 19:45:39 +01:00
255f2b868f Removed info about hard coded user/pwd in the documentation part 2013-03-24 09:16:58 +01:00
b545b4c5fc service: add systemd template support 2013-03-23 23:13:51 -05:00
4cfda2a965 service: fix systemd compilation error with --check 2013-03-23 23:07:18 -05:00
98406462d1 Made user and password options that can be passed to the module 2013-03-23 22:04:48 +01:00
60bfd38820 Added SunOS (Solaris, illumos, etc) service management using svcadm and svcs commands 2013-03-23 16:02:54 -05:00
38c41b6f9e renamed module 2013-03-23 16:33:14 +01:00
3a626032ae added rhn_channel module 2013-03-23 16:32:10 +01:00
1388bb7859 Added module rhn_channel 2013-03-23 16:30:02 +01:00
5485451ddb fix doc regarding wild card pattern on groups. 2013-03-22 23:05:40 -06:00
934029842e Merge pull request #2485 from jochu/bug-postgresql-quotes
Add quotes around postgresql database name
2013-03-22 13:15:53 -07:00
18b6091da1 Add quotes around postgresql database name 2013-03-22 13:03:11 -07:00
bff581be4c Merge pull request #2482 from bladypirat/devel
disabled appending file with garbage when regexp didn't match.
2013-03-22 05:55:36 -07:00
2e4c02f93e disabled appending file with garbage when regexp didn't match. 2013-03-22 11:43:44 +01:00
50461a686c Merge pull request #2481 from stoned/misc-comments-fix
Fix pathnames in comments
2013-03-21 21:10:42 -07:00
86995d7786 Fix pathnames in comments 2013-03-22 02:11:58 +01:00
b70c26dc45 Merge pull request #2466 from sfromm/issue2449
Limit scope of arguments to service_control() in service module
2013-03-20 19:07:16 -07:00
5c1b436923 Merge pull request #2451 from lwade/pythoninterpreter
Changed python interpreter to be consistent in these modules as compared...
2013-03-20 18:58:28 -07:00
cef817c3b4 Merge pull request #2458 from CodeBlock/devel
Fix broken virtualenv link in pip documentation.
2013-03-20 18:57:29 -07:00
fce18d50ed Merge pull request #2468 from tgerla/devel
Add links to the ansible-examples repository in docs
2013-03-20 18:56:59 -07:00
8d85b27ac9 Merge pull request #2472 from sfromm/issue2471
Fixes for get_remote_head in git module
2013-03-20 18:56:20 -07:00
b694b9a66e Fixes for get_remote_head in git module
See issue #2471

This fixes get_remote_head() to be smarter about how to check remote
head.  It checks if it is a remote branch or tag and then checks for the
remote object id associated with it.  If it is sha1, get_remote_head()
returns it as-is since there doesn't appear to be a way to check a
remote repository for a specific object/sha1.  is_remote_tag() is added
to help out the new functionalit in get_remote_head().

In main(), if check_mode is true and version is a sha1, the module now
checks to see if the object is present.
2013-03-20 14:28:06 -07:00
242f988daf Add links to the ansible-examples repository 2013-03-20 09:45:41 -07:00
5194a71a70 Limit scope of arguments to service_control() in service module
This fixes handling of arguments (module argument) in service_control().
It is now locally scoped such that modifications to it, in the case of a
systemd host, do not later impact subsequent calls to service_control().
See issue #2449.

Without patch:
ansible-service[6177]: Command /usr/bin/systemctl stop cups cups , daemonize True

With patch:
ansible-service[6475]: Command /usr/bin/systemctl start cups , daemonize True

I also updated the comments to reflect the case where systemd is really
being called.
2013-03-20 08:50:36 -07:00
abe126fbd8 Define, when possible, the inventory_dir variable 2013-03-20 00:41:01 +01:00
cdb7f8ecf0 Make logging to journal match what goes to syslog on non-systemd hosts
This makes the log message the same, whether it is sent to systemd's
journal or to syslog.  It retains the extra fields that are passed to
journal, such as MOUDLE=<name> and additional arguments.  Since journal
will reflect messages to syslog, this keeps what goes to syslog
informative instead of the terse 'Ansible module invoked'.

See issue #2461.
2013-03-19 16:07:15 -07:00
9af40aa99a Fix broken virtualenv link in pip documentation. 2013-03-19 14:12:54 -04:00
92997ec789 Merge pull request #2457 from robparrott/add_host-inventory-group-fix
invalidate group cache when adding a new group
2013-03-19 11:03:13 -07:00
149f1f9f3c invalidate group cache so that a group added by the add_host module will be relfected in the groups variable in later plays. 2013-03-19 13:57:45 -04:00
81e2d871aa inject a dictionary of avaiable variables and the environment into the executor, so that templates can be used to debug playbooks by dumping more of the available context. 2013-03-19 13:04:57 -04:00
9dda148679 Changed python interpreter to be consistent in these modules as compared to all others. 2013-03-19 16:07:36 +00:00
2baece3a03 Merge pull request #2447 from dorfsmay/20130318-ansible-doc
Mention of ansible-doc and man pages for modules.
2013-03-18 21:13:49 -07:00
8b10cc5946 Mention of ansible-doc and man pages for modules. 2013-03-18 20:31:42 -06:00
a8de66facc adding windows-specific ebs recommendation 2013-03-18 17:02:39 +00:00
a4a1545640 Merge pull request #2439 from jochu/service-chkconfig-fail
fail when service cannot be found by chkconfig
2013-03-18 07:58:17 -07:00
e2805e5a06 add better OS detection for BDM 2013-03-18 12:00:52 +00:00
f1829a0f86 attempt to add service to chkconfig when suggested 2013-03-18 01:17:41 -07:00
efc98a09fe fail when service cannot be found by chkconfig 2013-03-18 01:12:28 -07:00
2e797a5155 Merge pull request #2432 from ciupicri/devel-unicode
module_formatter.return_data: use UTF-8 encoding
2013-03-17 18:50:53 -07:00
7ab876f19f Added additional filter options for instances for EC2 and Eucalyptus 2013-03-17 15:51:41 -05:00
29aaa5e693 module_formatter.return_data: use UTF-8 encoding
The text parameter can contain non-ASCII characters, so we'll encode it
using UTF-8. For example the DOCUMENTATION of the bzr module has such
characters in the name of the author.
2013-03-17 19:55:56 +02:00
9bd586acdb Fix bzr module documentation, name is the primary attribute. 2013-03-17 11:53:27 -04:00
1a5ac9d149 Name should be the primary attribute for the 'parent' in the bzr module. 2013-03-17 11:52:48 -04:00
61c1616fe5 Fix version_added attribute on the bzr module 2013-03-17 11:51:34 -04:00
22cd10bc6f Add note about wanting to do crypted passwords with $PASSWORD plugin. 2013-03-17 11:48:27 -04:00
afb9ad1358 Fix duplicate Sphinx target in documentation. 2013-03-17 11:46:25 -04:00
64a3839511 Fixup documentation formatting 2013-03-17 11:45:22 -04:00
a3dec0fe2b Update changelog since last merge. 2013-03-17 11:39:57 -04:00
ce39c18b14 Fixup template documentation so webdocs can generate. 2013-03-17 11:24:32 -04:00
79c22f4f03 Merge pull request #2370 from andreparames/bzr-module
New Bazaar module
2013-03-17 08:21:02 -07:00
13c44ace95 Merge pull request #2421 from robparrott/ec2-idempotency
Make ec2 module idempotent with Amazon EC2 via client-token attribute.
2013-03-17 08:19:15 -07:00
600b0bc5f1 Merge pull request #2357 from abulimov/lvg-module
lvg module for managing LVM volume groups
2013-03-17 08:06:04 -07:00
d7a2ac2c57 Merge pull request #2401 from sfromm/git-check-mode
Add check mode to git module
2013-03-17 07:33:30 -07:00
921cdaec48 Merge pull request #2402 from dparalen/ec2_inventory_hostname_check
check hostname presence
2013-03-17 07:32:58 -07:00
6b566cfc1e Merge pull request #2404 from lorin/mysql-mycnf-user
.my.cnf: default to login when no user specified
2013-03-17 07:32:14 -07:00
79efc04bdf Merge pull request #2406 from lorin/mysql-socket-doc
Document mysql_(user,db) login_unix_socket option
2013-03-17 07:31:49 -07:00
ff4f9f217b Merge pull request #2407 from jcftang/setup-osx-facts
Added osrelease and osversion as well as changed the way sysctl is calle...
2013-03-17 07:31:34 -07:00
917c11ebd7 Merge pull request #2355 from jcftang/macports
Teach the macports module to activate/deactivate packages
2013-03-17 07:29:43 -07:00
4ee08aafa3 Merge pull request #2356 from abulimov/lvol-patch
lvol patch for Debian Squeeze
2013-03-17 07:28:54 -07:00
11d3bd4025 Merge pull request #2375 from sergevanginderachter/user-non-unique
Add nonunique option to user module, translating to the -o/--non-unique ...
2013-03-17 07:22:06 -07:00
61e2ed8402 Merge pull request #2387 from bcoca/template_overrides_note
added docs about in template overrides
2013-03-17 07:20:54 -07:00
5346cbb4a0 Merge pull request #2412 from davehughes/task-expand-sudo-user
Added variable expansion to task sudo_user parameter
2013-03-17 07:11:41 -07:00
d4f7b45395 Merge pull request #2418 from davehughes/pip-fix-run-directory
pip module - run from the system's temp directory to avoid permissions problem
2013-03-17 07:04:03 -07:00
4dcddcbbec Merge pull request #2427 from andrew-d/andrew-add-homebrew
Add Homebrew module
2013-03-17 07:02:42 -07:00
7be78d503c Merge pull request #2430 from b6d/nagios-module-icingacfg
nagios module: add common locactions of icinga.cfg
2013-03-17 07:02:13 -07:00
3ee53a2760 Merge pull request #2429 from b6d/nagios-module-fix
"nagios" module: fix NameError/'host' not defined
2013-03-17 07:01:34 -07:00
138bfece39 Merge pull request #2424 from lwade/simples3
Basic groundwork for s3 module.
2013-03-17 07:01:12 -07:00
565db8cd40 Merge pull request #2420 from robparrott/vagrant
added vagrant module with cleanup
2013-03-17 06:59:24 -07:00
3821e8dd7c Merge pull request #2428 from ciupicri/devel-rpm
RPM packaging: check properly if using RHEL5 or older
2013-03-17 06:29:13 -07:00
2e60692082 nagios module: add common locactions of icinga.cfg
Icinga should be compatible to Nagios (in our case the nagios module works well
with our Icinga installation)
2013-03-17 11:47:07 +01:00
aa7ea10826 "nagios" module: fix NameError/'host' not defined
Add missing 'host' variable, which is read a few lines later on in some cases.
2013-03-17 11:31:13 +01:00
4d84a35872 RPM packaging: check properly if using RHEL5 or older 2013-03-17 05:55:06 +02:00
b4347b08a2 Add Homebrew module 2013-03-16 21:52:51 -04:00
6988ccf940 Merge pull request #2422 from jochu/patch-1
Use environment python in nova.py
2013-03-16 18:50:49 -07:00
6a3345093f Merge pull request #2426 from lorin/dev-checkmode
Document how to implement check mode
2013-03-16 18:50:24 -07:00
efd3cbe8b4 Document how to implement check mode
Fixes #2410
2013-03-16 21:45:22 -04:00
b1dfefc113 Merge pull request #2425 from bfx81/patch-1
Updated getting ansible on gentoo
2013-03-16 17:56:07 -07:00
649dc25d46 Updated getting ansible on gentoo 2013-03-16 15:21:04 +01:00
5d1c9c7363 Merge pull request #2423 from andrew-d/andrew-fix-rubygems
Fix --include-dependencies parameter on RubyGems >= 2.0.0
2013-03-16 06:26:00 -07:00
1748bc2a5b Basic groundwork for s3 module. 2013-03-16 11:18:43 +00:00
e63d008ae8 Fix --include-dependencies parameter on RubyGems >= 2.0.0 2013-03-16 06:01:02 -04:00
fb39c89bd2 Use environment python in nova.py 2013-03-15 22:29:16 -07:00
096d4dece4 modified ec2 module to use EC2 idempotency via client-token attribute. 2013-03-15 22:55:01 -04:00
416f25eaff added vagrant module 2013-03-15 22:51:21 -04:00
94eefac456 Merge pull request #2391 from bcoca/apt_lock_exception
now catches lock exceptions from apt and returns friendly message
2013-03-15 18:07:52 -07:00
7d6d009d15 Merge pull request #2411 from tyll/docs
glossary.rst: fix type regarding file mode
2013-03-15 18:07:28 -07:00
6b769c2218 Merge pull request #2413 from lorin/ANSIBLE_LIBRARY_DOC
Docfix: ANSIBLE_LIBRARY_PATH -> ANSIBLE_LIBRARY
2013-03-15 18:07:02 -07:00
dd79d66dba Run pip command from the system's temp directory 2013-03-15 15:05:21 -07:00
c7cf2bc343 Docfix: ANSIBLE_LIBRARY_PATH -> ANSIBLE_LIBRARY 2013-03-15 14:55:53 -04:00
2b4621d8d7 glossary.rst: fix typo regarding file mode 2013-03-15 19:43:47 +01:00
c365974117 Added variable expansion to task sudo_user parameter 2013-03-15 11:31:27 -07:00
935514cde8 Added osrelease and osversion as well as changed the way sysctl is called on OSX 2013-03-15 15:58:45 +00:00
1de91d2181 Document mysql_(user,db) login_unix_socket option
mysql_user and mysql_db both take a login_unix_socket option.

This patch adds docs that describe how to use it.
2013-03-15 11:43:32 -04:00
6fd5770dfd .my.cnf: default to login when no user specified
When using a .my.cnf file, when there is no user variable defined,
default to the login user.

This change has the mysql_user module behavior match the behavior
of the mysql command-line client.

Also adds an example .my.cnf to the docs.
2013-03-15 11:05:30 -04:00
27b8d3567e check hostname presence 2013-03-15 10:15:41 +01:00
73772a41e6 Add check mode to git module
Related to issue #2114.  This hooks in check_mode to git module.  This
will exit with changed=True at the following places:

* If the repo has not been cloned
* If the destination has local modifications, this will exit with
  changed=True.  This is because reset() will exit anyways if there are
  local mods and force is False.
* If the remote HEAD commit id is not the same as that of the local HEAD.
  This is determined by get_remote_head() that runs 'git ls-remote' to
  determine remote HEAD.

Lastly, if this is run with check_mode enabled, this will exit with
changed=False before fetch() is invoked so that no local mods are made.
2013-03-14 22:29:04 -07:00
cb2b7a4e17 rename user option nonunique tot non_unique 2013-03-14 17:21:57 +01:00
f980ec37bb Add nonunique option to user module, translating to the -o/--non-unique option to useradd and usermod. 2013-03-14 17:21:57 +01:00
fc8d9377d5 Merge pull request #2396 from johanwiren/obsd_facts
Added OpenBSD facts
2013-03-14 08:26:05 -07:00
e3e649a963 Merge pull request #2393 from davehughes/pip-expand-virtualenv-path
pip module - expand user home directory variables in virtualenv parameter
2013-03-14 08:25:13 -07:00
6f25885c1a Merge pull request #2397 from dparalen/play_task_type_check
check type of task explicitly
2013-03-14 08:24:41 -07:00
c260690f7a Merge pull request #2395 from dhozac/arg-override-common
Don't override argument specs with FILE_COMMON_ARGUMENTS
2013-03-14 08:23:51 -07:00
80dbab3cf0 check type of task explicitly 2013-03-14 13:06:55 +01:00
61256a7e83 Added OpenBSD facts 2013-03-14 13:04:49 +01:00
fc227fbd37 Restore force in copy since arguments are no longer clobbered
Fixes #2388.
2013-03-14 11:27:49 +01:00
27978ed9c1 Don't override argument specs with FILE_COMMON_ARGUMENTS
Doing so will remove aliases, types, etc, leading to #2388 and other
issues.
2013-03-14 11:22:46 +01:00
902d6347c7 now using 'type=' for module parameters, replaced lambda with list comprehensions, simplyfied extend/reduce part of module, renamed dev parameter to pvs 2013-03-14 13:32:16 +04:00
32bf6050c7 Teach the macports module to activate/deactivate packages
Deactivating a package from macports does not remove the files, it
just unstages it from the runtime environment. Activating a package
re-enables it.
2013-03-14 08:14:57 +00:00
08100bd798 Expand any user home variable in pip module's virtualenv parameter 2013-03-13 20:58:04 -07:00
d0332a6c6d Merge branch 'playbook-step' of git://github.com/skvidal/ansible into devel 2013-03-13 22:26:59 -04:00
b87e7c0f19 Let the pip module return output. 2013-03-13 22:25:58 -04:00
4f9c61d673 now actually import exception to be usable 2013-03-13 18:21:16 -04:00
4a2276bb4b now catches lock exceptoins on apt and returns friendly message instead of
traceback

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-13 18:11:23 -04:00
3313667dcf added docs about in template overrides
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-03-13 15:58:08 -04:00
f46721add1 Temporarily disable force logic on copy module 2013-03-13 13:35:33 -04:00
4bfe707c9d Merge pull request #2384 from bcoca/fixed_port
updated ports to use ansible.cc/releases as github doesn't work anymore
2013-03-13 07:42:33 -07:00
49fe9b2030 updated ports to use ansible.cc/releases as github doesn't work anymore
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-03-13 10:27:20 -04:00
0c80c76833 Fixes #2380 - argument checking in file accepts chained arguments from copy 2013-03-12 21:57:38 -04:00
e307658350 Merge pull request #2376 from peterjanes/devel
Use login_host for import and dump operations
2013-03-12 12:40:34 -07:00
2d07bb671c Merge pull request #2377 from dorfsmay/20130312-typo
20130312 typo
2013-03-12 12:39:39 -07:00
91b3dc73cc Merge pull request #2378 from eest/service_bsd_check
Dont exit in FreeBSD/NetBSD subclass in check mode
2013-03-12 12:39:13 -07:00
88a840e52f Dont exit in FreeBSD/NetBSD subclass in check mode
* As the FIXMEs note: only exit if enable state is going to change.
* This is already handled in service_enable_rcconf() being called by both subclasses.
2013-03-12 20:25:25 +01:00
2d0df2f233 Rephrased an awkward sentence. 2013-03-12 10:25:44 -06:00
d1d7d56315 typo in playbooks2.rst 2013-03-12 10:21:57 -06:00
f6f7d3559d Use login_host for import and dump operations 2013-03-12 12:07:16 -04:00
0c00dcca34 Merge pull request #2373 from dagwieers/doc-boolean
Fix the documentation booleans so they use "yes" and "no"
2013-03-12 06:28:23 -07:00
50b7964f8e Fix the documentation booleans so they use "yes" and "no"
Both modules seboolean and zfs have not been adapted since they defer from the default (either by having a 'null' or special state, or prefering "on"/"off" for state indication.
2013-03-12 13:25:59 +01:00
c8c0fe945b various fixes in lvg module, added ability to reduce and extend VG, added Physical Extent parameter, added explicit creation of physical volumes 2013-03-12 14:06:39 +04:00
77198b09e9 Add content to the list of file common arguments. 2013-03-12 01:06:55 -04:00
57d193556c Merge pull request #2371 from stoned/list-replacement-type-fix
exception safe list/tuple replacing for non-str values
2013-03-11 21:56:49 -07:00
8edda38c61 exception safe list/tuple replacing for non-str values 2013-03-12 05:01:45 +01:00
df9e716208 Fix example 2013-03-11 23:37:29 -04:00
264d83c0a3 Added Bazaar module, based on the Git module 2013-03-11 23:13:17 +00:00
444c8943fc Merge pull request #2369 from leucos/arch-pkgbuild-fix
Fixes Arch building file
2013-03-11 15:27:09 -07:00
e241bb5801 Merge pull request #2367 from bcoca/catch_mismatched_json
now cleanly catches traceback when conflicting versions of simplejson and python are installed
2013-03-11 15:26:01 -07:00
b19e199b13 Merge pull request #2362 from jcftang/packaging-el5
Teach 'make rpm' to work on EL5 based systems
2013-03-11 15:20:55 -07:00
04b19062d3 Fixes arch building file
Arch python binary patch was broken since improvement in 785068d. This
change fixes patch, removing most of the lines thanks to the new PYTHON
variable.
New source file already uploaded on AUR.
2013-03-11 23:19:27 +01:00
a22009806e Nested iteration would make more sense in this order. 2013-03-11 17:58:27 -04:00
0dbfa02f0c Example of how to do nested loops. 15 minutes of code :) 2013-03-11 17:49:01 -04:00
edc04d61f3 Added 'with_nested' lookup plugin that can easily do nested loops. 2013-03-11 17:47:57 -04:00
298d64aa1d Quote remote md5 operations. Fixes #2368 2013-03-11 17:19:43 -04:00
e304cc3d8e Simple fix for spaces in filenames with the template module. 2013-03-11 17:13:59 -04:00
6e2ea327d1 A very simple fix to enable spaces in the files sent via the copy module. 2013-03-11 17:11:53 -04:00
95a977cfc9 now cleanly catches traceback that occurs when running newer simplejson with
older python interpreter.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-11 15:10:49 -04:00
40ca1d4b3e Teach 'make rpm' to build on RHEL5/SL5 etc... 2013-03-11 15:37:03 +00:00
8c6caa2762 Fix up other places in makefile to use PYTHON variable
Only the nosetests aren't using the PYTHON variable now.
2013-03-11 15:31:07 +00:00
a7a083d882 when --step isn't specified make sure to print the banner 2013-03-11 09:48:32 -04:00
259d994253 lvg module for managing LVM volume groups 2013-03-11 13:17:36 +04:00
a3b4488028 lvol patch for Debian Squeeze 2013-03-11 12:20:01 +04:00
7687c2caf8 add --step option to ansible-playbooks to let people step through a playbook
one by one - asking for confirmation along the way.

also allows to 'continue' after a certain point
2013-03-11 00:39:05 -04:00
1289dd602d Changelog update 2013-03-18 00:50:00 -04:00
bdb231213d Add type casting to user/group modules, remove executable bit from other modules 2013-03-18 00:40:57 -04:00
03db6ef24a Slightly more self-explanatory output for ./hacking/env-setup 2013-03-18 00:27:44 -04:00
2962073bcf Merge branch 'fix-module-encoding' of git://github.com/andreparames/ansible into devel 2013-03-18 00:17:07 -04:00
4eaca08664 Merge pull request #2353 from skottler/setup_clarification
Use verbose 'source' to make the document easier to read
2013-03-10 20:13:23 -07:00
86d420f481 Use verbose 'source' to make the document easier to read 2013-03-10 23:00:48 -04:00
5c7aa08ed5 Merge pull request #2316 from dominis/devel
Citrix NetScaler module
2013-03-10 17:17:08 -07:00
8c212ac9b6 Merge pull request #2272 from skvidal/nagios_cmd
add (un)silence_nagios and command actions to the nagios module
2013-03-10 17:16:21 -07:00
3d8bb6c2e0 Merge branch 'alpine' of git://github.com/fabaff/ansible into devel
Conflicts:
	library/setup
2013-03-17 23:39:33 -04:00
ba51fc12f9 Updated copy documentation. 2013-03-17 23:35:15 -04:00
f2c8df2a93 Clarify an error message 2013-03-17 23:33:13 -04:00
c7c7a63ee5 Add support to directly set content in copy module 2013-03-17 23:33:13 -04:00
4da04b2176 Merge pull request #2294 from mmoya/bug-fixes
file module should check invalid arguments (fixes #2135)
2013-03-10 16:32:02 -07:00
c53653dc0d Merge pull request #2348 from candeira/password-plugin
password lookup plugin, with working tests and documentation
2013-03-10 16:31:17 -07:00
daf7419f3a Make Python 3 instructions a bit more clear. 2013-03-17 23:26:57 -04:00
ed1d9f1235 Merge pull request #2345 from leucos/patch-2
Update gettingstarted.rst
2013-03-10 16:20:22 -07:00
2d575ddd09 Update fetch documentation 2013-03-17 23:17:56 -04:00
c3e625e6f0 Make URI module default to 30 seconds. 2013-03-17 23:16:45 -04:00
b2c8ed9cc2 Merge pull request #2279 from dorfsmay/fetch-fail_on_missing
Added a fail_on_missing option to fetch.
2013-03-10 16:18:28 -07:00
fd038d373a Merge pull request #2273 from dorfsmay/pullreq-use_proxy
Added a use_proxy option to get_url.
2013-03-10 16:10:45 -07:00
aae88baf4a Merge pull request #2260 from skvidal/path_lookup
first_found lookup_plugin - replaces first_available_file
2013-03-10 16:09:49 -07:00
bb696e88b4 Merge pull request #2286 from gavares/url_timeout
Add socket timeout to uri module.
2013-03-10 15:37:32 -07:00
c7d780a09a Merge pull request #2337 from dparalen/wait_fix
EC2 Wait fix
2013-03-10 15:28:34 -07:00
033c7d9df2 Merge pull request #2274 from jcftang/setup-osx-facts
Start of more OSX facts for setup
2013-03-10 15:26:41 -07:00
80cd277d97 Merge pull request #2334 from pieska/upstream
allow use of backrefs in lineinfile
2013-03-10 15:25:25 -07:00
9069ad1f42 Merge pull request #2283 from eest/openbsd_pkg
Add openbsd_pkg: package management for OpenBSD.
2013-03-10 15:21:13 -07:00
e5f5d354cf Merge pull request #2278 from jcftang/devel
Teach makefile to accept different versions of python
2013-03-10 15:20:38 -07:00
ca6c36e1ac password lookup plugin, with working tests and documentation 2013-03-10 13:36:53 +11:00
9bb8435ec9 Fixes #2346 2013-03-09 03:27:45 +00:00
9c6b28c218 Update gettingstarted.rst
Adds note on python 3 incompatibility
Added note about ansible_python_interpreter for people having python3 as default interpreter (mainly Arch users ?)
Should fix #2344
2013-03-08 23:09:28 +01:00
6259091449 fixed case and punctuation 2013-03-08 10:12:15 +01:00
9932c9ff11 fix documentation 2013-03-08 10:12:15 +01:00
d32d899161 waiting enhancements 2013-03-08 10:12:15 +01:00
78d1e2483a avoid the instance start--state-fetch race 2013-03-08 10:12:15 +01:00
c4aa72f1fd Merge pull request #2340 from niksite/devel
Fixed 'service'. Now it respect 'enabled=no' as well.
2013-03-07 21:11:25 -08:00
03c0b8dcb2 Fixed 'service'. Now it respect 'enabled=no' as well. 2013-03-08 12:07:54 +07:00
84ee05a3c0 allow use of backrefs in lineinfile 2013-03-07 20:46:52 +01:00
a5e4947d6f Support for detecting Alpine Linux 2013-03-07 20:06:05 +01:00
2120580f7a netscaler module example playbook 2013-03-07 16:14:19 +01:00
76f3351b02 Move complex_args templating to be with module_args
Keeps every action plugin from having to do the same thing.
2013-03-07 11:09:29 +01:00
ffbd4b5a2c Template options sooner on complex args copy 2013-03-07 00:35:40 -05:00
2bb305f6d5 Fix args templating for complex args with the copy module. 2013-03-07 00:28:06 -05:00
9763ae8e21 Merge pull request #2319 from sfromm/svn-check
Update subversion module to work better with check mode
2013-03-06 21:16:35 -08:00
bd600c1cbc Merge pull request #2323 from laixer/devel
Respect gem_source option if specified
2013-03-06 21:16:03 -08:00
969edabdbb Merge pull request #2322 from bcoca/remote_tmp_override
added check for starting $HOME for remote_tmp so as to non root sudo override
2013-03-06 21:07:49 -08:00
9980cfcc60 Merge pull request #2318 from sfromm/issue2317
Consider service stopped if rc is 1
2013-03-06 21:07:24 -08:00
44e44cf295 Merge pull request #2320 from jkleckner/minor-spelling-fixes
Minor spelling fixes
2013-03-06 21:06:33 -08:00
fe8547cac0 Ensure template arguments if complex are still properly templated 2013-03-07 00:04:48 -05:00
b9a3cc551e Respect gem_source option if specified 2013-03-06 16:58:57 -08:00
76f709286e added check for starting $HOME for remote_tmp so as to non root sudo override
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-03-06 17:32:12 -05:00
92844d3dcd Minor spelling fixes 2013-03-06 10:41:19 -08:00
bd64641400 Update subversion module to work better with check mode
Adds needs_update() method which will inspect the checkout for the
current revision and then the HEAD.  If the local check out is behind
HEAD, this will report changed=True and supply the revision numbers.
2013-03-06 10:23:35 -08:00
6e35392f92 Consider service stopped if rc is 1
Per LSB spec, consider service stopped if rc from 'service status' is 1.
Added comment with url to LSB spec reference.
2013-03-06 10:18:34 -08:00
74ced2d80c netscaler module initial commit 2013-03-06 15:32:01 +01:00
ca16a91da1 Merge pull request #2313 from mmoya/fix-copyright
Fix chroot.py copyright
2013-03-05 18:38:09 -08:00
e898f30f78 Fix copyright 2013-03-06 02:40:34 +01:00
b11cf15b3e Merge pull request #2302 from leucos/patch-1
Update playbooks2.rst
2013-03-05 17:14:47 -08:00
0b1343a281 Merge pull request #2306 from tbielawa/docdepends
Update the Makefile and build-site.py to notify of missing dependencies
2013-03-05 17:14:02 -08:00
ce9b5e8227 Merge pull request #2309 from r-p-e/devel
fix ansible-playbook manpges regarding option for syntax check
2013-03-05 16:06:30 -08:00
1f1eb4125f align manpages with actual code for --syntax-check 2013-03-06 00:42:53 +01:00
3d49f74df6 Make apt upgrade=dist work and make its argument handling more idiomatic
Fixes #2287.
2013-03-05 23:46:34 +01:00
67e16eebbb Merge pull request #2308 from asad-at-srt/patch-1
Update mysql_db
2013-03-05 14:45:18 -08:00
e581bbcafc Update mysql_db
The target parameter is not required, the DOCUMENTATION section was in error.
2013-03-05 17:11:12 -05:00
7ad13d04fb Merge pull request #2299 from dagwieers/rpm-docsite-fix
Allow 'make rpm' without the need for env-setup
2013-03-05 13:21:28 -08:00
a225058457 Merge pull request #2298 from junegunn/get_url-force
get_url: should always download the file when force is set
2013-03-05 12:50:33 -08:00
5ec40b17e7 Merge pull request #2304 from skvidal/devel
add docs to mount module using LABEL and UUID
2013-03-05 12:47:51 -08:00
baeb1bce11 Fix example crypt to include trailing $
Fixes #2305.
2013-03-05 21:39:28 +01:00
badb41390e Update the Makefile and build-site.py to notify of missing dependencies for doc compiling 2013-03-05 13:59:39 -05:00
2f2a02cb49 add docs to mount module using LABEL and UUID 2013-03-05 12:13:36 -05:00
aeed04b73f Cosmetic fixes
Fixed typo in passlib URL link
Fixed style in cryp scheme list
Fixed bullet 7 in variable precedence section
Adds statement regarding passlib requirement
2013-03-05 17:28:09 +01:00
f3b06a3008 Adds crypt scheme list for vars_prompt
Added more details on encrypt usage for vars_prompt, including a list of
crypt schemes and a ling to the passlib documentation.
2013-03-05 17:19:14 +01:00
d03954a24b Update playbooks2.rst
Added doc on encrypt capability of vars_prompt.
Assuming the example in https://github.com/ansible/ansible/blob/devel/examples/playbooks/prompts.yml is still valid.
2013-03-05 16:26:24 +01:00
e2c1b34dbb Remove webdocs from docs
No reason to build the website for RPMs/DEBs, adding dependency on
Sphinx.
2013-03-05 13:05:00 +01:00
51d7c120e1 Merge pull request #2300 from johanwiren/gemdocs
Corrected formatting in docs for the gem-module
2013-03-05 03:59:43 -08:00
e53826b088 Corrected formatting in docs for the gem-module 2013-03-05 12:28:04 +01:00
59912b47be Allow 'make rpm' without the need for env-setup
As it used to be before, 'make rpm' from a cloned repository should work without the need to run hacking/env-setup. It's an easy fix, in line with what we already did for the man-pages.
2013-03-05 11:12:00 +01:00
7f556d8939 should always download when force is set 2013-03-05 11:39:50 +09:00
ee7f8d018e file module should check invalid arguments (fixes #2135) 2013-03-04 12:55:18 +01:00
1784fd80cc When a host list is used, no parser is present 2013-03-04 12:37:15 +01:00
cd51c7f234 Add socket timeout to uri module.
The uri module can be configured to abort after a specified timeout if
it cannot connect to the configured uri. This prevents a uri action from
hanging indefinitely when the remote endpoint cannot be reached because
it is unavailable, there is a firewall in place etc. The default behavior
is left unchanged: timeout=None

This change also introduces a new type for module_parameters: int
Code was added to perform conversion from string -> int type in
module_common.py.

The new type was required in order to play nice with httplib2 which
refuses to accept (and convert) anything other than a numeric type for
the timeout value.
2013-03-02 17:34:23 -08:00
f485eb28f5 Teach setup about OpenBSD package manager.
* We cannot depend on the path because FreeBSD for example uses the same path.
2013-03-03 00:02:50 +01:00
eb6398f168 Add openbsd_pkg: package management for OpenBSD.
* Code influenced by the service module but without classes.
* Thanks to @dhozac for input and review.
* Thanks to @johanwiren for getting me to push this out the door.
2013-03-03 00:01:02 +01:00
b130716b61 YAML requires quoting the entire value when it starts with a quote
Fixes #2280.
2013-03-02 21:35:51 +01:00
c9a201eb43 fixed typos 2013-03-02 12:12:25 -07:00
377351f6fd Clarified that proxy can be changed via an variable. 2013-03-02 11:42:49 -07:00
e45a0fd61d Added a fail_on_missing option to fetch. 2013-03-02 11:04:48 -07:00
de09e9dade Update doc reference to clarify that $item isn't expanded here. 2013-03-02 11:47:43 -05:00
6ad390a92b Revert "Revert "for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups""
This reverts commit dc0515a88a.

We didn't need to revert this :)
2013-03-02 10:38:51 -05:00
5d82b4b1b7 group_by needs the untemplated module_args 2013-03-02 16:30:30 +01:00
dc0515a88a Revert "for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups"
This reverts commit 2d86671aa5.
2013-03-02 10:21:36 -05:00
785068df63 Teach makefile to accept different versions of python
This commit makes the Makefile nicer for packagers so they can select versions
of python. E.g. on a RHEL5 system with Python2.6 (installed from EPEL)

	make PYTHON=python2.6 install
2013-03-02 14:38:02 +00:00
43ce2caa4f Fix parse_kv invocation in group_by to use imported name
Fixes #2277.
2013-03-02 15:18:16 +01:00
622b8dfe32 Merge pull request #2271 from MWGriffin/patch-1
Update get_url
2013-03-02 01:40:31 -08:00
2ff2f05a0f host.get_variables includes too many variables, use host.vars instead
Not quite as attractive, but allows variable precedence and lazy
resolution to work as intended, rather than resolving them on a
per-inventory basis.
2013-03-02 10:26:26 +01:00
8f917a5a9f slurp: import base64 as module_common no longer does 2013-03-02 10:26:09 +01:00
7653c4ac6c Start of more OSX facts for setup
Added a Darwin family, commit acc1c004 had added some network facts
but weren't being shown as the Darwin family wasn't in use. This commit
reveals these facts.

A Darwin(Hardware) class has also been created ready to be populated with
hardware facts.
2013-03-02 08:13:38 +00:00
3270a0adcd Added a use_proxy option to get_url. 2013-03-02 00:30:28 -07:00
5bfd648dc8 Update get_url
Small syntactic correction: Removed trailing double-quote from example.
2013-03-01 22:49:00 -08:00
677dcc56ae add (un)silence_nagios and command actions to the nagios module
also fix a typo with the check_mode check
2013-03-02 01:48:39 -05:00
6d41983173 Update changelog to include recent modifications. 2013-03-02 00:01:43 -05:00
6ecdef6b88 Type checking on library/apt means the upgrade parameter is now properly True/False 2013-03-01 23:34:27 -05:00
38bd17af22 Restore authors file 2013-03-01 21:41:42 -05:00
0b4ad2749a Increase error handling in the unlikely case of failing to establish a connection. 2013-03-01 21:39:50 -05:00
4132f8953e Fixup the rabbitmq YAML documentation so we can generate docs for it. 2013-03-01 19:47:43 -05:00
5fd807ac64 Merge pull request #2262 from bcoca/json_nice_error
now ansible shows nice message about missing json instead of traceback
2013-03-01 16:39:45 -08:00
125015eaa5 Merge pull request #2263 from bcoca/moduledev_noremove
Added tip about ANSIBLE_KEEP_REMOTE_FILES to docsite
2013-03-01 16:39:20 -08:00
372b60a5f7 Added tip about ANSIBLE_KEEP_REMOTE_FILES to docsite
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-01 19:13:37 -05:00
46c913f7a6 now ansible shows nice message about missing json instead of traceback
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-01 19:03:59 -05:00
7ac5e462ef Fixed a small buglet, if using with_items with yum and so on, only optimize the package list if the package list is all strings 2013-03-01 18:32:32 -05:00
129e0b8baf Log tracebacks to syslog when using fireball mode. 2013-03-01 18:24:48 -05:00
804b130288 check if the term is a dict so we can take a simple list of files (like first_available_file) takes 2013-03-01 18:18:56 -05:00
b6f7a22de5 Merge pull request #2261 from bcoca/groupby_2186
now group by module invalidates host cached variables
2013-03-01 15:16:47 -08:00
2d86671aa5 for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-03-01 18:00:34 -05:00
f9824838c3 Merge pull request #2251 from chrishoffman/rabbitmq
Rabbitmq parameters module
2013-03-01 14:58:39 -08:00
6ebf16bf33 Some very minor stylistic tweaks to the gem module. 2013-03-01 17:55:13 -05:00
64c1cc3efd Merge branch 'gem' of git://github.com/johanwiren/ansible into devel 2013-03-01 17:46:12 -05:00
839dff8eae Disable filter test for now since it should really be testing at a lower level. 2013-03-01 17:42:14 -05:00
9cf5306610 Merge branch 'directory-inventory' of git://github.com/dhozac/ansible into devel 2013-03-01 17:39:15 -05:00
66a596dd5d fix MySQL user doc formatting issue 2013-03-01 17:38:14 -05:00
ff58623f8b Fix apt module documentation formatting. 2013-03-01 17:38:14 -05:00
d04c4ef0c7 Merge pull request #2249 from jcftang/devel
Use opkg module as basis for macports module
2013-03-01 14:37:32 -08:00
2994ec022d Merge pull request #2242 from jmandel/devel
Allow relative creates/removes path with `chdir`
2013-03-01 14:35:42 -08:00
1f8805d9e0 Add some tests for directory-based inventory 2013-03-01 23:34:14 +01:00
dfad94078b first_found lookup_plugin - replaces first_available_file
- useful in tasks/playbook inclusion
- task-specific inclusion

allows searching paths and files
2013-03-01 17:25:25 -05:00
f1eb195ff5 vars_loader should get the path to the inventory + vars_plugins 2013-03-01 23:22:52 +01:00
ad08995989 Make inventory basedir for directory based inventory be the directory
This puts host_vars and group_vars inside of the directory, allowing you
to target a single inventory but still have access to the variables.
2013-03-01 23:22:52 +01:00
d9c6b60b24 Allow inventory to be a directory containing other inventories 2013-03-01 23:22:52 +01:00
647cd0141c Move all inventory script code into the script parser 2013-03-01 23:22:52 +01:00
7749b34546 Merge branch 'new_branch_for_apt_squashed' of git://github.com/RaymiiOrg/ansible-1 into devel
Conflicts:
	library/apt
2013-03-01 17:13:42 -05:00
a19a0ca91b Update documentation on complex args to new simpler format. 2013-03-01 17:08:36 -05:00
fb26f059c5 Merge pull request #2232 from dhozac/module-args-dict
Allow specifying args directly to actions using module: syntax
2013-03-01 14:03:23 -08:00
26826c3bde Merge pull request #2235 from marktheunissen/mysql-idempotent-explanation
Add mysql user documentation about idempotent playbooks
2013-03-01 13:45:55 -08:00
e83819599a Merge pull request #2234 from akvadrako/nice-yaml-and-json
add to_nice_yaml|json filters
2013-03-01 13:45:07 -08:00
38ab9b50c7 Merge branch 'setup_network2' of git://github.com/nigelm/ansible into devel 2013-03-01 16:25:25 -05:00
c92bfb7234 Merge branch 'madcow2' of git://github.com/bcoca/ansible into devel 2013-03-01 16:23:41 -05:00
ff32e404d5 Most people are better off doing looping inside the playbook versus
outside, and get confused about scope.  As a result simply this documentation
feature by not talking about it :)
2013-03-01 16:20:50 -05:00
d90ec4e117 Merge pull request #2253 from jcftang/cowsay-osx
Cowsay on OSX macports
2013-03-01 09:50:24 -08:00
81a34c2d1d Cowsay on OSX macports 2013-03-01 16:51:13 +00:00
8099e4ac26 Merge pull request #2240 from dorfsmay/pullreq-fetch-doc
Doc that fetch returns ok when src not present.
2013-03-01 07:55:37 -08:00
22d20b4994 Merge pull request #2244 from fdavis/virt_doc_fix
virt module doc fix
2013-03-01 07:55:05 -08:00
273005a380 Merge pull request #2226 from skinp/openwrt_support
Adding support for OpenWrt
2013-03-01 07:50:54 -08:00
d9d5970858 Merge pull request #2222 from sfromm/issue2114
Update various modules for check_mode
2013-03-01 07:50:16 -08:00
f32f3fc7e2 Use opkg module as basis for macports module
This module is pretty simplistic, it is derived from the opkg module.
2013-03-01 14:07:38 +00:00
3104b79d35 Adding parameters example 2013-03-01 08:30:50 -05:00
79fb0aad28 Adding RabbitMQ module to handle parameters 2013-03-01 08:19:51 -05:00
f5ba0c61af Merge pull request #2248 from jpmens/iso8601
Add ISO8601 date/time format to setup
2013-03-01 05:16:34 -08:00
6e44c72761 Removed urlparsing of gemsource. Not needed 2013-03-01 12:24:11 +01:00
00bd581945 Add ISO8601 date/time format to setup
Zulu time and one with microseconds, useful for timestamping
  Add TZ
2013-03-01 09:40:40 +01:00
427b49c12c virt module doc fix 2013-02-28 18:04:25 -08:00
637210be1f Added gem module 2013-03-01 02:59:02 +01:00
b1478fdab7 Updating docs 2013-02-28 20:32:44 -05:00
bd9c64e014 Merge pull request #2245 from jmandel/add_user_fact
Add remote user_id to ansible facts
2013-02-28 16:14:54 -08:00
7c772c6af5 Add remote user_id to ansible facts 2013-02-28 15:55:31 -08:00
6250b64ef9 Use relative creates/removes path with chdir 2013-02-28 14:47:19 -08:00
b5ad1ce768 In django module if no virtualenv is specified, don't choke 2013-02-28 16:03:23 -05:00
1e5d5fc263 Be consistent about underscore usage. 2013-02-28 15:57:27 -05:00
60da7591c2 Merge pull request #2241 from tonk/devel
Added dat and time facts to setup
2013-02-28 12:43:26 -08:00
7b51f67128 Squashed commit of the following:
commit 076501459322cf6c14de742e504339d80ffdeed5
Author: Ton Kersten <tonk@tonkersten.com>
Date:   Thu Feb 28 21:32:57 2013 +0100

    Added date and time facts to setup
2013-02-28 21:33:56 +01:00
7cedb7d432 Doc that fetch returns ok when src not present. 2013-02-28 13:24:24 -07:00
fab3a522e2 Merge pull request #2239 from marktheunissen/nolog-mysql
Fix bug from copy-paste
2013-02-28 12:07:42 -08:00
34bed2fa2e Fix bug from copy-paste 2013-02-28 13:55:22 -06:00
f094d65fdd apt update 2013-02-28 20:50:07 +01:00
5289fa72b6 apt upgrade support 2013-02-28 20:47:31 +01:00
45949c7643 Add mysql user documentation 2013-02-28 10:25:09 -06:00
fca1167a0e add to_nice_yaml|json filters 2013-02-28 17:07:02 +01:00
ae8d6ac303 Ensure complex_args is considered in all action_plugins 2013-02-28 14:27:42 +01:00
297259725a Allow (local_)action: to be a dict
Use the key module: to set which module to invoke.
2013-02-28 14:12:36 +01:00
52c9a7af24 Fix references to user.username to be user.name 2013-02-28 14:02:59 +01:00
c04d5ba739 Allow specifying args directly to actions using module: syntax
Makes things like
- name: do complex things with complex module
  complex:
    setting_a: true
    setting_b:
    - foo
    - bar
possible.

Fixes #2228.
2013-02-28 13:54:04 +01:00
4807fbc8b7 Use regular strings to allow tests to work 2013-02-28 13:52:57 +01:00
6c9bb35f89 Merge pull request #2231 from tonk/devel
Service command handling fix when no upstart config file
2013-02-28 04:44:43 -08:00
05c70ca712 Squashed commit of the following:
commit e057ea671395ec8847f920a63cf9524f5c8fde5f
Author: Ton Kersten <tonk@tonkersten.com>
Date:   Thu Feb 28 13:02:25 2013 +0100

    Fixed the service command not working

    On Ubuntu 1[02].04 the service name was not recognized because
    there is a SysV style init script, but not an upstart config file.

    Example: The `ntp` client.

    Also removed extra spaces at the end of the lines, while at it.
2013-02-28 13:06:50 +01:00
e2643cb55f Broke BSD ifconfig parser into chunks for subclassing
This allows minor changes to be handled by adding a new
parse line function to the subclass
2013-02-28 09:58:29 +00:00
acc1c004d4 Restructured inheritance of BSD network classes
Now all BSD network classes directly inherit from Network as well as from the generic BSD network class.  This removes the need for itersubclasses().
2013-02-28 09:07:54 +00:00
2778ee0eb5 Adding support for OpenWrt 2013-02-27 22:16:12 -05:00
23bcb64758 Merge pull request #2224 from cliffano/patch-1
Fix proxy env format
2013-02-27 15:40:34 -08:00
19082f7b20 Fix proxy env format
The incorrect format (e.g. http_proxy=http://proxy.bos.example.com:8080) gave this error: "environment must be a dictionary".
2013-02-28 10:39:08 +11:00
323ed27106 Merge pull request #2221 from sfromm/fix-ansible-cli-check-mode
Fix CliRunnerCallbacks.on_file_diff in callbacks.py
2013-02-27 15:34:05 -08:00
fa07604d43 Fix CliRunnerCallbacks.on_file_diff in callbacks.py
When running ansible -C, I get a traceback that ends with
    AttributeError: Values instance has no attribute 'diff'
This fixes on_file_diff to behave similar to
PlaybookRunnerCallbacks.on_file_diff().
2013-02-27 13:26:29 -08:00
8f0d8a8546 Update various modules for check_mode
This updates the following modules to support check_mode:
* apt_key
* apt_repository
* easy_install
* pip - will always report changed due to the way it handles state
* seboolean
* selinux
* slurp - since nothing changes, it just adds that it supports
  check_mode
* subversion - reports changed when checking out new repo and
  when updating.
* supervisorctl
* svr4pkg

See issue #2114.
2013-02-27 12:23:35 -08:00
1fe744d2af Fix apt module's boolean check to expect converted value
Fixes #2218.
2013-02-27 20:02:34 +01:00
cedfec763a jsonify needs to return a string of {}, rather than a dict 2013-02-27 19:46:31 +01:00
e4b72c0fd5 Revert to just escaping \ for JSON-args 2013-02-27 19:43:27 +01:00
0342b054fd Merge pull request #2215 from tastychutney/devel
Updated virtualenv note
2013-02-27 08:42:53 -08:00
1601f0b4d7 Use repr to transfer JSON-arguments, so Python doesn't eat things
Fixes transferring newlines in args:, as well as """.
2013-02-27 17:16:23 +01:00
dc476a12a6 Updated virtualenv note 2013-02-27 10:01:12 -05:00
0fc317de08 Merge pull request #2212 from jhoekx/lvol-module
Add lvol module to manage logical volumes.
2013-02-27 05:52:23 -08:00
e33e84d24e Merge pull request #2213 from huberteff/devel
Work around hanging module.  Thanks to Daniel Hozac for the tip.
2013-02-27 04:30:39 -08:00
acf8ee9d61 Work around hanging module. Thanks to Daniel Hozac for the tip. 2013-02-27 13:26:12 +01:00
01a9d79e11 Add lvol module to manage logical volumes. 2013-02-27 11:27:26 +01:00
bcf7a2c53a Catch all exceptions coming from lookup plugins
Fixes using $TEMPLATE() and hostvars in a task without a name, among
other things.
2013-02-27 10:11:14 +01:00
e9907e9c8a added random cow pick through ANSIBLE_COW_SELECTION env var
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-02-26 22:41:01 -05:00
b1a4fab7e1 Merge pull request #2208 from tastychutney/devel
Better documentation, removed runfcgi, added createcachetable
2013-02-26 19:26:39 -08:00
36eeb7562a Better documentation, removed runfcgi, added createcachetable, merge with Michael's changes 2013-02-26 22:11:30 -05:00
fa550f3d7e Adding a script to auto-generate an authors file, runnable from 'make authors', which is called from 'make docs/webdocs'. 2013-02-26 22:05:17 -05:00
7dbfad8225 baby-JSON not supported, let selinux module warn using regular JSON 2013-02-26 21:57:47 -05:00
f47ecf0fce update changelog 2013-02-26 21:03:25 -05:00
d251e68ac5 Resolve merge 2013-02-26 20:57:36 -05:00
1366c663eb Merge branch 'copy-diff-take2' of git://github.com/stoned/ansible into better_diff
Conflicts:
	library/file
2013-02-26 20:51:32 -05:00
9e2cb42b4f Add some aliases for django manage, mainly around underscores, and use the newer (easier) way to do module docs. Also
add list of avail commands to docs.
2013-02-26 20:45:44 -05:00
06890085d2 Django manage.py administration module 2013-02-26 20:45:44 -05:00
7090ad3aac Merge pull request #2195 from tbielawa/NOOP
First try and making the nagios module NOOPpable
2013-02-26 17:32:41 -08:00
c485cb3700 Remove some tab/space issues in previous commits. 2013-02-26 20:30:33 -05:00
6a487409db Merge branch 'postgresql-check-mode' of git://github.com/cocoy/ansible into devel 2013-02-26 20:28:04 -05:00
0e1ba5e676 Prevent SVN checkouts from failing due self signed certs. 2013-02-26 20:23:12 -05:00
9f083bfca3 Merge pull request #2207 from marktheunissen/mysql-pass-and-password
Adding back support for pass=
2013-02-26 16:12:09 -08:00
234d31bf72 Adding back support for pass= 2013-02-26 16:27:23 -06:00
93f02d614b Merge pull request #2187 from dhozac/argument-type-check
Add type checking for module arguments, converting as much as possible
2013-02-26 14:05:36 -08:00
964ef8d4a0 Merge pull request #2205 from jcftang/devel
Adopt best practices with distributing portfiles
2013-02-26 13:28:53 -08:00
8a561d6cd7 Adopt best practices with distributing portfiles
Reorganised packaging and added some notes for less experienced users
on how to get the development version of ansible installed using macports.
2013-02-26 21:13:04 +00:00
b0bd0a0f4a Making the nagios module NOOPpable 2013-02-26 12:28:01 -05:00
8816dc7ca7 Make diff header lines more explicit about what the diff is about
This gives a more readable output when producing diff for a task
with multiple items (with_items).
2013-02-26 16:53:59 +01:00
1b8c9bab35 Fix diff when template destination is absent 2013-02-26 16:45:56 +01:00
6a12d64059 Merge pull request #2200 from l0neranger/devel
fixing changelog
2013-02-26 06:18:27 -08:00
5f55bac4f0 fixing changelog 2013-02-25 21:54:58 -08:00
22e40b6a61 Merge pull request #2198 from skvidal/nolog-params
No_log params
2013-02-25 14:51:18 -08:00
10e9f1fc1e Implement --diff for the copy module. 2013-02-25 23:32:52 +01:00
f02ea15f0c command: make sure that all _handle_aliases() calls returns {}
module_common: also work if there are no aliases (shell, command, etc) modules
2013-02-25 17:07:47 -05:00
b54887b03c make sure ec2_secret_key is set to no_log=True 2013-02-25 16:34:06 -05:00
c95848ae59 - add an aliases attribute as a lookup of aliasname to canonical name
of parameters
- add support for no_log attribute per-parameter which will not log
  that information to syslog
2013-02-25 16:33:04 -05:00
e32fbd312f Shell-quote environment contents 2013-02-25 22:31:49 +01:00
27f3ba53f9 Remove debug print for environment 2013-02-25 22:29:32 +01:00
1df56c07d3 If expand_lists is true, make lookup plugin result into a string
Fixes #2196.
2013-02-25 22:26:16 +01:00
7e0ee6809c Don't template delegate_to too early, not all vars are available
Fixes using delegate_to: $item within a playbook include.
2013-02-25 22:25:13 +01:00
f6e3583b9b Fix path to DOCUMENTATION.yml 2013-02-25 09:36:50 -05:00
3aceae57af Fixup documentation formatting 2013-02-25 09:35:05 -05:00
a5e4f4461e Add linode example, remove macports since it didn't do changed=True/etc 2013-02-25 09:35:05 -05:00
bd6852eda0 Merge branch 'doc_html_tweaks' of git://github.com/nigelm/ansible into devel 2013-02-25 09:24:56 -05:00
7a6f3e6a6a Missing colon in docs. 2013-02-25 09:22:10 -05:00
f03e845920 Allow hyphens in complex variables
Primarily to support ${hostvars.hostname-with-hyphens.<var>}.
2013-02-25 15:09:44 +01:00
50c1c06088 Merge pull request #2193 from szinck/devel
pass in int() args to get_pty
2013-02-24 12:27:31 -08:00
e7719e4e46 pass in int() args to get_pty
If LINES or COLUMNS was set, get_pty was failing because it was
expecting an int value to be passed in.
2013-02-24 13:39:03 -06:00
3c40ce5700 Better detection of whether a service is managed by systemd or not. 2013-02-24 11:58:05 -05:00
596c98320a Service module now knows a little more about systemd. This module is
really due for some refactoring, but telling how a service is managed is
a little fuzzy anyway.  on a systemd system typoing the service will now
give you a rather systemd specific error which is somewhat suboptimal.
2013-02-24 11:50:39 -05:00
4be3b06842 Run chkconfig enable/disable only when needed. TODO, apply same logic to update-rc.d/systemd 2013-02-24 10:33:40 -05:00
9ae64ffba9 Added top padding to h2 elements so not under menubar 2013-02-24 13:01:09 +00:00
86d55c1c4d Tweak maximum length of drop down menu 2013-02-24 12:20:16 +00:00
3bf088c084 Fix tabs/spaces. 2013-02-24 15:10:57 +08:00
0380ba7177 If running is given as the state value instead of 'started', still return the correct end state. 2013-02-23 22:28:57 -05:00
624a952c5c The service module made some assumptions about how a service should be managed based on what was installed on the system in terms of service
management tools, which meant upstart services on CentOS6 were not startable.  This tweak allows things like vmware-tools to be controlled
via the service module.  More testing on other distributions (particularly with systemd) is presumably needed.
2013-02-23 20:31:29 -05:00
1a6e959fa2 Merge pull request #2188 from lorin/docfix
Add a missing :: in an .rst file
2013-02-23 14:23:50 -08:00
578ec127fb Remove choices=BOOLEANS as it is no longer needed 2013-02-23 22:57:36 +01:00
2e8533aec2 Add a missing :: in an .rst file
Other changes are just eating trailing whitespace.
2013-02-23 16:47:47 -05:00
908a192736 Documentation updates 2013-02-23 15:17:50 -05:00
582f088e7e Fix module docs formatting 2013-02-23 15:11:15 -05:00
c86b34dae1 Lots of docsite additions for new features + cleanup lineinfile YAML docs 2013-02-23 15:08:33 -05:00
3422ae6737 Document how to do task includes using with_items and externalized data. 2013-02-23 14:56:25 -05:00
9a04c7eabc Add more 1.1 features 2013-02-23 14:37:50 -05:00
d8a77c0468 Add some 1.1 feature documentation 2013-02-23 14:34:29 -05:00
df798d0688 Use argument type checking to convert to boolean 2013-02-23 19:59:52 +01:00
5e13be0467 Organize changelog 2013-02-23 13:57:54 -05:00
294e43ba2f Removing pipe once since it has some issues about evaluating more than once :) 2013-02-23 13:47:11 -05:00
1cad5e19fc Working on adding things to changelog 2013-02-23 13:46:18 -05:00
9076f8eb31 Add type checking for module arguments, converting as much as possible
Converts to list from comma-separated strings, and to dicts from
comma-separated, key=value strings.

Fixes #2126.
2013-02-23 19:43:50 +01:00
69f0ce422e temporarily disabled, want to re-layout this later. 2013-02-23 13:37:41 -05:00
f01def384f Nothing references DOCUMENTATION.yaml, and it's incomplete, so remove it. 2013-02-23 13:36:15 -05:00
b75b9681a8 more places to use yaml.safe_load 2013-02-23 13:34:14 -05:00
a9ea3136cf Use yaml.safe_load as we are just using basic data structures 2013-02-23 13:33:21 -05:00
7650d7c20e Explain ansible_python_interp. a little better 2013-02-23 13:33:21 -05:00
1c6b0f93f1 Best practices doc updates 2013-02-23 13:33:21 -05:00
a2915bff8d Fix typo in svc docs 2013-02-23 13:33:21 -05:00
5b31feb73b Merge pull request #2179 from skinp/host_connection
Add support for connection type in ansible_hosts file
2013-02-23 09:58:17 -08:00
69a199727c Merge pull request #2180 from jsmartin/cloudformation
CloudFormation support.
2013-02-23 09:57:09 -08:00
878eb5a9b1 Merge pull request #2185 from lwade/devel
Issue #2158 - add VPC subnet ID support
2013-02-23 09:53:26 -08:00
ac41a9d1f0 Merge pull request #2175 from tyll/devel
mysql_db/user: Use password for my.cnf
2013-02-23 09:52:14 -08:00
8b3ebf0d10 mark when various new flags were added to the pip & easy_install modules 2013-02-23 12:51:23 -05:00
cff8cdd428 Using the _get_test and _get_stage methods. 2013-02-23 12:50:18 -05:00
943829c9b7 Added test cases for lineinfile. 2013-02-23 12:50:18 -05:00
9b32ab7ec2 Merge pull request #2150 from jhoekx/venv-command
Venv command
2013-02-23 09:50:10 -08:00
0486c7d51a missed a spot. 2013-02-23 17:46:35 +00:00
30ac2edc33 Adding VPC subnet ID support 2013-02-23 17:45:47 +00:00
b739a5860a Merge branch 'lineinfile_improvements' of git://github.com/leucos/ansible into devel
Conflicts:
	library/lineinfile
2013-02-23 12:45:36 -05:00
2763fa0021 Add a line about testing. 2013-02-23 12:41:00 -05:00
e1f1722e9e Docs tweak to setup module. 2013-02-23 12:36:01 -05:00
275bd1f400 Merge branch 'setup_filter_argument' of git://github.com/leucos/ansible into devel 2013-02-23 12:33:00 -05:00
9cea292665 Clean up OS family code 2013-02-23 12:32:51 -05:00
cf23d64a88 Conflicts:
library/setup
2013-02-23 12:32:51 -05:00
4d67608a10 Squashed commit of the following:
commit 1c9b2a6035913969b515862e37e7e1aca24529e0
Author: Ton Kersten <tonk@master.tonkersten.com>
Date:   Tue Feb 19 15:54:36 2013 +0100

    Added osfamily fact
2013-02-23 12:32:51 -05:00
2b4ddfb0a2 Handle delegate_to case for local connections in hosts file 2013-02-23 12:28:42 -05:00
7b2c8b302f Merge pull request #2146 from dagwieers/thirsty-force
Add force= and make thirsty= an alias for backward compatibility
2013-02-23 09:15:25 -08:00
467556708a Merge pull request #2145 from leucos/sysctl_no_file_check
Better sysctl module file check
2013-02-23 09:14:45 -08:00
274f15b52c Fix version_added for insertbefore in lineinfile 2013-02-23 18:11:10 +01:00
333b6bbaac Show how to use the more simplified way of including EXAMPLES in docs. We should update
all module docs to do this.
2013-02-23 12:03:33 -05:00
e51707711c Merge pull request #2120 from jpmens/doc_ex1
Add support for additional EXAMPLES string in Ansible modules
2013-02-23 08:58:34 -08:00
f7fb681bb2 Fix comment in chroot connection type 2013-02-23 11:56:24 -05:00
5a1aef5372 Merge branch 'local-chroot-support-v2' of git://github.com/mmoya/ansible into testing 2013-02-23 11:51:11 -05:00
93f73739d3 Merge branch 'paramiko-termcap' of git://github.com/madduck/ansible into testing 2013-02-23 11:38:52 -05:00
185790e32a Change title of localtoc menu from Page to Section 2013-02-22 21:18:43 +00:00
fa63a9b5f4 CloudFormation support. 2013-02-22 15:52:23 -05:00
92c679142f Optimizes using fnmatch only if needed
Skips fnmatch'ing if there is only a '*' in filter.
2013-02-22 17:41:18 +01:00
633fdede38 Fixes duplicate code
Fixed duplicate call for file attributes checking
2013-02-22 17:30:19 +01:00
4c0e6722c4 Add support for connection type in ansible_hosts file 2013-02-22 11:11:08 -05:00
9d594d7494 Merge pull request #2176 from johanwiren/zfs_check
Added support for --check in zfs module
2013-02-22 06:07:21 -08:00
ee517ea53c Added support for --check in zfs module 2013-02-22 15:01:18 +01:00
cc8fbe34f2 mysql_user: handle unnecessary GRANT revocation 2013-02-22 14:42:41 +01:00
813d2335ad mysql_db/user: Use password for my.cnf
According to the MySQL docs[0] the password should be stored after
'password=' instead of 'pass='.

[0] http://dev.mysql.com/doc/refman/5.1/en/password-security-user.html
2013-02-22 13:25:34 +01:00
008dc4831e Improves lineinfile and adds file attr option
Added path expanding for dest in lineinfile
Added common file arguments to lineinfile so the module gets owner,
group, mode and SE options.
Decorated existing example to demonstate usage of file options and added
a couple more examples
Message is not set accordingly when file attributes were changed
'absent' handling code now handles the case where the file doesn't
exists (was issuing a Traceback before)
File attribute handling code has been added to the 'absent' handling
function too.
File attributes handling has been grouped in 'def check_file' since it's
required in both places.
'absent' mode now returns a message like it's counterpart 'present',
telling if file attributes were altered and if lines have matched.
2013-02-22 09:33:21 +01:00
e4ccf2d8e0 Merge pull request #2164 from zayenz/patch-2
Fixed file-path in comment from examples.yml to intro_example.yml.
2013-02-21 16:59:51 -08:00
24a09dbe29 Merge pull request #2167 from jibs/patch-1
minor docs tweak: link directly to ec2 ini file
2013-02-21 16:59:30 -08:00
2225ee4b85 Merge pull request #2159 from stoned/diff-output
Fix diff output vertical spacing
2013-02-21 12:22:04 -08:00
c364e4c77b cron: Work even without initial crontab
Fixes #2165.
2013-02-21 21:14:29 +01:00
fbe0b2ab43 minor docs tweak: link directly to ec2 ini file 2013-02-21 15:24:45 +00:00
a5a0ab6b53 Fixed file-path in comment from examples.yml to intro_example.yml. 2013-02-21 09:40:42 +01:00
7c270078f4 Moved key filtering
Key filtering moved before returning results
2013-02-21 01:10:25 +01:00
9a493ef388 Add support for running modules chrooted in a local dir
Adds 'chroot' connection for executing modules chrooted to
a local dir. Requires running ansible as root.

chroot dirs should be specified in the inventory like any
other host.

You can do things like:

$ sudo -E ansible -vvv -f 1 "./chroot1,./chroot2" -c chroot \
  all -m setup
$ sudo -E ansible-playbook -vvv -f 1 -i "./chroot1,./chroot2" \
  -c chroot some-playbook.yml

some-playbook.yml:
---
- hosts: all
  tasks:
    - name: echo something
      shell: echo "Yaaay!" >/tmp/foobar.txt
    - name: install less
      apt: pkg=less state=latest
2013-02-21 00:51:02 +01:00
9f2bba01ba Fix diff output vertical spacing 2013-02-20 22:45:45 +01:00
5e68143c46 Check presence of files under /proc before opening them 2013-02-20 20:52:45 +01:00
8b27085c34 Prevent traceback when /etc/mtab is not available
* get_file_contents returns None when file is not available.
  When /etc/mtab is pointing to /proc/mounts and /proc is not
  mounted, mtab.split will traceback.
2013-02-20 20:52:45 +01:00
627577ecc9 Fixes unused var and avoid reassigning keys
Changed code so key doesn't get reassigned in loop
Made use of filtr variable
2013-02-20 19:12:01 +01:00
139e06d9af Added more examples for the filter option in setup
Added examples covering all available globs
Added a use case of filtering only facts returned by facter
2013-02-20 18:13:05 +01:00
5f4a24557b Adds example for filter option in setup module
Added an example on how to filter keys returned by the module.
2013-02-20 17:57:59 +01:00
75b687247a Adds filter option to setup module
Adds facts filtering using fnmatch, via the 'filter' option.

Usage:
ansible -m setup -a 'filter=ansible_*_mb'
2013-02-20 17:53:14 +01:00
a875b63703 Merge pull request #2152 from dagwieers/pause-doc
pause: Fix small documentation glitch
2013-02-20 07:20:59 -08:00
486889bbbd Add force= and make thirsty= an alias for backward compatibility 2013-02-20 15:42:55 +01:00
169d6e463c Merge pull request #2153 from jcftang/devel
Added more users of ansible (TCHPC and DRI)
2013-02-20 06:23:42 -08:00
7f980bba8f Added more users of ansible (TCHPC and DRI) 2013-02-20 14:19:12 +00:00
577f491368 pause: Fix small documentation glitch 2013-02-20 15:17:49 +01:00
621eb5eccc Add postgresql_db and postgresql_use checkmode. 2013-02-20 22:12:25 +08:00
7a7d02073a Merge pull request #2119 from jpmens/uri_json
uri: load JSON for content-type: application/json
2013-02-20 05:59:38 -08:00
9f65233e96 Easy_install and pip module support a virtualenv_command parameter.
This allows flexible selection of the Python version to use while
creating the virtualenv.
2013-02-20 14:52:02 +01:00
b448cc8eff uri: load JSON for content-type: application/json
document
check prefix of content-type and merge dicts
amend doc
load JSON into 'json' subkey
2013-02-20 14:45:47 +01:00
01e66c6687 Add virtualenv_site_packages param to easy_install 2013-02-20 14:44:27 +01:00
1026fa6ab5 Merge pull request #2122 from lwade/devel
Adding ec2-related module example to examples/playbooks
2013-02-20 05:35:52 -08:00
7834d021b9 Merge pull request #2138 from bcoca/2137_fix_setup_bsdjails
fixes freebsd setup issues with jails
2013-02-20 05:29:45 -08:00
ae599d8a61 Merge pull request #2115 from kavink/devel
teach apt module to support --check mode
2013-02-20 05:28:21 -08:00
e0496634c5 Removes useless empty string write
It s not necessary to write an empty string for the file to be created.
2013-02-20 14:20:27 +01:00
405471bbab Merge pull request #2143 from lwade/ec2_group_id
Add support for security group id parameter ISSUE #2029
2013-02-20 05:13:07 -08:00
52a990ec2b Merge pull request #2141 from dorfsmay/pullreq-env-simple
Prevents PATH, PYTHONPATH etc... to be re-added.
2013-02-20 05:10:56 -08:00
6d604469d8 Always adjust file attributes with the template module. 2013-02-20 08:05:59 -05:00
6f9d28c8b1 Changed when new sysctl file is created
When destination sysctl file is missing, it is created.
But, for idempotency purposes, the creation process now takes place just before it is used, in the
main code path so an empty file is not left over if the code
module.fail_jsons before the file is really used.
2013-02-20 12:52:30 +01:00
0eaa936ba0 Removes exception is sysctl file is missing
When syscl file was missing, sysctl module was complaining about it and
bailing out.
This behaviour prevents usage of /etc/sysctl.d directory, present in
some distributions.
This patch accepts a missing sysctl.conf file so sysctl.d directory can
be used.
However, it will bail out if the destination directory doesn't exist.
2013-02-20 12:42:49 +01:00
107733b174 Add support for security group id parameter, remove default for group name (since AWS already sets a default). ISSUE #2029 2013-02-20 09:31:22 +00:00
dfdc5bda4b Prevents PATH, PYTHONPATH etc... to be re-added. 2013-02-20 01:12:38 -07:00
aa713d72ef fixes freebsd setup issues with jails
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-02-19 18:36:25 -05:00
0f166d870a teach lineinfile module to support --check mode 2013-02-19 14:18:52 -08:00
53924b4599 teach apt module to support --check mode 2013-02-19 14:18:52 -08:00
3f2fd22ed4 Don't consider packages missing from the cache an error on remove
Fixes #2017.
2013-02-19 23:18:17 +01:00
d2bf205a5d Fix #2125 and clean up a few things along the way 2013-02-19 22:26:38 +01:00
18eca152e3 Merge pull request #2130 from lessmian/devel
mail module: properly set charset
2013-02-19 12:42:04 -08:00
cc159a68b2 Merge pull request #2131 from lessmian/sysctl_module
sysctl module: fixed issue when checks_after fail on comparing keys with...
2013-02-19 12:39:19 -08:00
8abca62b92 sysctl module: fixed issue when checks_after fail on comparing keys with values separated by white strings 2013-02-19 15:50:13 +01:00
a124a7f6a1 sysctl module: fixed issue when checks_after fail on comparing keys with values separated by white strings 2013-02-19 15:45:08 +01:00
e8254dee4d mail module: properly set charset 2013-02-19 11:33:38 +01:00
1b73227a30 Merge pull request #2128 from lorin/postgres-public
postgresql_user: Add support for PUBLIC
2013-02-18 20:40:21 -08:00
7f9bb9084f Rewrite best practices section. 2013-02-18 23:29:27 -05:00
eac339e98a Add documentation about PUBLIC user 2013-02-18 22:59:51 -05:00
4a90e2b50a postgresql_user: Add support for PUBLIC
This change enables users to add and remove permissions to all roles,
using the PUBLIC user. This is equivalent to using the PUBLIC keyword
in GRANT and DENY postgres SQL commands.

For example, see: <http://www.postgresql.org/docs/current/interactive/sql-grant.html>

Fixes #1833
2013-02-18 21:33:36 -05:00
f06cb8c8b1 Merge pull request #2127 from romeotheriault/uri-doc-fixes
uri module doc fixes
2013-02-18 15:15:20 -08:00
1c91917ed5 uri doc fixes 2013-02-18 13:03:19 -10:00
396a07bcc7 Add support for additional EXAMPLES string in Ansible modules
return DOC and EXAMPLES as a list
add moduledev explanation
more
2013-02-18 20:02:46 +01:00
211ae51495 Merge pull request #2123 from lessmian/devel
Fixed remove_key
2013-02-18 10:38:05 -08:00
8a49dac5d1 Fixed remove_key 2013-02-18 17:03:50 +01:00
2dbe01ea7c Adding ec2-related module example to examples/playbooks 2013-02-18 15:44:34 +00:00
093935ede1 Merge pull request #2116 from lwade/devel
Correct ec2_vol doc errors
2013-02-18 04:52:24 -08:00
4a137641d2 check_mode is a module property 2013-02-18 13:23:45 +01:00
3b9cf8270f Correct ec2_vol doc errors 2013-02-18 10:14:09 +00:00
ab389d8908 For consistency, add host should take a key named 'name' in addition to 'hostname'. 2013-02-17 20:45:37 -05:00
cc9bc91a6c Fix typo in zfs module docs 2013-02-17 20:01:15 -05:00
c4779d95b8 Removing unused import, 'make pyflakes' is now clean. 2013-02-17 19:49:50 -05:00
8097fd18a2 'make pep8' is now clean 2013-02-17 19:48:02 -05:00
9cf66f4376 Fixes from 'make pep8'. Partial, more to come. 2013-02-17 19:40:38 -05:00
23a0a8daf9 Merge pull request #2113 from johanwiren/zfs
zfs: documentation no longer breaks the formatting in webdocs
2013-02-17 16:34:00 -08:00
11e7ede4d9 Merge pull request #2112 from kavink/devel
Fixing syntax error
2013-02-17 16:33:34 -08:00
61d01f549f Show a nicer message when attempting to diff unicode files. 2013-02-17 19:32:28 -05:00
acc58a37df Set version_added to 1.1 2013-02-18 01:29:51 +01:00
5ae5fe83ac zfs module no longer destroys the layout in webdocs 2013-02-18 01:25:44 +01:00
359ac9a495 Fixing syntax error
running install_lib
byte-compiling /usr/lib/python2.6/site-packages/ansible/runner/action_plugins/add_host.py to add_host.pyc
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/ansible/runner/action_plugins/add_host.py', 37, 92, '    def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **kwargs)\n'))
2013-02-17 15:35:58 -08:00
18cbb64f25 Teach the yum module to support --check mode. 2013-02-17 18:18:43 -05:00
4f249902b3 Taught service how to use --check mode 2013-02-17 17:45:44 -05:00
b3eb1f32e3 update hacking/test_module script to be aware of complex arguments, though it does not pass them. 2013-02-17 17:33:42 -05:00
ad89ab7c5d Add group support to check mode. 2013-02-17 17:33:42 -05:00
fdbbb171ba Teach the user module to understand check mode. 2013-02-17 17:33:42 -05:00
43d22b0c42 Flatten argument to with_items
Fixes #1711.
2013-02-17 22:08:23 +01:00
f02b9987fc We all agreed on the list that the ansible module common module snippet, since it's dynamically embedded in modules on the fly, should
be a BSD licensed snippet so that it's ok to write proprietary modules.  The actual license of Ansible (GPLv3) or any modules
written for ansible (any) do not change.
2013-02-17 15:41:59 -05:00
8992fee2ab Correct documentation example, Snowball was a hampster. 2013-02-17 15:17:24 -05:00
7da9992110 Add complex arguments example 2013-02-17 15:06:17 -05:00
b63bf62b13 Remove debug print message 2013-02-17 15:03:30 -05:00
1ecf4a6943 Working on complex argument support. 2013-02-17 15:01:49 -05:00
5a91873983 resolve merge conflict 2013-02-17 13:13:20 -05:00
15901e8585 Merge pull request #2109 from lorin/pipe_once_docs
Document new PIPE_ONCE macro
2013-02-17 09:57:50 -08:00
c6778e796c Specified when PIPE_ONCE was added.
Also, now shows when "Getting values from files" was added, a sphinx
directive was missing a colon.
2013-02-17 12:55:47 -05:00
6ffc8a1441 Recurse was added in 1.1 2013-02-17 18:48:17 +01:00
ec16b854a5 Document new PIPE_ONCE macro 2013-02-17 12:47:51 -05:00
cd32597af0 Make the file module work as expected in check mode 2013-02-17 12:27:00 -05:00
931b9f41c8 Make note about enablement bit 2013-02-17 12:13:26 -05:00
934f416387 Avoid the 'state=null' coming back from the service module. 2013-02-17 12:11:53 -05:00
fa21b41357 Fixup the pipe_once plugin 2013-02-17 11:42:45 -05:00
0af83317a1 Added a $PIPE_ONCE lookup plugin, that caches the result so it is only evaluated one time. 2013-02-17 11:37:41 -05:00
e43abe326f Added a tunneling example 2013-02-17 11:25:42 -05:00
b365e04616 Allow add_host to add hosts to multiple groups, groups is now an alias for groupname. 2013-02-17 11:22:50 -05:00
cde233f93c Merge pull request #2104 from robparrott/devel
add_host changes to allow vars
2013-02-17 08:05:48 -08:00
ef17fc9f20 add the ability to take variables in the add_host module, and be willing to parse a host:port hostname handed to add_host 2013-02-16 20:27:38 -05:00
c000bd846b Hate to do this, but URI module docs were constructing messed up RST files, so removing examples for now. Will ask someone to work on them. 2013-02-16 18:45:59 -05:00
ae2d7eb7af Rough cut at adding a glossary section. This could definitely use some improvements, proof reading, and lots of cross linking. 2013-02-16 18:36:06 -05:00
a6653a8723 Clean up the installation section and mention pip. 2013-02-16 16:06:30 -05:00
4d880ec69a Updating links to useful articles 2013-02-16 15:54:05 -05:00
02db951708 Update releases link on getting started page. 2013-02-16 15:51:31 -05:00
8333b4eb03 Better explain magic variables 2013-02-16 15:49:42 -05:00
5f829f9926 Add versionadded element to new option, fix YAML formatting 2013-02-16 15:40:31 -05:00
2a66185920 update manpage for new options. 2013-02-16 15:38:59 -05:00
c8878998d1 update some of many copyright dates but we can just do this when editing each file, not super high priority 2013-02-16 15:32:01 -05:00
408deab4e0 Slight doc tweak 2013-02-16 15:28:52 -05:00
32f682946f Add video link to docsite 2013-02-16 15:18:42 -05:00
c79f8cc316 add user to who uses page 2013-02-16 14:53:52 -05:00
8b17484780 Update changelog 2013-02-16 13:48:45 -05:00
534f004078 Merge pull request #2101 from stoned/plugins-connections-doc
pasto and core connection plugins reference fix
2013-02-16 10:41:15 -08:00
369d586651 Merge pull request #2086 from lwade/devel
Adding a simple EC2 volume module for creation and attach
2013-02-16 10:38:52 -08:00
cb3d26c500 Merge pull request #2084 from johanwiren/zfs
Added zfs module
2013-02-16 10:37:58 -08:00
a01525bd30 Merge branch 'aix-fixes' of git://github.com/dagwieers/ansible into devel
Conflicts:
	library/setup

Tweak formatting.
2013-02-16 13:35:37 -05:00
df63f60b63 Tweak doc examples 2013-02-16 13:32:49 -05:00
1232e498c4 fixed the documentation so it build properly 2013-02-16 13:32:48 -05:00
2ecf3f9b94 moved module checking below module initialization 2013-02-16 13:32:48 -05:00
27145fab7f uri module 2013-02-16 13:32:48 -05:00
7129a9e355 Using "OtherLinux" in module_commons, cleander detection in setup. 2013-02-16 13:32:48 -05:00
5646bc278b Support for amazon linux distribution facts. 2013-02-16 13:32:48 -05:00
0cd0a7fda3 Fixes jina typos
Moved *jina* to *jinja2*
2013-02-16 13:32:48 -05:00
1c22f2146e Adds configurable jinja2 extension loading
Jinja extensions adds features to the jinja2 templating engine. This
patch allows module loading for the templating engine vian an
ansible.cfg configuration key (jinja_extensions).
The default behaviour doesn't change (no module loading).
Requested modules can be added coma separated in ansible.cfg

Adds whitespace handling in jinja_extension config

Added whitespace handling in jinja_extension configuration directive, so
things stay safe if user adds spaces around comas in the directives
list.

Adds config example for jinja_extensions

Added config example with multiple extentions for jinja_extensions
2013-02-16 13:32:48 -05:00
83ce1b2dc5 Modified to follow Daniel Hokka Zakrisson's recommendations. 2013-02-16 13:32:48 -05:00
4de1b4e8a9 Added an insertbefore option. 2013-02-16 13:32:48 -05:00
fa8e653011 Simplify and correct comparisons with None. 2013-02-16 13:32:48 -05:00
2172201795 Merge pull request #2091 from davixx/sysctl2004
Solving bug : sysctl check_after failing on multi-value sysctl parameters
2013-02-16 10:19:16 -08:00
21693b2d22 Merge pull request #2079 from huberteff/devel
Add NetBSD support for 'service' module, and add an example to 'lineinfile'
2013-02-16 10:08:25 -08:00
7827db6996 Merge pull request #2078 from huberteff/e2158b661d250c04609e7faff4d8e67df9cb37e4
Add example for adding to sudoers file
2013-02-16 10:05:08 -08:00
9cb710b2f7 Merge pull request #2073 from nigelm/hosts_comment_fix
Allow end of line comments in inventory file - fixes #2072
2013-02-16 09:57:20 -08:00
85c87e507e Slight docs tweak about thirsty mode on the copy module 2013-02-16 12:36:16 -05:00
b5f90ef054 Merge branch 'thirsty_copy' of git://github.com/bcoca/ansible into testing 2013-02-16 12:35:16 -05:00
11c730c4ca Merge branch 'devel' of git://github.com/trendels/ansible into testing 2013-02-16 12:32:18 -05:00
75b52d745e Updated documentation. Works with ansible-doc 2013-02-16 15:11:07 +01:00
438c77f762 pasto and core connection plugins reference fix 2013-02-16 13:40:04 +01:00
8bf0c8dc5c Solving bug https://github.com/ansible/ansible/issues/2004
Now handle positive integer value in virtual files if they are separated
by group of space characters where the count is unpredictable.
Thanks to romeotheriault for filing this bug.
2013-02-15 19:14:01 +01:00
36f613f51e Merge pull request #2088 from pas256/devel
Documentation fix for apt module: install-recommends
2013-02-14 19:37:54 -08:00
6fd0316fa6 The default for install-recommends is actually Yes, not No, as is
visible on line 121
2013-02-14 15:27:20 -08:00
ab39909260 Initialise PTY from calling environment
If we need to acquire a PTY for sudo's use, then it should really
inherit the capabilities of the calling environment. This is what
OpenSSH does, and so it makes sense to copy this behaviour for the
paramiko connection type.

Closes: #2065
Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-02-15 10:23:34 +13:00
1cf43e9afe Only allocate a PTY when sudo is used
Postpone the paramiko.Channel.get_pty until we know sudo is used. If
sudo is not used, then we do not need a PTY. In fact, the paramiko docs
explicitly state that it's not desirable to allocate a PTY for a simple
exec_command.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-02-15 10:17:43 +13:00
0a2a647831 Updated comments and closed code example. 2013-02-14 14:40:28 +00:00
8617b6df90 Adding a simple EC2 volume module for creation and attach 2013-02-14 14:18:35 +00:00
94813d38e6 Added zfs example playbook 2013-02-14 14:16:33 +01:00
19c94d7380 Added zfs module 2013-02-14 14:16:08 +01:00
6a89177a59 Added support for AIX 5.3 and 6.1
A collegue of mine has added basix AIX support to the setup, user and group modules.

We have tested this on AIX 5.3 and 6.1 and it works "as advertised"
2013-02-14 12:45:08 +01:00
584fd7a261 Fix Python 2.6-isms in sysctl module 2013-02-14 12:14:44 +01:00
18d9fc581d Add support for NetBSD. Tested on NetBSD 6.0/i386. 2013-02-13 22:07:31 +01:00
e2158b661d Add Linux-style path for sudoers file, to be consistent with other examples. 2013-02-13 22:02:17 +01:00
d4b9de643b Add an example on how to *add* a %wheel line to sudo - tricky as it has
a colon, which needs some special attention.
2013-02-13 21:42:12 +01:00
bd2bb0a297 Mac/FreeBSD Network Facts implementation
Uses a generic BSD Network class, which uses ifconfig and
parses crap out of it.  Modifies the Network __new__
implementation to search further down the subclass
tree
2013-02-13 17:37:17 +00:00
c0e28762f0 Allow end of line comments in inventory file
See github issue 2702
https://github.com/ansible/ansible/issues/2072
2013-02-13 14:15:22 +00:00
81d426de2a Merge pull request #2066 from lorin/git-example
Add example of read-write git checkout via ssh
2013-02-13 05:22:55 -08:00
321175cdfa Add example of read-write git checkout via ssh 2013-02-12 22:08:14 -05:00
7e2999ed2d Add directory detection to _remote_md5 and use this in copy
If it is a directory, change the destination path by appending the
basename of the source file, like is done if the destination ends with a
/, and try to get the MD5 of the new path.
2013-02-12 22:39:05 +01:00
f12dbd431a Don't remove invocation from the result in the log callback
Fixes #2064.
2013-02-12 22:26:30 +01:00
85fb8494c5 Clean up device fact gathering
Remove lots of re use that really shouldn't have been re in the first
place. Initialize pcidata even if lspci is unavailable, and check for
its usability before trying to use it.

Fixes #2060.
2013-02-12 18:48:14 +01:00
0212fed922 Merge pull request #2061 from candeira/fix_bug_in_user_module
fix remote execution NameError in module 'user'
2013-02-12 09:22:46 -08:00
ae81e3607f fix remote execution NameError in module 'user' 2013-02-13 04:01:46 +11:00
589548531e Merge pull request #2054 from kavink/devel
Fixing logical error in detecting virtual device.
2013-02-11 18:25:32 -08:00
3042366199 Fixing logical error in detecting virtual device.
So In my Centos 5.9 machine, if there is RAID mount ansible will crash, as it cannot find scheduler file. The reason being, this should be a virtual device as there is no "device" folder under e.g. /sys/block/md0/

Here is the crash:

[kk@u1 ansible]$ ansible q3 -m setup -k -u root --tree=/tmp/facts
SSH password:
q3 | FAILED => failed to parse: /sys/block/md0
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1797, in ?
    main()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1050, in main
    data = run_setup(module)
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1000, in run_setup
    facts = ansible_facts()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 990, in ansible_facts
    facts.update(Hardware().populate())
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 312, in populate
    self.get_device_facts()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 439, in get_device_facts
    m = re.match(".*?(\[(.*)\])", scheduler)
  File "/usr/lib64/python2.4/sre.py", line 129, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
2013-02-11 18:23:58 -08:00
af3402fe35 Merge pull request #2043 from chrishoffman/rabbitmq
Rabbitmq Module Updates
2013-02-11 17:43:07 -08:00
d632210941 Allow using other users' home directories as well 2013-02-11 23:43:30 +01:00
89e73c123f Fix tilde expansion for fileglob
Use common suffix to determine what part of original term to keep and
how much of the full path to combine to get a usable filename.
2013-02-11 23:43:27 +01:00
57e51f7fdf Clean up some extra_vars redundancy 2013-02-11 23:25:50 +01:00
57cac788fb Fix setup when /sys/block is inaccessible 2013-02-11 23:24:47 +01:00
5ba090c366 Fixes for Python 2.4 2013-02-11 23:23:14 +01:00
1a0f3b173e Merge pull request #2046 from chrishoffman/importfix
Duplicate/missing import
2013-02-10 16:05:13 -08:00
9057f72881 Removing duplicate import, adding missing import 2013-02-10 18:31:55 -05:00
a1e00c93e5 Add ansible_ssh_user/pass to enable inventory-defined users 2013-02-10 23:22:18 +01:00
507e49396b Updating how to run commands in check mode 2013-02-10 17:20:44 -05:00
ca3b8228f7 Updating how to run commands in check mode, standarizing quotes 2013-02-10 17:14:24 -05:00
2c947c2ed6 Adding aliases 2013-02-10 17:08:33 -05:00
114a4dc597 Standarizing quotes 2013-02-10 17:02:50 -05:00
31e5e81fcd Standarizing module in line with other rabbitmq modules, adding support for setting tracing 2013-02-10 17:01:20 -05:00
b79d7a606c Using new qualified executable 2013-02-10 17:00:09 -05:00
c83e428a7e Default expand_lists to True and set it to False for only_if
Fixes #2026 and #2027.
2013-02-10 22:57:53 +01:00
c94ec20a16 Getting fully qualified path for executable 2013-02-10 14:38:00 -05:00
5a4ff6ca60 Cleaning up tag compare, getting fully qualified path for executable 2013-02-10 14:37:21 -05:00
32c7fa7f70 Remove unneccesary quotes from user task 2013-02-10 14:32:43 -05:00
b2b1900765 minor aesthetics tweak 2013-02-10 13:20:19 -05:00
b1c739889c Add example of working with the environment 2013-02-10 13:08:16 -05:00
f7497e75e5 Able to use "environment: " on any task to pass proxy details and other useful settings. Can be a variable
or a dictionary.
2013-02-10 13:05:58 -05:00
72a05ae2a0 Move diff code more into runner code. 2013-02-09 23:24:03 -05:00
6f0c9592bb Additions to Who Uses Ansible 2013-02-09 23:05:09 -05:00
0ad6ac4086 Fix group depth for nested groups 2013-02-09 22:52:35 -05:00
85b52ca625 Resort the who uses ansible page 2013-02-09 22:49:00 -05:00
f41cf5528c Add complex networking setup to docs! 2013-02-09 22:47:19 -05:00
df032dfd11 Merge pull request #2039 from okorz001/fix-man-page
Correct -u description in ansible man page
2013-02-09 19:44:37 -08:00
828119d823 Allow the remote username to come from a variable set in vars_files or vars 2013-02-09 22:42:35 -05:00
e6ead2ca74 make things like $FILE(/etc/path/foo.conf) and $ENV(HOME) work without having to use brackets to index them 2013-02-09 22:35:27 -05:00
ba807ed5a8 Correct -u description in ansible man page 2013-02-09 19:24:53 -08:00
e906271f91 Update changelog -- wow, lots of nice stuff merged in today! 2013-02-09 14:50:47 -05:00
790cc11f03 Change the 0.X part to not imply something new was added in 0.X something if a user forgets to put in a specific version in the module docs. 2013-02-09 14:44:10 -05:00
6c4e1db54e Documentation formatting for mongodb_user so it will show up in ansible-doc and the web. 2013-02-09 14:43:17 -05:00
3c51feb36c Had to remove the instance_tags example because our doc generator was choking on it, feel free to add it back if you can get it to be valid
YAML again :)
2013-02-09 14:39:57 -05:00
27ff22610d Fix lineinfile docs formatting 2013-02-09 14:34:03 -05:00
c692de6b80 Cleanup YAML parse error warning code a tiny amount. 2013-02-09 14:30:19 -05:00
5c38248788 Fix crontab doc formatting 2013-02-09 14:29:31 -05:00
550a1b5f02 Remove mercurial module reference now that we have a cleaned up hg module in core now! 2013-02-09 14:13:46 -05:00
5457e969db Add a reference to Coderwall for tips & tricks! 2013-02-09 14:13:46 -05:00
c91f8c1565 Merge pull request #2036 from cordmata/devel
Add rabbitmq_vhost module.
2013-02-09 10:34:56 -08:00
4e9a1693cd Merge pull request #2035 from tgerla/devel
Add more error handling to the ec2 module, remove Python 2.6ism
2013-02-09 10:34:03 -08:00
3284fd607f Add rabbitmq_vhost module.
Simply ensures existence or non-existence of a vhost.
2013-02-09 11:28:41 -07:00
0f389b311f Add more error handling to the ec2 module, remove Python 2.6ism 2013-02-09 09:58:43 -08:00
fa44f49afb Merge pull request #2034 from chrishoffman/rabbitmq
Adding rabbitmq modules
2013-02-09 09:04:33 -08:00
e44412101b Merge recursive file permission setting on directories 2013-02-09 12:01:45 -05:00
6f7855161c Adding rabbitmq modules 2013-02-09 11:55:23 -05:00
8db504fba8 Merge branch 'devel' of git://github.com/lwade/ansible into devel 2013-02-09 11:47:45 -05:00
36027ddbba Squashed commit of the following:
Changed ami_tags to instance_tags to better follow naming convention
    Add support for creating tags on the new instances
2013-02-09 11:43:30 -05:00
a894791767 Slightly friendlier error on missing hosts file, slightly friendlier error on inventory script returning invalid syntax
(or if inventory is non-script and accidentally executable).
2013-02-09 11:37:55 -05:00
1163c23c35 Merge branch 'nice_missing_inventory' of git://github.com/bcoca/ansible into devel 2013-02-09 11:33:18 -05:00
ca5f52b825 now missing hosts file gives nice message and no traceback
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-02-09 11:32:18 -05:00
e564de3983 Some formatting preferences for --list-hosts and --list-tasks 2013-02-09 11:28:59 -05:00
e231708260 Merge branch 'devel' of git://github.com/schmic/ansible into schmic-devel 2013-02-09 11:24:08 -05:00
0e8627b7e8 added block device info gathering, full for linux, partial for freebsd added prettyfing byte function Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
moved moutns out of devices Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-02-09 11:15:22 -05:00
171a01deac Cron module upgrades
- added cron_file attribute: if specified, the file with appropriate
job is created in /etc/cron.d directory. Also, you can store multiple
jobs in one file. state='absent' attribute is handled in the following
way in this case: if after the deletion of the job from the file specified
by cron_file variable the file is empty, the file is deleted, otherwise
not.
  - fixed the behaviour, when the backupfile is saved forever in /tmp
folder, even if the backup= atribute is not set (os.unlink() is called if
backup is not True).
  - added some comments to the unobvious places
2013-02-09 11:11:19 -05:00
50495680d5 Merge pull request #2033 from lorin/intersect-pattern
Document :& host notation and using variables with hosts
2013-02-09 07:51:06 -08:00
44084a83a4 Document :& host notation and using variables with hosts 2013-02-09 10:47:52 -05:00
aebacdb2d7 Merge pull request #1949 from elliotttf/devel
Adding mongodb_user module.
2013-02-09 06:47:20 -08:00
d102f04ffc Merge pull request #1942 from blair/pip-virtualenv-add-system-package-support
library/pip: add support for virtualenv's --system-site-packages.
2013-02-09 06:45:56 -08:00
6266571c15 Merge pull request #2030 from cordmata/devel
Fix Issue #2025 where templates were not being transfered.
2013-02-08 11:17:09 -08:00
2ccfc8d2b6 Fix Issue #2025 where templates were not being transfered. 2013-02-08 12:03:54 -07:00
0726933a5a added thirsty option to copy
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-02-08 10:29:52 -05:00
23bffc5f25 update changelog 2013-02-07 23:07:19 -05:00
a9162a86f2 Very basic --diff option for showing what happens when templates change.
Probably output is not useful if not used with --limit

Works well with --check mode
2013-02-07 22:52:25 -05:00
3d6993221e service status 4 should also be stopped 2013-02-07 21:29:31 -05:00
8f70883541 Handle 'groups=' (empty string) in user module (Linux)
Makes it possible to remove a user from all but the primary group.

Setting 'groups=' is the equivalent to passing '-G ""' to
useradd/usermod, which is interpreted as "no group" on Linux.
2013-02-08 00:50:02 +01:00
f3305564e2 Add stderr contents to parse errors 2013-02-07 23:50:00 +01:00
1205bbe195 Adds commandline parameter --list-tasks 2013-02-07 22:29:28 +01:00
19f3cf45f4 Merge pull request #1982 from dex4er/feature_j2_filter_safe_yaml
Use yaml.safe_dump rather than yaml.dump. No more "!!python/unicode".
2013-02-07 13:24:08 -08:00
663052dd16 Merge pull request #2011 from schmic/devel
No authentication when ansible-playbook is called with --syntax-check
2013-02-07 12:16:51 -08:00
dd9e3430e4 No authentication with --syntax-check 2013-02-07 21:09:45 +01:00
dddfeac9c4 Allow using ${hostvars.<node>} for nodes not in SETUP_CACHE
This allows accessing inventory data from nodes that have not been
talked to (yet).
2013-02-07 18:40:41 +01:00
7d43865e13 Merge pull request #1986 from jcftang/devel
Documentation Fixes relating to OSX and macports
2013-02-07 05:04:03 -08:00
9113c01e37 Merge pull request #1990 from roller/devel
Specify repo option with hg pull
2013-02-07 05:03:38 -08:00
c3cfb450a9 Merge pull request #2006 from stoned/doc-fix-examples-yum
Fix yum module examples: the 'pkg' parameter is now 'name'
2013-02-07 05:02:53 -08:00
312ba593fd Fix yum module examples: the 'pkg' parameter is now 'name' 2013-02-07 13:27:53 +01:00
ffd4ae11b8 Merge pull request #1993 from fdavis/timeout_ssh
Add ConnectTimeout=DEFAULT_TIMEOUT to ssh args
2013-02-07 03:20:46 -08:00
70d5dad726 Also catch NameErrors which would indicate missing quotes 2013-02-07 11:56:59 +01:00
bc709e7b67 expand_lists should default to False 2013-02-07 11:56:59 +01:00
7a49230e85 Merge pull request #2005 from ftao/supervisorctl-update
always restart the program when state=restarted
2013-02-07 01:00:18 -08:00
9174c52b1d always restart the program when state=restarted 2013-02-07 15:53:36 +08:00
21a5c55921 Add ConnectTimeout=DEFAULT_TIMEOUT to ssh args 2013-02-06 23:42:04 -08:00
98f0a9210e Raise an error when multiple when_* statements are provided
Fixes #1994.
2013-02-07 08:11:30 +01:00
b0932e1638 Merge pull request #1999 from dorfsmay/pullreq-lineinfile
Clarification on how to use insertafter with a regex.
2013-02-06 23:09:55 -08:00
43c9a665e1 Merge pull request #2001 from stoned/ansible-limit-list-hosts
For ansible --list-hosts benefit apply hosts selection limits early
2013-02-06 23:09:18 -08:00
ad7807fce4 Added DPKG options which lardcanoe suggested 2013-02-07 08:00:02 +01:00
ded3b954a2 Add 1.0 release to Debian changelog
Fixes #1988.
2013-02-06 17:09:39 +01:00
dab31116b3 Actually add stdout data to stdout buffer for daemon mode 2013-02-06 16:52:04 +01:00
d5e63332fe Raise an error if an action doesn't have a string type
Happens with e.g. "command: true" that YAML helpfully converts to a
bool.
2013-02-06 16:41:34 +01:00
82011b043a For ansible --list-hosts benefit apply hosts selection limits early 2013-02-06 14:47:21 +01:00
05a3876dc9 Clarification on how to use insertafter with a regex. 2013-02-06 01:25:30 -07:00
924e9ffe8b Merge pull request #1995 from runekaagaard/devel
Fixing bug with unicode templates
2013-02-05 18:58:39 -08:00
7a8b27f716 Fixing bug with unicode templates.
The utils.md5s() function would break when calculating checksums
for non-ascii characters. Convert to utf-8 first.
2013-02-05 14:49:59 +01:00
106fb10dab library/pip: add support for virtualenv's --system-site-packages. 2013-02-04 17:03:25 -08:00
ac716ac9ca Specify repo option with hg pull
Fixes #1989
2013-02-04 17:19:59 -06:00
7a40ed41f7 Documentation Fixes relating to OSX and macports
Insert some notes about installing on OSX via macports
2013-02-04 19:57:33 +00:00
c1b63d1500 Fix for when conditional is a simple bool already
Fixes #1983.
2013-02-04 20:12:53 +01:00
093a876a57 Added capability to enable CloudWatch monitoring when launching. 2013-02-04 18:03:47 +00:00
8cf268441e Use yaml.safe_dump rather than yaml.dump. No more "!!python/unicode". 2013-02-04 13:40:07 +01:00
1becc665b2 Fix missing ) in add_host
Fixes #1980.
2013-02-04 12:21:33 +01:00
26310f411c Added check so that upgrade cannot be used with other options. 2013-02-04 08:44:35 +01:00
5478dab4d7 now missing hosts file gives nice message and no traceback
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-02-03 23:19:37 -05:00
06f7858622 Update README.md 2013-02-03 22:20:04 -05:00
e25b2fb41c Update README.md 2013-02-03 22:17:13 -05:00
fed82c2188 This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list
shortly.
2013-02-03 20:34:13 -05:00
28cf95e585 Use module.get_bin_path for pkgin module instead of hardcoding paths 2013-02-03 23:57:34 +01:00
d8d1f2cd7a Split PATH on os.pathsep, that is what it's there for 2013-02-03 23:57:34 +01:00
a025cfcb33 Add on_import_for_host callback from non-list case 2013-02-03 23:37:29 +01:00
fd59a03193 Added version flag (1.1) to updated
apt module.
2013-02-03 19:14:37 +01:00
dc5c430f45 Merge pull request #1970 from piffey/devel
Devel
2013-02-03 06:34:09 -08:00
3fe0aa9806 Merge pull request #1974 from jcftang/devel
Integrate upstream changes from Portfile that exists in macports
2013-02-03 06:29:59 -08:00
c1e0f0b4db sysctl was added in 1.0
Fixes #1972.
2013-02-03 14:01:55 +01:00
9a34c20cc5 Create Play objects for --list-hosts to mimic actual behaviour
This makes --list-hosts work more like actually running the playbook,
and thus gets the correct hosts with regard to includes and similar.

Fixes #1959.
2013-02-03 14:01:55 +01:00
a79373f6b2 Make template_ds the only templater
Instead of having to remember when to use which one, rename template_ds
to template and move the last bit of code from template to varReplace
(which gets used for all string replacements, in the end).

This means that you can template any data type without worrying about
whether it's a string or not, and the right thing will happen.
2013-02-03 14:01:54 +01:00
ebd2ed72f7 Integrate upstream changes from Portfile that exists in macports
See this post - https://groups.google.com/forum/?fromgroups=#!topic/ansible-project/7xdC0MP9MjM

I was not aware that blair had uploaded a portfile to macports already,
this set of changes makes the 'devel' version of the portfile similar
to the upstream. Except the man pages, examples and sample config files.
2013-02-03 12:18:14 +00:00
31db1e31d4 Added apt-get upgrade and dist-upgrade option 2013-02-03 10:46:23 +01:00
0f44ba5a5a * Minor removal of some dumb I did. 2013-02-02 18:17:18 -06:00
39c8becfc8 * Added support for multi-line key files. 2013-02-02 18:07:10 -06:00
42daffdb38 Merge pull request #1948 from yeukhon/devel
hg module cleaned up
2013-02-02 10:27:06 -08:00
f7aaa5ccc5 Fix copyright, unused imports 2013-02-02 13:06:48 -05:00
7d9b29d48a Update changelog 2013-02-02 13:03:07 -05:00
857ccf7f6c Add random choice plugin (with_random_choice) 2013-02-02 13:02:47 -05:00
5cdc25ec47 Tweak documentation example about lookup plugins 2013-02-02 12:56:56 -05:00
f4dddfdbab Fixup inventory docs 2013-02-02 12:43:05 -05:00
dd91452eda Better explain precedence. 2013-02-02 12:29:49 -05:00
bf088a50aa Add when_failed/changed dates 2013-02-02 12:26:26 -05:00
cde5b4b80c Reference sudo flag changeability. 2013-02-02 12:24:48 -05:00
1e3df3b5ab Show how to assign lookup plugins in variables 2013-02-02 12:19:21 -05:00
fe5ab64b62 Document lookup plugin shorthand 2013-02-02 12:03:48 -05:00
78ecc45d4d Document other syntaxes 2013-02-02 12:02:08 -05:00
0ae7f996f5 Make sure all the lookup plugins are documented. 2013-02-02 11:51:25 -05:00
318e3302fb Fix up some version related things on the devel branch. 2013-02-01 21:38:21 -05:00
cd7c3e7b91 Update release date 2013-02-01 21:35:13 -05:00
6a64e9f024 Update changelog 2013-02-01 21:27:00 -05:00
602656f02c Merge pull request #1961 from skvidal/yum-mod
Yum mod
2013-02-01 18:13:18 -08:00
7ffa2a2b06 Merge pull request #1957 from jcftang/devel
Add macports packaging - points to git repo and devel branch instead of ...
2013-02-01 18:11:50 -08:00
1d638d62ee Merge pull request #1954 from lorin/ec2-facts-fix
If ec2 fact has ':' or '-', change to '_'
2013-02-01 18:10:47 -08:00
6d72529420 Merge pull request #1932 from jblaine/patch-1
Correct python module name for jinja2
2013-02-01 18:09:31 -08:00
59134ebe93 Merge pull request #1951 from leucos/patch-2
Update packaging/arch/PKGBUILD
2013-02-01 17:15:40 -08:00
f853f2b19d Merge pull request #1962 from akerl/envfix
fixed shebang in hacking test-module
2013-02-01 16:57:09 -08:00
ee274b5816 fixed shebang in hacking test-module 2013-02-01 17:11:38 -05:00
808554dee6 use a local copy of repoq so we don't inadvertently pollute the one for is_installed 2013-02-01 16:47:53 -05:00
1c067845f2 don't apply enablerepo's to is_installed() to work around yum-utils/repoquery drift from all things
good and proper
2013-02-01 12:39:02 -05:00
c1812a9df4 Add macports packaging - points to git repo and devel branch instead of releases 2013-02-01 16:51:20 +00:00
4d38c68489 If ec2 fact has ':' or '-', change to '_'
Change ec2 fact names with colons (:) or dashes (:) to undescore (_)
so that they can be used in templates.

Note that this makes copies instead of replacing the exisitng fact
names to avoid breaking existing playbooks.
2013-01-31 21:00:25 -05:00
5c26805ee7 test the repos in enablerepo/disablerepo and error out if they are broken 2013-01-31 17:23:10 -05:00
f7e286cf34 Fix error format for invalid vars_files 2013-01-31 20:25:28 +01:00
bd5f699291 Update packaging/arch/PKGBUILD
Removes python2-json dependancy which is not required on Arch (python 2.7)
2013-01-31 18:19:32 +01:00
923929081a Merge pull request #1945 from skvidal/extravars
- make extra-vars override all other vars and facts in playbooks
2013-01-31 08:33:59 -08:00
83b9654c63 stop updating SETUP_CACHE in run_play as per comment on pr 1945 2013-01-31 11:24:22 -05:00
a1ea366957 Adding mongodb_user module. 2013-01-31 08:48:58 -06:00
cc6fc149c2 Merge remote-tracking branch 'upstream/devel' into devel 2013-01-31 02:15:17 -05:00
980ffde192 Changes is now determined by simply comparing before,after and cleaned (purge and/or force). Doc is updated. 2013-01-31 02:11:28 -05:00
ccc903216b Use %s instead of .format for string replacement. Revisied the documentation. 2013-01-30 22:40:26 -05:00
fabb2a61de Merge pull request #1946 from tgerla/devel
Only inventory "running" EC2 instances. "stopped" is also a valid state ...
2013-01-30 16:00:45 -08:00
168fcb0a4a Only inventory "running" EC2 instances. "stopped" is also a valid state and these should not be inventoried. 2013-01-30 11:01:25 -08:00
f649777072 - make extra-vars override all other vars and facts in playbooks 2013-01-30 11:56:04 -05:00
99a8e95c98 Rewrote hg module based on feedback.
1. state option is removed
2. force is hg update -C
3. purge is hg clean/hg purge but default to no
4. relies on hg abililty to handle errors
2013-01-29 17:29:35 -05:00
0243b7be7c Fix get_url to work on Python 2.4 2013-01-29 18:57:02 +01:00
03cf5b2777 Merge pull request #1939 from diefans/devel
proper bin path now called
2013-01-29 05:02:21 -08:00
65d0eb9621 proper bin path now called 2013-01-29 13:53:36 +01:00
b79960e13b If failed lookups are fatal, re-raise the exception
Fixes #1938.
2013-01-29 10:31:33 +01:00
92fd1c6578 Merge remote-tracking branch 'upstream/devel' into devel
Conflicts:
	library/hg
2013-01-28 21:48:27 -05:00
e166f71fcc Get output before receiving return code
Fixes hangs observed with large amounts of output, as it would get into
a dead-lock.
2013-01-29 00:38:07 +01:00
4d8f3b0924 This standardizes the apt_key module some
* improves error handling and reporting
* uses run_command to reduce code
* fails quicker on errors as opposed to return codes and tracebacks
* can now also specify the key as data versus needing to wget it from a file
2013-01-28 15:48:55 -05:00
aaf6173fbe Correct python module name for jinja2 2013-01-28 12:52:47 -05:00
0bfec51a04 Remove last remnants of daisychaining 2013-01-28 17:46:35 +01:00
5268d49bad Add sudo_flags configuration option to alter sudo behaviour
Default to -H to set $HOME appropriately.
2013-01-28 17:41:43 +01:00
133874a577 Fix module.run_command usage in fireball 2013-01-28 12:40:18 +01:00
9f4eaed88f Merge pull request #1928 from akerl/assemblefix
adjusted assemble to use new file attribute handling
2013-01-28 00:53:38 -08:00
819da94ced adjusted assemble to use new file attribute handling 2013-01-28 00:33:18 -05:00
a956a59bfb Merge pull request #1927 from junyoungkim/devel
whitespaces in FULL_PATH cause an error to get ANSIBLE_PATH
2013-01-27 18:03:12 -08:00
a2aacaaec8 whitespaces in FULL_PATH cause an error to get ANSIBLE_PATH 2013-01-28 10:46:34 +09:00
5b1a0f79b2 Merge pull request #1926 from akerl/requiredcheck
fixed check for required_together
2013-01-27 09:47:31 -08:00
f4eed3710b fixed check for required_together 2013-01-27 12:39:35 -05:00
0030a2bd09 Allow handler files to be empty lists. 2013-01-27 10:40:29 -05:00
12403abc2c Merge pull request #1924 from blair/consistly-use-underscores
library/apt: consistently use underscores in examples.
2013-01-26 10:31:59 -08:00
07b056fb78 Add env vars to changelog 2013-01-26 13:33:04 -05:00
0c2f67ef66 Merge pull request #1923 from fdavis/ans_env_addition
add env vars for plugins action,callback,connection,lookup,vars,filter
2013-01-26 10:30:39 -08:00
7b35042f3a Merge pull request #1901 from leucos/patch-1
Update packaging/arch/PKGBUILD
2013-01-26 10:30:13 -08:00
5f86f7d0ba Reorganizing changelog, some cleanup still needed, but now it's easier to tell what is in the release :) 2013-01-26 13:30:38 -05:00
811c711328 library/apt: consistently use underscores in examples.
To be consistent with the table showing available options, use
underscores in the example tasks, not hyphens, as the table doesn't
list hyphenated versions of option names, so it looks like the
examples could have typos in them.
2013-01-26 10:25:08 -08:00
b749af0b10 New changelog additions from today's merging 2013-01-26 13:07:06 -05:00
25f52d79d1 Tweak sysctl docs so they'll web-render 2013-01-26 12:58:12 -05:00
e9d5cf3bc2 Fix documentation YAML for pkgin module 2013-01-26 12:44:43 -05:00
970ae584c9 fix documentation formatting for get_url 2013-01-26 12:38:08 -05:00
36066d8664 Fixup ec2_facts docs parsing 2013-01-26 12:34:30 -05:00
925c1a4611 add env vars for plugins action,callback,connection,lookup,vars,filter 2013-01-26 09:25:35 -08:00
5e4d29565c Standardize the hg command execution around our run command function. 2013-01-26 12:20:46 -05:00
2da3a54e29 Update library/ec2
updated indentation and redundant comment.
2013-01-26 12:20:46 -05:00
e5b64b2f74 Added hg module to the core. 2013-01-26 12:20:46 -05:00
de833b3ae0 Update library/ec2
bumping up min_count value.
2013-01-26 12:20:46 -05:00
b0ecfbb26d Update library/ec2
I've uncommented and added a very little supporting stuff based on skvidal's work to allow us to launch more than one instance.
2013-01-26 12:20:46 -05:00
005f864068 minor doc changes 2013-01-26 12:20:45 -05:00
d683c2431e add support for user:password syntax in urls to get_url 2013-01-26 12:20:45 -05:00
634d59c97f Merge pull request #1913 from jlitola/apt_key
Fixed apt_key's add_key stalling indefinitely, and test code leaking into production
2013-01-26 09:01:13 -08:00
c55a822c1e Merge pull request #1906 from szinck/devel
Add basic pkgin package management
2013-01-26 08:55:03 -08:00
e0b5c35033 Merge pull request #1891 from silviud/ec2_facts_module
ec2 facts module - registers to ansible_facts key
2013-01-26 08:38:16 -08:00
7b0a3c3f2d Added hg module to the core. 2013-01-25 22:51:20 -05:00
f97622d4f6 Merge pull request #1921 from lorin/git-abspath
Git module: fix for relative paths
2013-01-25 17:57:07 -08:00
c337b64e35 Git module: fix for relative paths
If a relative path is passed as an argument, this change first
converts it to an absolute path.

This fixes a bug where the git module would attempt to chdir into an
invalid directory because of multiple chdir calls against a relative
path.
2013-01-25 20:49:30 -05:00
b2aed1a4ba pkgin: add stdout to error message when shell commands fail 2013-01-25 16:58:29 -06:00
e9ca960558 pkgin: use module.run_command to run stuff
This also fixes an issue where some console output for packages I was
installing was creating invalid JSON because it contained single-quotes.
2013-01-25 16:48:58 -06:00
4d71b31f7e Ensure destination and source are available before mangling them
Fixes #1918.
2013-01-25 23:14:52 +01:00
6f9099c51d Merge pull request #1898 from silviud/fix_inventory_list_groups
Inventory class - lambda fails on attribute access - g.name is a string not the group obje...
2013-01-25 08:35:03 -08:00
53fd85e2c4 Merge pull request #1903 from leucos/mergeable-hash-vars
Adds user-selectable hash merging support in vars
2013-01-25 08:29:05 -08:00
6e0cb14ba5 Merge pull request #1911 from tgerla/devel
Port ec2 module to Boto
2013-01-25 08:18:48 -08:00
a5e6c18f36 Merge pull request #1917 from lwade/patch-2
Update docsite/rst/who_uses_ansible.rst
2013-01-25 07:32:53 -08:00
33cc9719ba Update docsite/rst/who_uses_ansible.rst
Added Eucalyptus.
2013-01-25 15:20:43 +00:00
2796603c92 Removed apt_key tests, as they didn't test the real functionality.
Tests used heavily mocked version of the apt_key code, which meant that
it didn't properly test real life scenario.
2013-01-25 17:10:04 +02:00
9f6f15f770 Fix unparseable documentation strings
Fixes #1902.
2013-01-25 14:25:12 +01:00
864b75e54b Override Jinja2 Template class to make {% include %} work again
Fixes #1908.
2013-01-25 14:16:29 +01:00
05f5b5b279 Fixed add_key stalling indefinitely, and test code leaking into production setting 2013-01-25 13:32:30 +02:00
e34eaa423d pkgin: change install/remove to not use return code of pkgin
pkgin always returns 0 so can't be used to tell if the install or remove
worked.  Instead this just queries the installed packages after
performing an operation.
2013-01-24 19:58:31 -06:00
2a893ab0bb ec2 facts module - updated as per comments 2013-01-24 19:14:32 -05:00
58618474db Merge pull request #1907 from sfromm/issue1888
Update apt_repository to query if repo is already configured
2013-01-24 15:08:24 -08:00
688524dd23 Merge pull request #1910 from fesplugas/patch-1
Update examples/playbooks/ansible_pull.yml
2013-01-24 09:10:01 -08:00
c6629219d9 Update examples/playbooks/ansible_pull.yml
Typo
2013-01-24 17:29:50 +01:00
e0741e7810 Update apt_repository to query if repo is already configured
This adds two dependencies to the apt_repository module:  apt and
apt_pkg.  These come from the package python-apt.  This is used to parse
the host's sources.list and examine whether the repo is already
configured.  This then eliminates the unnecessary
'add-apt-repository --remove' from running.
2013-01-23 22:17:43 -08:00
4a9201ad65 add pkgin to list of package managers in setup 2013-01-23 22:12:13 -06:00
2eedec777f added first version of pkgin, just does install, remove (for SmartOS) 2013-01-23 22:10:11 -06:00
8eb7d740b0 Fixes hash merging
No need for deep copy (vars are essentially immutable once loaded, there
should not be any modifications)
2013-01-24 00:53:12 +01:00
5f5b7cc56b Merge pull request #1905 from bct/service-doc-formatting
Minor doc fix: service module 'state' parameter comments should be processed by RST
2013-01-23 15:47:19 -08:00
f18446e7a5 service module 'state' parameter comments should be processed by RST 2013-01-23 16:32:39 -07:00
e28e538c6e Adds user-selectable hash merging support in vars
Hash variables are currently overriden if they are redefined. This
doesn't let the user refine hash entries or overriding selected keys,
which can, for some, be a desirable feature.
This patch let the user force hash merging by setting the
hash_behaviour value to "merge" (without the quotes) in ansible.cfg

However, by default, ansible behaves like it always did and if any value
besides "merge" is used ("replace" is suggested in the example ansible.cfg
file), it will also behave as always.
2013-01-23 21:39:34 +01:00
3ce0c04b71 Update packaging/arch/PKGBUILD
Uploaded new version to AUR and bumped version.
2013-01-23 21:06:00 +01:00
51180fa344 Merge pull request #1900 from bostrick/devel
protect PluginLoader._extra_dirs from appending None
2013-01-23 11:03:24 -08:00
2b3d6d4545 protect PluginLoader._extra_dirs from appending None
PluginLoader.add_directory() can receive None from, for example, 
Inventory.add_directory(self.basedir()) if host_list is a custom list.
None has no reasonable interpretation other than ignore it.
2013-01-23 13:55:12 -05:00
a117944d0f Make env-setup work on Python 3 2013-01-23 19:48:13 +01:00
b8d0638449 Merge pull request #1897 from qjcg/pacman-pkg-mgr
Add pacman to list of package managers in setup module
2013-01-23 08:45:18 -08:00
f7694ac433 lambda fails on attribute access - g.name is a string not the group object 2013-01-23 11:44:23 -05:00
54ef6015f6 add pacman to list of package managers in setup module 2013-01-23 11:03:05 -05:00
ce9e9af6a3 ec2 facts moduled - updated 2013-01-23 09:39:26 -05:00
950e3052b8 Merge pull request #1890 from elventear/rabbitmq_contrib
RabbitMQ Contrib
2013-01-23 02:36:45 -08:00
a4b22b3a30 Merge pull request #1894 from ron1/devel
Update examples/ansible.cfg with sudo_exe
2013-01-23 02:35:37 -08:00
7d67ecfb2d Update examples/ansible.cfg with sudo_exe 2013-01-23 00:58:16 -05:00
3e75219f28 Merge pull request #1893 from bct/directory-organization-fix
Make diagram of Directory Organization best practice match the text.
2013-01-22 17:12:36 -08:00
ab63c24358 Make diagram of Directory Organization best practice match the text.
The text and playbook content assumed a directory structure that didn't
match the diagram.
2013-01-22 16:00:14 -07:00
cafb717b55 Fail gracefully if boto is not available and add me to the author line. 2013-01-22 14:29:28 -08:00
139aee58e2 use connect_ec2_endpoint instead of connect_euca, and properly pass keys to connect_ec2 2013-01-22 14:10:21 -08:00
1ab9bfa7cc ec2 module - registers to ansible_facts key 2013-01-22 15:31:51 -05:00
456e6f5a55 library/ec2:
- use boto instead of euca2ools
- improve error handling/propagation for run failures
- rename keypair to key_name (and preserve alias for old playbooks)
- should be 100% backward compatible with the euca2ools version
2013-01-22 12:09:31 -08:00
9dfa3ca88f Add my repo for RabbitMQ stuff 2013-01-22 13:23:58 -06:00
d4c0180494 Make service module daemonize for all the broken "daemons" out there 2013-01-22 20:21:08 +01:00
94a1c221bc Update variable precedence section with current rules 2013-01-22 16:56:04 +01:00
48f48e8a44 module must be passed to repolist too 2013-01-22 16:27:08 +01:00
7fadf6c976 Merge pull request #1887 from elventear/yum_fix
module needs to be passed to local_nvra
2013-01-22 07:26:15 -08:00
8b4bd2ec3e module needs to be passed to local_nvra 2013-01-22 09:03:45 -06:00
a16ddb57c1 Default module search path is included already
Adding it to runner's module_path makes it override local modules.
2013-01-22 15:42:49 +01:00
35b58955d6 Fix paramiko for when no private key is specified 2013-01-21 21:48:02 +01:00
ea45423f92 Merge pull request #1885 from vincentvdk/devel
added info of required packages to build rpms
2013-01-21 12:36:29 -08:00
4af54e8a3b stylistic change. 2013-01-21 20:49:43 +01:00
ef38e9f0e6 Merge pull request #1875 from cocoy/vars_prompt_default
Adding default on vars_prompt
2013-01-21 06:57:50 -08:00
1cae679271 Merge pull request #1881 from fdavis/when_changed_fail
add when_changed when_failed example to docsite
2013-01-21 06:57:02 -08:00
dabe49277a Merge pull request #1883 from tgerla/devel
--private-key tilde handling
2013-01-21 06:52:57 -08:00
614826bcda Fixed my typo and forgot a package 2013-01-21 15:28:16 +01:00
80f82f80d8 added info of required packages to build rpms 2013-01-21 15:22:12 +01:00
7899e29395 add when_changed when_failed examples to docsite
whitespace fix
2013-01-20 15:50:21 -08:00
495c4e6cff mention tilde fixes for --private-key in changelog 2013-01-20 13:34:38 -08:00
b814f3dc66 Correct --private-key argument name in Getting Started 2013-01-20 13:24:03 -08:00
4c64d0d6be Expand ~ shell shortcuts for the --private-key argument 2013-01-20 13:16:29 -08:00
7df3d811f2 Update changelog for things done for 1.0 thus far. 2013-01-20 11:30:24 -05:00
35c7ebf7a4 Revert "Update lib/ansible/utils/__init__.py"
Reported hanging of no-password sudo in some cases.  Need to explore.

This reverts commit 87f6739e20.

Conflicts:

	lib/ansible/utils/__init__.py
2013-01-20 09:05:07 -05:00
89eee7b868 Merge pull request #1880 from ron1/devel
Support sudo alternatives that offer sudo-compatible interfaces
2013-01-19 15:23:22 -08:00
280660b8a7 Support sudo alternatives that offer sudo-compatible interfaces 2013-01-19 08:40:32 -05:00
395093e0bf Move default arguments to the end of the function call. 2013-01-19 08:34:47 +08:00
e7223760c4 Merge pull request #1810 from davixx/sysctl
new module: sysctl to handle sysctl entry
2013-01-18 15:20:45 -08:00
c66d3200f8 Merge pull request #1670 from Afterburn/devel
Pacman module
2013-01-18 15:19:47 -08:00
c8fc353bc3 Merge pull request #1811 from fdavis/devel
add when_{failed,changed}, and extended when_{set,unset}
2013-01-18 15:18:00 -08:00
1721357a49 Merge pull request #1824 from jvantuyl/apt-key-module
add apt_key module
2013-01-18 15:16:32 -08:00
fa953ba6b3 Merge pull request #1867 from c0rner/devel
get_service_status() is now using self.service_control() to check status
2013-01-18 15:15:07 -08:00
bf03b0ee9a Merge pull request #1874 from fdavis/cfg
add filter_plugins to example ansible.cfg
2013-01-18 15:10:14 -08:00
bcdbb19549 Merge pull request #1872 from runekaagaard/devel
Service mod.: Proper(?) handling of return code 69
2013-01-18 15:09:58 -08:00
224b503b78 Merge pull request #1878 from leucos/patch-1
Fix sudo user env
2013-01-18 15:08:39 -08:00
87f6739e20 Update lib/ansible/utils/__init__.py
Adds -i to  make_sudo_cmd so target user's environment gets loaded when configurationslike this are used :


    - hosts: ubuntu 
      name: Install ruby for the configured ruby user 
      sudo: True 
      sudo_user: rubyuser 
      # should be ${ruby_user}, but can't for now because of #1665 
      tasks: 
      - name: Gets current ruby version 
        action: shell rbenv version 
        register: ruby_current_version
2013-01-18 16:03:50 +01:00
7ae100611c Adding default on vars_prompt 2013-01-18 19:00:57 +08:00
a278a60c34 add filter_plugins to example ansible.cfg 2013-01-17 13:13:02 -08:00
27ab2e55d3 Service mod.: Proper(?) handling of return code 69
This adds "69" to the return codes from the status command that should be
considered as not running. At least "django-celery" uses this return code,
maybe others::

    /venv/bin/python /code/project/manage.py celeryctl status
    echo $? # 69 when not running.

A bit of googling let me to http://tldp.org/LDP/abs/html/exitcodes.html and
on a Ubuntu Server 12.10 I get::

    ~# cat /usr/include/sysexits.h | grep 69
    #define EX_UNAVAILABLE	69	/* service unavailable */

I'm not sure if the content of sysexits.h is the same on other OS'es.
2013-01-17 10:13:05 +01:00
ad6373430b add apt_key module
Pretty straightforward.  Give it a URL with an exported GPG key for signing an
Apt repository.  It downloads it and will install it using apt-key.  It's even
smart enough to tell if it's already there (i.e. actually tells you if it
changed or not).
2013-01-15 17:34:38 -08:00
471ee0c90d get_service_status() is now using self.service_control() to check status
Fixes a bug where init-scripts were not used
2013-01-14 12:37:55 +01:00
f86974fdae Merge pull request #1866 from sfromm/issue1738-a
Various cleanup to run_command
2013-01-13 11:41:37 -08:00
4eaee3df0a Various cleanup to run_command
* Rename fail_on_rc_non_zero to check_rc, much more succinct.
* Simplify method defintion
* Fix command module and drop shell=shell option; whether to use
  shell is determined by if args is a list.
2013-01-13 11:24:21 -08:00
4f110e4fc6 Merge pull request #1865 from sfromm/issue1738
Add run_command to module_common and update modules to use it.
2013-01-13 08:44:33 -08:00
3fb21a5281 Update modules to use run_command in module_common.py
This updates apt, apt_repository, command, cron, easy_install, facter,
fireball, git, group, mount, ohai, pip, service, setup, subversion,
supervisorctl, svr4pkg, user, and yum to take advantage of run_command
in module_common.py.
2013-01-13 08:37:19 -08:00
300531507b Add method run_command to module_common.py
This adds a helper method that modules can call to execute a command via
subproces.  It takes two arguments: the command to run and
keyword options that control how the process is executed.  Supported
options are: fail_on_rc_non_zero, close_fds, and executable.
fail_on_rc_non_zero will call fail_json if the command fails.  If
args is a list, the command will be run with shell=False; otherwise, if
a string, it will be run with shell=True.  Otherwise, run_command() returns
the returncode, stdout, and stderr.
2013-01-13 08:30:33 -08:00
5d067497e3 Enable --list-hosts with a list of hosts 2013-01-13 15:29:32 +01:00
a19a13ffa7 Add check for multiple keys in one invocation 2013-01-13 15:16:13 +01:00
d11262af4d Fix raw (no executable) support on -c local 2013-01-13 15:16:13 +01:00
5231be5d4b Add sudo password support for local 2013-01-13 15:16:13 +01:00
7ecab22302 Move sudo command making to one common function 2013-01-13 15:16:13 +01:00
c339434e57 Merge pull request #1863 from blair/remove-unused-sys-import
hacking/env-setup: remove unused sys import.
2013-01-13 05:54:42 -08:00
630a8055c1 Merge pull request #1864 from eval/git-module-prevent-permission-denied
Prevent permission denied when cloning
2013-01-13 05:52:52 -08:00
f4dcb33ccc Prevent permission denied when cloning
Without read permission to the current working directory, git-clone will
fail:
root@host:~$ sudo -u git -H git clone \
  git://github.com/ansible/ansible.git /home/git/ansible
fatal: Could not change back to '/root': Permission denied

This commit ensures that the working directory is changed to the
parent-folder of the destination before doing the clone.
2013-01-13 13:07:22 +01:00
ec5f6ae246 hacking/env-setup: remove unused sys import. 2013-01-12 19:07:50 -08:00
b0ab81b237 Merge pull request #1862 from jpmens/doc-ex-ssh
typo in ssh private key name
2013-01-12 10:18:56 -08:00
fc3f50454d typo in ssh private key name 2013-01-12 15:54:21 +01:00
1cbc9569b3 Merge pull request #1853 from jure/more_info_from_ec2
EC2 module should report back the public_dns_name too
2013-01-10 16:07:55 -08:00
060266e291 Python 2.4 fixes for modules 2013-01-10 19:24:23 +01:00
3bc6228b97 Handle unreadable /proc/xen/capabilities
Fixes #1854.
2013-01-10 18:22:01 +01:00
3f43ede70c Fix indentation 2013-01-10 16:21:18 +01:00
2ee05f0c96 EC2 module should report back the public_dns_name too. 2013-01-10 16:14:47 +01:00
b9442b2468 Merge pull request #1845 from leucos/patch-1
Updates Arch PKGBUILD to include other man pages
2013-01-10 05:06:59 -08:00
f095f7c8c5 Merge pull request #1851 from Pinkbyte/distribution_fix
Fix distribution detection - return string instead of functions
2013-01-10 05:03:17 -08:00
e41f89d507 Fix distribution detection - return string instead of functions 2013-01-10 15:13:35 +04:00
9649e4bf15 Merge pull request #1838 from jvantuyl/with_sequence
add with_sequence lookup plugin
2013-01-09 16:18:17 -08:00
13ddd39db9 add with_sequence lookup plugin
Plugin allows you to do easy counts for items.
2013-01-09 15:30:24 -08:00
b57b1f4cbe Correct name is login_user
Fixes #1848.
2013-01-09 23:57:36 +01:00
0526d08b85 Updates Arch PKGBUILD to include other man pages
Man pages for ansible-pull and ansible-docs are now installed properly
2013-01-09 17:28:55 +01:00
a699685698 Merge pull request #1844 from dagwieers/import-fix
Revert the import of C in script
2013-01-09 07:03:26 -08:00
fb802beee7 In PR #1804 the use of C in script was moved to _low_level_execute_command()
So we cannot get rid of this one now.
2013-01-09 15:54:10 +01:00
7782923ea2 Revert #1818 but avoid double-dwim, fixing relative fileglob 2013-01-09 14:52:52 +01:00
891b1e371a Default to not using an executable
For compatibility with older releases as well as avoiding things like
action: raw executable= show status
to communicate with devices that don't have sh.
2013-01-09 14:15:47 +01:00
92ad206b84 Use re instead of shlex.split to find executable
shlex.split will strip quotes and it might not even be sh at this point.
2013-01-09 14:13:53 +01:00
910667152c Merge pull request #1843 from dagwieers/import-cleanup
Clean up imports (taken from PR #1804)
2013-01-09 04:56:58 -08:00
b781438480 Clean up imports (taken from PR #1804) 2013-01-09 13:51:27 +01:00
87b2378e22 Resolve variable references inside variables
Fixes the case where variable x is '$y' and y is a dict(foo='bar') and
an attempt to access ${x.foo} is made.
2013-01-09 13:45:55 +01:00
073fb21bcb Document that task includes are now infinite depth 2013-01-09 13:41:14 +01:00
fe310dcff1 add when_failed, when_changed, and extended when_set/unset
This commit extends the 'when_' conditions to failed and changed
json results

Additionally it makes when_{set,unset,failed,changed,int,str,flt}
behave more similiarily in that they all except and/or/not logic
2013-01-08 19:51:48 -08:00
1b5d039bf4 Extend executable= support in raw to include no execuable
Useful for managing not-UNIX things.
2013-01-08 17:45:37 +01:00
4955587d8c Merge pull request #1798 from dagwieers/raw-executable
Allow to change executable (shell/interpreter) when using raw
2013-01-08 08:35:08 -08:00
c23eda82c2 Allow pattern[0] to address a single node
Replaces erroring out on it and requiring the abysmal pattern[0-0]
instead.
2013-01-07 18:20:09 +01:00
03ab074d0d Merge pull request #1821 from leucos/path-expand-fix
Expands path on file operations
2013-01-07 05:05:20 -08:00
713ce4c0cf Merge pull request #1832 from legrostdg/devel
add encoding documentation in postgresql_db
2013-01-07 05:03:39 -08:00
3f4847a3ab Merge pull request #1830 from willthames/fix_tilde_path_in_file
Fix behaviour when file handles a path with tilde
2013-01-07 05:03:09 -08:00
0ba7cf58e9 add encoding documentation in postgresql_db 2013-01-07 12:58:18 +01:00
4e50478a05 Fix behaviour when file handles a path with tilde
Two problems here
* unchecked exception handling and erroneous assumption as to why
  an exception might fire
* although the file module expands the path, when using file_args
  the unexpanded path is passed.

Expected result: ~/path/to/file should work fine
Actual result: exception is because it doesn't find file with a message
about not being able to get the selinux context
2013-01-07 16:30:29 +10:00
4d48daff80 Actually allow using connection: on a task 2013-01-06 18:46:34 +01:00
637370089a Skip polling when all hosts were skipped
Fixes #1823.
2013-01-06 16:49:29 +01:00
1fa83fa584 Merge pull request #1813 from legrostdg/devel
postgresql_db fails with owner containing a "-"
2013-01-06 07:34:29 -08:00
02f531c609 remove quotes in has_table_privilege and has_database_privilege 2013-01-05 19:31:31 +01:00
947ec34116 Merge pull request #1807 from willthames/openlog_unicode_fix
syslog.openlog does not cope with unicode first argument
2013-01-05 08:17:03 -08:00
04f7066745 Merge pull request #1822 from leucos/pkgbuild-fix
Arch PKGBUILD fixes
2013-01-05 08:13:46 -08:00
d9c76dab57 Changes URL to ansible.cc
Removed github URL in favor of ansible.cc
2013-01-05 16:46:50 +01:00
451868630d Merge pull request #1817 from chrisberkhout/devel
git module documentation: removed incorrect use of term 'remote branch' ...
2013-01-04 19:26:52 -08:00
435905defa Merge pull request #1826 from willthames/new_template_variables
Added additional template variables
2013-01-04 15:31:14 -08:00
8efa62b0ea new module: sysctl to handle sysctl entry
sysctl now capable to search for sys entry into /sys if not under /proc/sys

module/sysctl rolling back to 0.5

write sysctl.conf safely, tempfile first, atomic replace after.
See comments in  https://github.com/ansible/ansible/pull/1810

Patch to replace .format with % () to handle python-2.4 ,
See also https://github.com/ansible/ansible/pull/1810

using name instead key for default arg name. key putted as alias.
also, val become an alias of value arg name.
See also : https://github.com/ansible/ansible/pull/1810
2013-01-04 21:55:48 +01:00
8a262c2b20 add documentation for "template" parameter in postgresql_db 2013-01-04 15:16:05 +01:00
7d7e7fb8bc Adds path expansion to two other methods
set_owner_if_different and set_group_if_different seems to need path
expansion too
2013-01-04 13:41:31 +01:00
cd7fe9875c use double-quotes in postgresql commands (fix bug with "-") 2013-01-04 12:48:29 +01:00
411b2bf7d9 Added additional template variables
Added two additional template variables
* template_fullpath - absolute path to the template
* template_run_date - date that the template was rendered
Documented these additional variables in the module documentation
2013-01-04 16:36:02 +10:00
caee51e90e Allow only_if/when_* on task includes and apply it on all tasks within 2013-01-04 00:15:13 +01:00
07b215d4fa Check for non-accepted arguments combined with task includes
Throw an appropriate error for it.
2013-01-03 23:36:42 +01:00
68f736e8d7 Make inventory variables available to vars_files 2013-01-03 23:16:38 +01:00
a1877b2213 Allow infinite depth task includes 2013-01-03 23:01:04 +01:00
4555cdc49c Allow using connection: on the task level
This is the name of the setting on the play level, and the options.
Should be consistent.
2013-01-03 21:27:01 +01:00
f72317d71e Arch PKGBUILD fixes
Adds examples in package
Changes json dependency to python2-simplejson, reflecting the new
package name
Removed duplicate python2-yaml
2013-01-03 20:54:13 +01:00
0037a19389 Expands path on file operations
Path might have to be expanded on some operations. It seems that path
containing '~' are not.
Using os.path.expanduser in appropriate places solves the problem, but
this might be required in many other places.
2013-01-03 16:39:57 +01:00
e93ed2c167 Merge pull request #1818 from sfromm/issue1815
Update path_dwim() to return absolute path
2013-01-02 22:04:16 -08:00
2100a35663 Update path_dwim() to return absolute path
If path_dwim() is provided a relative path to a file, it will now return an
absolute path of the playbook directory + the relative file path.
2013-01-02 21:53:00 -08:00
c01bc23f63 git module documentation: removed incorrect use of term 'remote branch' (should just be 'remote'). 2013-01-03 16:00:25 +11:00
5ef077e58c syslog.openlog does not cope with unicode first argument
It seems that os.path.basename(__file__) can return a unicode
string. In this case syslog.openlog fails. Forcing the result
to a string causes the resulting error to go away.
2012-12-27 14:54:16 +10:00
b54bb2dfed Merge pull request #1799 from dagwieers/raw-script
Make script module use raw module so it does not require python
2012-12-24 07:50:57 -08:00
4f37e89686 Merge pull request #1802 from francisbesset/added_selected_playbook
[docsite] Added LEMP selected playbook
2012-12-24 07:42:19 -08:00
e246304256 [docsite] Added LEMP selected playbook 2012-12-24 12:25:17 +01:00
eb36ff45b9 Make script module use raw module so it does not require python 2012-12-24 00:24:34 +01:00
846161a1a4 Allow to change executable (shell/interpreter) when using raw
This patch adds an optional 'executable=' option to the raw command line to override the default shell (/bin/sh), much like the shell module does.
2012-12-23 20:49:02 +01:00
3d3deb9797 Merge pull request #1795 from dagwieers/raw-enhanced
Add return code and error output to raw module
2012-12-23 09:34:57 -08:00
988db558b3 Add return code and error output to raw module
Since we use 'raw' heavily on equipment where 'command' and 'shell' are not (yet) working (and python may need to be installed first using raw) these improvements are necessary in order to write more complex scripts (with return code handling and separated stdout/stderr).

This change includes the following changes:

 - exec_command() now returns the return code of the command
 - _low_level_exec_command() now returns a dict, including 'rc', 'stdout' and 'stderr'
 - all users of the above interfaces have been improved to make use of the above changes
 - all connection plugins have been modified to return rc and stderr
 - fix the newline problem (stdout and stderr would have excess newlines)

In a future commit I intend to add assertions or error handling code to verify the return code in those places where it wasn't done. Since only the output was available, the return code was ignored, even though we expect them to be 0.
2012-12-23 18:04:54 +01:00
7620db4e99 Merge pull request #1796 from jpmens/crondoc
fix cron DOCUMENTATION
2012-12-23 08:12:36 -08:00
85e0017a85 fix cron DOCUMENTATION 2012-12-23 14:08:26 +01:00
d154183978 Merge pull request #1792 from jkleint/patch-1
Clarify that lineinfile uses Python regexes.
2012-12-21 04:52:43 -08:00
d732b25828 Clarify that lineinfile uses Python regexes. 2012-12-20 11:41:45 -05:00
d4c63e3300 Ensure each basedir is only added to the search path once
Fixes #1790.
2012-12-20 14:17:12 +01:00
3a36c024da Make lookups being fatal up to the caller
Fixes #1769.
2012-12-19 19:19:04 +01:00
eb57c9c430 Indicate the reboot option was added in 1.0
Fixes #1787.
2012-12-19 18:45:33 +01:00
6fc6c37401 Merge pull request #1785 from TutoringAustralasia/devel
Add support for @reboot to cron module
2012-12-19 04:46:27 -08:00
97cc384ccf Set basedir to . if there isn't one
This avoids special-casing '' = '.' everywhere the basedir gets used.
Fixes #1729.
2012-12-19 13:22:57 +01:00
0f1706220b Add support for using the Jinja2 built-ins such as range 2012-12-19 09:42:15 +01:00
ab9e9486ee Merge pull request #1783 from gregorg/fix_bug_python_2.5_json
Bugfix: in hosts with python-2.5, hash keys needs flatten string.
2012-12-19 00:15:09 -08:00
96e2805b31 Change check for date/time parts being set 2012-12-19 15:12:04 +11:00
6a02e3d918 Added error message when reboot and extra params are passed, and added better boolean parsing on reboot 2012-12-19 13:11:58 +11:00
fc4ac70342 Add support for @reboot to cron module 2012-12-19 09:32:51 +11:00
d34e320e12 Merge pull request #1733 from dhozac/lookup-list
Make all lookup plugins accept lists as arguments
2012-12-17 16:53:01 -08:00
04195e202d Merge pull request #1747 from njharman/alpharange
Alphabetic inventory hostname patterns.
2012-12-17 16:52:11 -08:00
4bcdd24688 Merge pull request #1776 from junegunn/inventory-group-var-ws
Allows whitespaces around assignment operators when defining group variables
2012-12-17 16:51:49 -08:00
2699ef3c41 Merge pull request #1782 from candeira/fix-playbook2-documentation
fix documentation for authorized_key in advanced playbooks page in docsite
2012-12-17 16:51:24 -08:00
dac83c15a0 fix documentation for authorized_key in advanced playbooks page in docsite 2012-12-18 07:23:40 +11:00
29f985aa2e do not conditionalize this for older Python, fix indentation, better use
of hash iteration.
2012-12-17 21:07:36 +01:00
e64de2ff88 Bugfix: in hosts with python-2.5, hash keys needs flatten string. 2012-12-17 13:46:50 +01:00
a6f01dcd6f version 1.0 eruption 2012-12-16 23:21:35 +01:00
0bdd17ff3a updated description and examples 2012-12-16 23:18:42 +01:00
89dab0b12c Merge pull request #1766 from dhozac/complex-vars-in-playbook-include
Allow parameterized playbook includes to define complex variables
2012-12-16 10:59:53 -08:00
8896486606 Adds comments on handling quoted group vars 2012-12-16 10:32:05 +09:00
c2792a936d Allow parameterized playbook includes to define complex variables
To be used like:
- include: playbook.yml
  vars:
    mylistvar:
    - item1
    - item2
2012-12-15 21:56:28 +01:00
b73016b881 Make all lookup plugins work with lists
Lookup plugins should accept a string or a list, and always return
a list, even if it is just one item.
2012-12-15 21:47:16 +01:00
6350dedd7a Merge pull request #1765 from dagwieers/skip-when-no-matches
Change message when a play matches no hosts
2012-12-15 11:59:37 -08:00
ad2ab6a5dd Merge pull request #1772 from fdavis/devel
change error message on check_conditional when variable does not exist
2012-12-15 11:58:52 -08:00
dede11750c Merge pull request #1775 from dagwieers/boolean-yes-no
Make use of yes/no booleans in playbooks
2012-12-15 11:53:48 -08:00
29611bdedf Merge pull request #1777 from dominis/devel
fixes #1767 parsing serial from extra_vars
2012-12-15 11:52:40 -08:00
d4b1874d44 Merge pull request #1773 from jpmens/scriptdoc
fix and clarify 'script' docs
2012-12-15 09:28:50 -08:00
92365d4740 Merge pull request #1778 from junegunn/fix-hostname-expansion
Fix hostname expansion bug in inventory parser
2012-12-15 09:20:35 -08:00
7fbb7e079a Fix hostname expansion bug in inventory parser 2012-12-16 01:49:12 +09:00
f31fbdff1f moving int() conversion to the play init 2012-12-14 18:05:08 +01:00
292ae0ac00 Merge pull request #1774 from jpmens/adoc1
cleanup Example output in ansible-doc
2012-12-14 09:02:21 -08:00
e91db5fcdc fixes #1767 parsing serial from extra_vars 2012-12-14 13:21:58 +01:00
daf797804b Allows whitespaces around assignment operators
when defining group variables
2012-12-14 20:43:29 +09:00
66fb7fd9de Make use of yes/no booleans in playbooks
At the moment Ansible prefers yes/no for module booleans, however booleans in playbooks are still using True/False, rather than yes/no. This changes modifies boolean uses in playbooks (and man pages) to favor yes/no rather than True/False.

This change includes:

- Adaptation of documentation and examples to favor yes/no
- Modification to manpage output to favor yes/no (the docsite output already favors yes/no)
2012-12-14 11:56:53 +01:00
52a55a3575 cleanup Example output in ansible-doc 2012-12-14 11:12:26 +01:00
4f8abd981a fix and clarify 'script' docs 2012-12-14 10:59:48 +01:00
7347e54b70 change error message on check_conditional when variable does not exist 2012-12-13 23:02:30 -08:00
23f2a7fc7e Merge pull request #1771 from sfromm/issue1762
Ensure files created by authorized_key have correct selinux context
2012-12-13 16:39:29 -08:00
ccca5fcd1c Ensure files created by authorized_key have correct selinux context
Three changes:
* Add set_default_selinux_context() to module_common that sets
  a file's context according to the defaults in the policy
* In atomic_replace(), set the default context for the file if
  selinux is enabled and the destination file does not exist.
* In authorized_key, set the default context when creating
  $HOME/.ssh and $HOME/.ssh/authorized_keys.  If these already
  exist, this won't touch them.
2012-12-13 16:35:49 -08:00
bf73ac76be Merge pull request #1770 from jkleint/patch-1
Missing colon in $FILE example docs
2012-12-13 13:25:00 -08:00
e363abeca7 Missing colon in $FILE example 2012-12-13 16:21:25 -05:00
f2893b6418 Merge pull request #1746 from njharman/subversion
Subverion module improvements
2012-12-13 04:34:19 -08:00
cd930d2e34 Change message when a play matches no hosts
I guess my previous pull request was confusing, by changing the message to something we already do for tasks, it makes it more clear.

Just like we say:

    TASK: [foo bar]
    skipping: [system01]

The message now is more clear:

    PLAY [wagawaga] *******************************
    skipping: no hosts matched

It makes it clear that we are skipping the play, just as is done for a task when a condition is not met.
2012-12-13 13:31:41 +01:00
5d31e8d1fc Merge pull request #1752 from jpmens/mail2
mail module: add MIME attachments, port and addresses with phrases
2012-12-13 04:31:01 -08:00
ddc0507f65 Passing in module instead of just fail_json per upstream request. 2012-12-12 16:55:30 -06:00
aff6ae47ed Merge pull request #1741 from christopher-snapp/list-hosts
add list-hosts support to bin/ansible
2012-12-12 14:52:06 -08:00
70bb7d1e54 Merge pull request #1696 from gregorg/enhance_limit
Allow regex to be used to select hosts in addition to fnmatch pattern
2012-12-12 14:51:44 -08:00
f63904fd45 Merge pull request #1750 from dhozac/intersection-host-pattern
Allow intersecting host patterns by using &
2012-12-12 14:47:32 -08:00
ea5d79a712 Merge pull request #1755 from lorin/patch-1
Fix ppa syntax in apt_repository module doc
2012-12-12 14:47:10 -08:00
42f769637e Merge pull request #1749 from jpmens/andoc3
ansible-doc: print Notes heading only if there are any
2012-12-12 14:46:42 -08:00
f7c7797142 Merge pull request #1764 from njharman/pip
pip module improvements
2012-12-12 14:46:25 -08:00
70dbc81029 Merge pull request #1756 from marktheunissen/fix-ec2-inventory-path
Tweak docs for correct paths and filenames for ec2 inventory
2012-12-12 14:44:33 -08:00
19b84d0527 pip module improvements
- Do not silently ignore malformed pip requirements files.
- Properly reports changed when removing packages.
- "latest" i.e. --upgrade is *not* incompatible with requirements files.
- Less branchy, simpler logic.
- Removed pointless variable "initializations", Python doesn't need that.
  Other code simplifications.
- Fun fact; pip install is (kind of) case insensitive, pip freeze is not.
  So, 'sqlalchemy' will be reported as installed by install, but missing
  by freeze.

The perhaps controversial change and the one that led to finding /
fixing above issues...

Instead of adding command parameters 'index', and 'find', and 'mirrors',
and etc.  Added 'extra_args' which are passed onto pip.

The use case for --index-url is having a private pypi repo, like
http://pypi.python.org/pypi/localshop, to which you publish private
packages.  I'm sure most every pip option has a use case for someone.
extra_args handles all those. Can reserve ansible command parameters for
the most common.

Tested with pip 1.1.
2012-12-12 15:40:25 -06:00
52be556e1f Merge pull request #1760 from skvidal/devel
if user has manually installed an intermediate version - don't ignore it...
2012-12-12 09:43:24 -08:00
165861dd2f if user has manually installed an intermediate version - don't ignore it: issue 1754 2012-12-12 11:52:35 -05:00
54b45e9bd4 Allow intersecting host patterns by using &
This allows patterns such as webservers:!debian:&datacenter1 to target
hosts in the webservers group, that are not in the debian group, but are
in the datacenter1 group. It also parses patterns left to right.
2012-12-12 11:36:12 +01:00
660bb43e21 Tweak docs for correct paths and filenames 2012-12-12 11:55:52 +02:00
2fd7d7149f Merge pull request #1753 from skvidal/devel
make --list-hosts expand out extra vars in the hosts: field
2012-12-12 00:02:33 -08:00
f9755ca36d mail module: add MIME attachments, port and addresses with phrases
Add HTML-escaping to code examples in rST tempate of module-formatter
 Add support for specifying port, addresses with phrases and attaching files
 Add support for custom headers and document version_added for new options
 X-Mailer header added :)
 protect empty address lists & attachment list, and add bcc
2012-12-12 07:42:42 +01:00
f8821fa3d9 Fix ppa syntax in apt_repository module doc
The example for using a ppa had the wrong syntax.

Ironically, the correct syntax is illustrated in a comment on line 23.
2012-12-11 23:01:36 -05:00
0f6669fafe make --list-hosts expand out extra vars in the hosts: field 2012-12-11 14:12:10 -05:00
e913fb8732 print Notes heading only if there are any 2012-12-11 08:26:12 +01:00
6603737e4d Alphabetic inventory hostname patterns.
- Code, docs, tests.
  - Also added test of large range 000-142 to verify alpha range did not
    break this.
2012-12-10 20:48:38 -06:00
2e6999dab9 Subverion module improvements
- Added username, password arguments.
  - Documented existing revision argument.
  - Corrected documentation/docstrings; removed git references, use svn
    nomenclature, etc.
  - Refactored duplicate code, redundant shell calls, filter abuse,
    inconsistent formating, etc.
  - Shell quoting so it doesn't break for one guy who has spaces in
    pathnames.
  - svn called with '--non-interactive' and '--no-auth-cache'.
2012-12-10 20:34:26 -06:00
959a461080 Merge pull request #1718 from jpmens/andoc2
CLI: ansible-doc rebased
2012-12-10 15:44:32 -08:00
8655f64e68 add --list-hosts support to bin/ansible
add error handling when no arg passed to command module
2012-12-09 09:05:43 -05:00
637883164e Merge pull request #1720 from bladypirat/devel
added support for scheduling downtime for all services on host
2012-12-07 08:00:15 -08:00
8e8c0c4a96 Merge pull request #1736 from abourget/document_supervisorctl
supervisorctl: document the 'present' option
2012-12-06 11:32:24 -08:00
0b9cbcb270 supervisorctl: document the 'present' option 2012-12-06 13:33:00 -05:00
cc76b4f5b1 Merge pull request #1728 from dagwieers/nameerror-fix
Fix "NameError: global name 'name' is not defined" exception
2012-12-05 10:34:36 -08:00
ac2f396379 Fix "NameError: global name 'name' is not defined" exception 2012-12-05 18:48:43 +01:00
11b64314df Select all fields from the user, as some of them are version-dependent 2012-12-05 09:51:40 +01:00
65413dc778 Merge pull request #1724 from sfromm/issue1722a
Further refine remote branch tracking in b1ec6e8
2012-12-04 17:15:44 -08:00
1bcfdd94f3 Further refine remote branch tracking in b1ec6e8
Move operations that are dependant on a remote branch under a if
is_remote_branch() conditional.  While at it, remove assignment to cmd
string in same block that wasn't used when calling _run().
2012-12-04 17:02:54 -08:00
ba4f71db27 Moved docs about "--limit=~REGEX" from man page to asciidoc. 2012-12-04 21:08:29 +01:00
1d910bb4e3 Merge pull request #1723 from sfromm/issue1722
Fix git module to update branch to latest when using version=<branch>
2012-12-04 11:56:08 -08:00
b1ec6e8163 Fix git module to update branch to latest when using version=<branch>
The git module would not pull in updates to a branch when
version=<branch>.  This updates that block to checkout the branch
and then do a git reset --hard <remote>/<branch>.  This
should now track updates to a branch.
2012-12-04 11:40:48 -08:00
5809807bc1 Merge pull request #1721 from dagwieers/import-errno
Import errno to avoid 'NameError: global name 'errno' is not defined'
2012-12-04 10:41:12 -08:00
dd4ac46397 Import errno to avoid 'NameError: global name 'errno' is not defined'
I hit the following exception because errno is referenced but not imported.

```
fatal: [system01] => failed to parse: Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 782, in <module>
    main()
  File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 117, in main
    module.atomic_replace(dest_tmp, dest)
  File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 772, in atomic_replace
    if e.errno != errno.EPERM:
NameError: global name 'errno' is not defined
```
2012-12-04 19:27:22 +01:00
9c20eb089b added support for scheduling downtime for all services on host 2012-12-03 22:40:27 +01:00
77e060250c CLI: ansible-doc rebased 2012-12-03 09:01:04 +01:00
dbf5a57a5a Merge pull request #1683 from bcoca/template_override
Template override
2012-12-02 10:15:10 -08:00
a74cae208d Merge pull request #1715 from sfromm/issue1713
Further tweak how to find pip in virtualenv on centos/redhat/fedora
2012-12-02 08:17:01 -08:00
5b7c8fcc38 Further tweak how to find pip in virtualenv on centos/redhat/fedora
In a virtualenv, pip is called just pip.  This fixes the pip module to
search for the virtualenv pip first before trying the pip-python and
python-pip variants.  Without this, pip module would not install to the
virtualenv when that parameter is provided.
2012-12-02 08:13:10 -08:00
1e7526ee78 Merge pull request #1714 from sfromm/issue1712
Make use of mirrors in pip module configurable with use_mirrors option
2012-12-02 08:11:24 -08:00
e33e02950d Make use of mirrors in pip module configurable with use_mirrors option
Older versions of pip (anything less than 1.0?) do not support
--use-mirrors flag.  This makes it configurable.  Default is yes.
2012-12-02 08:04:27 -08:00
e54b4b1c9a Ignore arguments when checking for interpreter, and re-add before use 2012-12-02 14:28:52 +01:00
d5a456fbcf Merge pull request #1697 from bcoca/mint
Implements multiple interpreter overrides
2012-12-02 05:28:28 -08:00
ffac7ce2f9 Merge pull request #1687 from dhozac/allow-grouping-in-external-inventory
Allow inventory scripts to define groups of groups and group vars
2012-12-02 05:26:54 -08:00
8bc1b69c58 Add a unit test to subset limiting via a regex, and some doc in man
page.
2012-12-02 10:18:58 +01:00
89efd35c5a Merge pull request #1710 from sfromm/issue1705
Fix pip module to check if requirements already installed
2012-12-01 20:01:50 -08:00
d277953a53 Fix pip module to check if requirements already installed
This updates _is_package_installed() to accept a requirements file
as an argument.  This is used later in main() to check if python libs
specified in a requirements file are already installed.  I updated
main() to consolidate the handling of install/uninstall in a single
block.  This should help if someone wants to remove packages specified
by a requirements file.
2012-12-01 20:00:21 -08:00
fdf37b8c6c Merge pull request #1709 from dagwieers/rpm-version-fix
Updated ansible version to align with RPM package
2012-12-01 10:40:11 -08:00
c65c00cb34 Updated ansible version to align with RPM package 2012-12-01 16:37:10 +01:00
7a6267ec36 Update changelog 2012-11-30 22:27:06 -05:00
5890a2a9da Release stuff 2012-11-30 22:06:25 -05:00
9afb7c1ed0 Get ready to release 0.9 2012-11-30 22:03:31 -05:00
17f31a2a79 CLI: ansible-doc shows lists of modules & module docs on command-line
check path is directory
added manpage & setup
small cleanup
shut up module_formatter in utils to avoid trace print on crud files in library
2012-11-30 21:57:25 -05:00
8d309e0fa3 Allow inventory scripts to define groups of groups and group vars 2012-11-28 23:37:29 +01:00
b8d6dec5ad Reset notified_by list per serialized batch
Fixes the case where a handler attempts to run for every batch after any
batch has notified it, regardless of whether the current batch did.
2012-11-28 22:04:44 +01:00
a56e1f31fa Properly restrict hosts after 9070875 2012-11-28 22:03:23 +01:00
f6245e17c1 Skip evaluating only_if for BYPASS_HOST_LOOP plugins 2012-11-28 21:37:30 +01:00
bda08c8a1b Avoid creating temporary directory for some action plugins
This ensures we don't litter remote systems with temporary directories
that don't get cleaned up, as well as speeds things up from not having
to touch every node.
2012-11-28 21:34:55 +01:00
f6e7381a71 Evaluate only_if in group_by 2012-11-28 16:22:58 +01:00
93fe43f0c4 Merge pull request #1701 from dhozac/serial-skip-failed
Skip already failed hosts for serial
2012-11-28 05:07:23 -08:00
8690854662 Merge pull request #1703 from igalic/svn-doc-fix
Fix subversion module's documentation
2012-11-28 05:01:17 -08:00
1ba5c5ae97 : doesn't work in this documentation. 2012-11-28 10:36:22 +01:00
e031054934 Fix subversion module's documentation
Let our users determine what they want to do with a given module.
Particularily when the mdoule doesn't pose any such restrictions.
2012-11-28 10:02:20 +01:00
9070875a6f Move available hosts gathering to a common function 2012-11-28 01:03:18 +01:00
5065103017 Skip already failed hosts
Fixes #1699.
2012-11-28 00:54:08 +01:00
c948c65bcd Template the name of the task
Broken by 1e0295c. Fixes #1698.
2012-11-28 00:36:10 +01:00
2f2bd87b06 multiple _interpreter overrides with ansible_<bin>_interpreter variables, not
just for python anymore
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-27 11:18:57 -05:00
8ef2807305 removed env as per project policy
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-27 11:18:46 -05:00
dde01dabc3 Squashed commit of the following:
commit 48069adf0f
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Tue Nov 27 10:13:08 2012 +0100

    Removing this plugin from this branch.

commit 15400fffe6
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Tue Nov 27 09:53:16 2012 +0100

    Enhance _match function in inventory with regex.
    --limit ~regex could be used to filter hosts or group with a regex.
    Tested on cli and ansible-playbook.

commit 63c1b2e17e
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Tue Nov 27 09:03:41 2012 +0100

    Revert pull request #1684

commit 7c2c6fee3a
Merge: f023a2f dd5a847
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Tue Nov 27 08:52:53 2012 +0100

    Merge remote branch 'upstream/devel' into devel

commit f023a2f3df
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Mon Nov 26 20:52:27 2012 +0100

    Add an inventory plugin to fetch groups and host from our CMDB.

commit c64193b4c6
Author: Gregory Duchatelet <skygreg@gmail.com>
Date:   Mon Nov 26 20:43:30 2012 +0100

    Added possibility to filter hosts from a group, with a regex, separating
    groupname and regex with a ~
    Usage in group pattern: group~filterpattern
    Samples:
    ansible group~server-0[1236] -m ping
    ansible web~proxy -m ping
    ansible web~(proxy|frontend) -m ping
2012-11-27 16:36:58 +01:00
24dadb3c27 Merge pull request #1693 from phgrau/phg/typo
dpkg -l does not install package, use dpkg -i <package-file> instead
2012-11-27 06:47:29 -08:00
1a3fcffbfb dpkg -l does not install package, use dpkg -i <package-file> instead 2012-11-27 15:24:38 +01:00
900790af41 Reuse inventory object created by ansible-playbook in playbook
This reduces the amount of times an inventory script has to be invoked.
2012-11-27 15:24:33 +01:00
d703f92077 Disable authentication methods that weren't specified 2012-11-27 15:24:33 +01:00
5a3301289f Merge pull request #1692 from jpmens/ini_file2
ini_file: prohibit section name 'default'
2012-11-27 05:52:15 -08:00
304d06a563 Merge pull request #1689 from sfromm/issue1644
Set LANG in module_common.py
2012-11-27 05:29:10 -08:00
910f1c042e ini_file: prohibit section name 'default'
allow update of default section
add blurb re template to create base file
2012-11-27 13:21:48 +01:00
6a68d3813f Set LANG in module_common.py
Add constant DEFAULT_MODULE_LANG that defaults to C.  Can be set via
environment variable ANSIBLE_MODULE_LANG or configuration variable
module_lang.  Updated test-module to have same behavior.
2012-11-27 00:16:06 -08:00
dd5a8474f8 Have module formatter ignore more types of files. 2012-11-26 18:50:26 -05:00
21d858f36d Document new types of plugins. 2012-11-26 18:47:33 -05:00
da90c5f75e Document 'when' and tweak the code to be a little more comprehensive on what is false. 2012-11-26 18:37:44 -05:00
08b3c77dc7 Tweak docs 2012-11-26 18:29:54 -05:00
c8d004434f Limit seperator docs. 2012-11-26 18:29:27 -05:00
9870224991 Tweak fireball docs for 0.9 2012-11-26 18:27:55 -05:00
43bdec8b20 Throw an error if multiple actions have been specified 2012-11-26 22:42:44 +01:00
1e0295c7e2 Template handlers late
This allows overriding variables in name, and removes templating from
parsing.
2012-11-26 22:07:57 +01:00
ebd31af940 Don't prompt for vars in extra-vars
Fixes #1622.
2012-11-26 22:07:57 +01:00
94fc3006e9 Make variables local to the play
Fixes #1677.
2012-11-26 22:07:57 +01:00
fa63e9ce1f Merge pull request #1680 from eest/fix_fbsd_enable
Rework FreeBSD "enabled" code
2012-11-26 12:18:17 -08:00
d7f38d07b3 fixed bug for string size mismatch, now substring depends on size of match string Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-26 10:41:13 -05:00
6a1e2aaff5 moved override matching string to variable changed test template to match Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-26 10:41:13 -05:00
d751d88b48 added test for template overrides Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-26 10:41:13 -05:00
68f5d69365 added ability to override jinja enviornment from first line of template Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2012-11-26 10:41:13 -05:00
d4af9e4c5c Use shlex for rc.conf parsing.
This makes the line parsing a lot more robust (and easier to read).
Code supplied by @dhozac, thanks!

Remove re import because this is not used anywhere.
2012-11-25 13:09:54 +01:00
fde00327b0 Rework "enabled" implementation for FreeBSD.
When trying to perform enabled=yes followed by enabled=no
against FreeBSD the module would die with the following error:
TypeError: sub() takes at most 4 arguments (5 given)

The target FreeBSD client (8.2) is running python 2.6.6. It seems the
extra 'flags' argument was added to re.sub() in 2.7.

In fixing this issue I have attempted to create a general atomic method
for modifying a rc.conf file. Hopefully this will make it easier to add
other rc based platorms. The strip/split magic was inspired by the user
module.
2012-11-25 13:09:54 +01:00
0c70abfaa9 Make sure any existing groups gets reused 2012-11-25 12:42:30 +01:00
5504f13c68 Create groups in the first run through the file
Fixes #1208.
2012-11-25 01:00:14 +01:00
4679d8d6e5 Remove references to non-existant variable rc 2012-11-25 00:23:29 +01:00
1ec2a59073 Merge pull request #1676 from dagwieers/service-action-fix
The vars stop/start were intended as strings
2012-11-24 15:16:30 -08:00
2bfb7deec0 Set all in the returned dict
Otherwise the group is lost, and group_vars/all isn't used.
2012-11-25 00:15:22 +01:00
18b797f096 The vars stop/start were intended as strings
This is a typo that was reported on IRC, because of this people got: "NameError: global name 'stop' is not defined".
2012-11-25 00:13:53 +01:00
002fa07913 Merge pull request #1673 from JensRantil/fix-minor-docsite-spelling-mistake
Fix minor spelling mistake in docsite
2012-11-24 14:03:34 -08:00
6e3e1c74c9 Fix minor spelling mistake in docsite 2012-11-24 22:55:56 +01:00
d5fb81fe0b Merge pull request #1671 from tonk/devel
Added pip-python to the search for CentOS 6 compatibility
2012-11-24 08:30:56 -08:00
33196ec131 Merge pull request #1669 from dagwieers/ssh-tcgetattr2
Use proper pseudo-tty's instead of pipes when using subprocess
2012-11-24 08:30:26 -08:00
7bba04b176 Corrected for fallthrough 2012-11-24 16:26:15 +01:00
ee4fe9ff55 Added pip-python to the search for CentOS 6 compatibility 2012-11-24 13:36:32 +01:00
4192516582 fixed 2012-11-24 03:00:59 +01:00
7192eb3047 Use proper pseudo-tty's instead of pipes when using subprocess
This change avoids the "tcgetattr: Invalid argument" error by making sure the ssh we start does have a proper pseudo-tty.

We could also check whether our current terminal is a proper terminal (by doing a tcgetattr ourselves) but I don't think this adds anything.

This closes #1662 (if all use-cases have been tested: sudo, passwd)
2012-11-23 22:39:30 +01:00
ac09b47ec4 Merge pull request #1668 from eest/refactor_service_module
Repost: Refactor service module to use subclasses like user module.
2012-11-23 13:19:09 -08:00
5b7aa494b2 Refactor module to use subclasses like user module.
* Basically the moving parts from the original service module arranged in
  subclasses.
* General structure and helper methods comes from the user module.
* Less forgiving to unsupported platforms: it requires a subclass per platform.
  (This makes it easier to work on one platform without having to think about.
  what other platform might be affected in unexpected ways).
* Now has basic OpenBSD support.
* Solaris support needs to be added.

Thanks to @dhozac for general advice and Linux testing.
Thanks to @bcoca for clearing up some FreeBSD questions.
2012-11-23 21:03:17 +01:00
ce487a8544 Merge pull request #1658 from jpmens/docs_2
module_formatter: re-instate code
2012-11-23 07:58:48 -08:00
3981c72957 Streamline code 2012-11-23 10:58:17 -05:00
17020d6a75 Merge pull request #1656 from dagwieers/setup-virtualization
Implemented more virtualization types
2012-11-23 07:55:42 -08:00
9d7739112a Merge pull request #1661 from jpmens/yumdoc
DOCUMENTATION: yum (moved version to added)
2012-11-23 07:53:06 -08:00
db1a65342a Set -c local cwd to . if basedir is empty 2012-11-23 13:36:09 +01:00
715d875dcb Group should only return its own variables
Otherwise, a host in two groups, A and B, using a variable defined
in group A and all will get the value of all, as B's variables will
include the all variable.

Partially fixes #1647.
2012-11-23 00:54:07 +01:00
e44b85daba Remove special-casing for all group
global_vars has higher precedence than inventory. Putting the all
group's variables into it overrides all other groups and hosts.

Partially fixes #1647.
2012-11-23 00:54:02 +01:00
bd7e02d629 Get all groups' variables in order of depth
Fixes all not being processed, as well as the order of the variable
precedence
2012-11-23 00:20:52 +01:00
d5dd89a8f7 Allow specifying when: ... 2012-11-22 23:11:42 +01:00
fd732f8d3b Add when_boolean
Fixes #1567.
2012-11-22 23:10:11 +01:00
ddef608c94 Wrap all remote commands in sh 2012-11-22 20:06:30 +01:00
3b83295581 DOCUMENTATION: yum (moved version to added) 2012-11-22 15:16:20 +01:00
068ef0e979 module_formatter: re-instate code 2012-11-22 07:23:10 +01:00
e528826dba Implemented more virtualization types
I added all known virtualization types from the virt-what project. However, the few virt types that rely on cpuid information have not been implemented lacking native python cpuid access. (hyperv)
2012-11-22 02:48:13 +01:00
8e515c0c94 Merge pull request #1655 from jpmens/docs_jumbopatch
DOCUMENTATION strings
2012-11-21 16:08:17 -08:00
047d089cea Restore git output on --version
Broken by the move from utils.py to utils/__init__.py
2012-11-21 23:54:42 +01:00
ef357ed1f2 Use the play's vars for the setup step
Allows using -e ansible_ssh_port=foo and have it apply to all actions.
2012-11-21 23:42:24 +01:00
caf003c813 DOCUMENTATION strings 2012-11-21 18:49:30 +01:00
d1c285b70b Port may be an integer when parsed from the play 2012-11-21 17:20:03 +01:00
30fd37a68f Merge pull request #1654 from dagwieers/service-None-fix
Make the default an empty string
2012-11-21 07:15:20 -08:00
118ccc68c9 Make the default an empty string
Seems a bit strange I have to set a default in two locations.
2012-11-21 16:11:20 +01:00
82f4aef959 Merge pull request #1648 from dhozac/local-cwd-basedir
Use runner's basedir as cwd for -c local
2012-11-21 06:40:01 -08:00
41af2fce64 Merge pull request #1650 from dagwieers/port-not-integer-exception
Provide a proper error when the remote_port is not an integer
2012-11-21 06:39:24 -08:00
3ce63d845e remote_port is None by default 2012-11-21 14:10:10 +01:00
6b69b37eb0 Merge pull request #1649 from dagwieers/template-port
Allow the remote port to be templated per play
2012-11-20 13:16:34 -08:00
85bba04a1c Provide a proper error when the provided port is not an integer
As reported on the mailinglist, the user received a ValueError when the port number was not templated (fixed in #1649) and therefore it was not an integer. This change will catch the exception and provide a proper error so it is more clear.
2012-11-20 19:06:27 +01:00
8458f53014 Allow the remote port to be templated
This was requested on the mailinglist and seems useful.
2012-11-20 18:53:40 +01:00
48898993b9 Fix removing of temporary files 2012-11-20 16:51:19 +01:00
0ebf4b2d5a Add destination path to fetch result 2012-11-20 15:39:48 +01:00
bdf05ec9a0 Use runner's basedir as cwd for -c local 2012-11-20 15:36:43 +01:00
f89f07871d Fix typo in first_available_file error path 2012-11-19 23:02:26 +01:00
956e926618 change docs, this is the easier way to use template. 2012-11-19 14:27:23 -05:00
3602fe7f61 Update changelog notes about with_template 2012-11-19 14:25:46 -05:00
b78f90ae62 Organize changelog 2012-11-19 14:22:34 -05:00
b46505d59d Update changelog and contrib.rst 2012-11-19 14:18:55 -05:00
663a8fef3f chmod -x for all module files in source checkout 2012-11-19 13:47:40 -05:00
0c4b30a471 Aliased node test doesn't make sense locally, so remove it. 2012-11-19 10:45:10 -05:00
9985995a9d Make tests use the local connection type, fix missing callback in tests. 2012-11-19 10:30:30 -05:00
75620220b6 Merge pull request #1645 from dhozac/use-plugin-system-for-modules
Use plugin system for modules
2012-11-18 15:41:11 -08:00
f95fefd8c5 Use plugin system to find modules 2012-11-18 19:09:21 +01:00
5dd2ec2cae Add a way to add directories to just one type of loader 2012-11-18 19:08:59 +01:00
d2abfb9ff8 Ensure runner adds its basedir, so ansible can benefit from plugins 2012-11-18 18:37:20 +01:00
5183417de8 Reinstate ANSIBLE_KEEP_REMOTE_FILES
Fixes #1395.
2012-11-18 18:32:45 +01:00
b95bcf1b9d Use single-quotes to contain SSH keys as they may contain double-quotes
Fixes #1624.
2012-11-18 18:31:57 +01:00
11175781b8 Use slurp for fetch is sudo is enabled and needed
Fixes #1020.
2012-11-18 17:54:00 +01:00
99a0ebcad0 Merge pull request #1642 from dagwieers/service-options
Allow adding additional arguments to service module
2012-11-17 16:58:37 -08:00
3852b9918a Allow adding additional arguments to service module
Some services allow additional arguments to be provided on the command line. This patch makes it possible.
2012-11-18 01:48:06 +01:00
ca09be557d Merge pull request #1640 from ashak/a0389a48fa72f3a5fc3f79058437f4c9f36e762f
Make deb doesn't work on a small debian wheezy install without this addition to build-depends
2012-11-17 16:34:04 -08:00
14f7bba64e Merge pull request #1643 from dhozac/fileglob-drop-dwim
Drop dwim prefix from returned items in fileglob
2012-11-17 16:31:13 -08:00
11afd84d32 Drop dwim prefix from returned items in fileglob
Fixes #1618.
2012-11-18 00:25:38 +01:00
3d7d3cf351 Fix make deb
asciidoc is now needed to build the package.
2012-11-17 21:48:52 +00:00
bb2e5e12b8 Merge pull request #1638 from jpmens/ec2_userdata
Support for user_data in ec2 module
2012-11-17 07:43:35 -08:00
1b78dabcd4 Merge pull request #1632 from dhozac/use-ssh-conn-section-for-scp
Use the ssh_connection section for scp_if_ssh
2012-11-17 07:41:35 -08:00
20c65bf854 Merge pull request #1629 from dagwieers/list-hosts-plays
Make --list-hosts consider all plays (in multiple playbooks)
2012-11-17 07:40:48 -08:00
9d5ce86a4c Merge pull request #1628 from dagwieers/fail-on-empty-host_list
Fail ansible-playbook when the hosts list (with applied subset) is empty
2012-11-17 07:39:44 -08:00
c9aef42ac4 Merge pull request #1636 from romeotheriault/add-sunos-subclass-to-group-mod
Add sunos subclass to group mod
2012-11-17 07:39:17 -08:00
e13d67bbf1 Merge pull request #1635 from romeotheriault/classify-group-module
convert group module to be platform sub-classable
2012-11-17 07:38:32 -08:00
3bc0adacbf Merge pull request #1634 from dhozac/ssh-password
Add password support to -c ssh via sshpass
2012-11-17 07:37:51 -08:00
3e9a408682 Merge pull request #1633 from dhozac/root-remote_tmp
Use the configured remote_tmp even for root
2012-11-17 07:37:13 -08:00
e4606d500c Support for user_data in ec2 module
fix
2012-11-17 16:12:46 +01:00
709818105e Merge pull request #1630 from leucos/devel
Updates Arch linux packaging files
2012-11-17 06:10:28 -08:00
5c8597e4cb Merge pull request #1631 from arrfab/ec2-doc-fix
Added a requirement on euca2ools external package and ec2 url example
2012-11-17 06:10:01 -08:00
bb976ddfe0 add solaris subclass to group module 2012-11-16 16:05:16 -10:00
a52faa841f convert group module to be platform sub-classable 2012-11-16 15:38:13 -10:00
e6fed9f216 Add password support to -c ssh via sshpass 2012-11-16 23:46:49 +01:00
021172f78d Use the configured remote_tmp even for root 2012-11-16 23:46:17 +01:00
c906f44d90 Use the ssh_connection section for scp_if_ssh 2012-11-16 23:45:47 +01:00
269a0779b4 Added a requirement on euca2ools external package and ec2 url example 2012-11-16 20:47:39 +01:00
d5f4e033b9 Updates Arch linux packaging files
Added a README.md to explain the purpose of the directory
Fixed dependencies in PKGBUILD
Added patch to change python binary name for arch users, so they
don't end up using python 3 (python links to python3 by default on arch
linux).
2012-11-16 10:07:42 +01:00
9ea26c75f9 Make --list-hosts consider all plays (in multiple playbooks)
Currently when more than one playbook is provided on the commandline, ansible-playbook --list-hosts will only consider the first playbook and stop. This change will make it work for the various different playbooks.
2012-11-15 17:47:01 +01:00
a259b95556 Fail ansible-playbook when the hosts list (with applied subset) is empty
When the inventory is empty, or the provided --limit subset returns an empty intersection, we don't want to loop over all plays but bail out at the very start.
2012-11-15 15:26:49 +01:00
0ab3bd0034 Fix for #1577 (python 2.4 compliance for mysql_user), tested only for syntax, please exercise MySQL fans! 2012-11-14 20:02:39 -05:00
ab5c0dfe7e __new__ does not take arguments, remove deprecation warning 2012-11-14 19:58:44 -05:00
89bb1b8368 Fixup fireball installation playbook 2012-11-14 18:39:01 -05:00
096607eea4 Allow fireball to transfer binary files, fixup fireball docs, make fetch work with fireball. 2012-11-14 18:37:17 -05:00
8c0f83a2c9 Update "Who Uses Ansible" 2012-11-14 18:21:06 -05:00
613539810e Missing import 2012-11-14 18:19:16 -05:00
d500398e76 Merge pull request #1616 from dagwieers/skip-register
Do not register variable if host has been skipped
2012-11-14 06:33:30 -08:00
52e2654faf Merge pull request #1621 from dhozac/lookup-with-vars
Lookup plugin arguments need to be templated
2012-11-14 06:32:39 -08:00
73ae930659 Merge pull request #1623 from dhozac/group-hosts-set
Create a set of all the hosts in a group to prevent duplicates
2012-11-14 06:32:17 -08:00
17e4ce97a4 Create a set of all the hosts in a group to prevent duplicates
Fixes #1516.
2012-11-14 13:35:21 +01:00
e74ffd6764 Lookup plugin arguments need to be templated 2012-11-14 11:17:30 +01:00
302eeae65d Do not register variable if host has been skipped
Executive summary: skipping a host corrupts a variable (when it is registered)

We have a play existing out of multiple tasks that check a condition, if one of these tasks fails we want to skip all next tasks in the playbook. I noticed that if we skip a task because a certain condition is met, and this task has a register-attribute, I loose the value in the variable. Which means we cannot use that variable in subsequent tasks to evaluate because it was skipped:

```
- action: command test -d /some/directory
  register: task

- action: command test -f /some/directory/file
  register: task
  only_if: '${task.rc} == 0'

- action: do something else
  only_if: '${task.rc} == 0'
```

In the above example, if the second task is skipped (because the first failed), the third action will end with a "SyntaxError: invalid syntax" complaining about the unsubstituted ${task.rc} (even though it was set by the first task and used for skipping the second).

The following play demonstrates the problem:

```
- name: Test register on ignored tasks
  hosts: all
  gather_facts: no

  vars:
    skip: true
    task: { 'rc': 666 }

  tasks:
  - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'

  - name: Skip this task, just to test if task has changed
    action: command ls
    register: task
    only_if: '${skip} != True'

  - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'

  - name: Now use task value
    action: command echo 'Works !'
    only_if: '${task.rc} == 0'
```

And the enclosed fix, fixes the above problem.
2012-11-13 16:57:10 +01:00
44af1408ee Merge pull request #1611 from dhozac/no-hostvars-templating
Keep hostvars from being templated
2012-11-13 05:20:48 -08:00
6793bcbe4d Merge pull request #1613 from dhozac/use-all-vars-for-hosts-template
Use all available vars for hosts:, user: and sudo_user:
2012-11-13 04:47:03 -08:00
2303f65a1a Merge pull request #1614 from dagwieers/missing-action-error
Print the task name (if any) when complaining
2012-11-13 04:46:41 -08:00
7a48525357 Merge pull request #1612 from dhozac/play-vars-list
Make parameterized playbook includes work with vars as a list
2012-11-13 04:45:58 -08:00
b96877e5aa Print the task name (if any) when complaining
After spending 10 minutes to find which playbook had an action/local_action missing, I changed the error to include the task name (if set). The error eventually was caused because I added a name to a task, but the dash before the existing action was not removed.
2012-11-13 12:53:42 +01:00
0be1f11ed5 Use all available vars for hosts:, user: and sudo_user: 2012-11-13 12:20:07 +01:00
eebbbd3f0e Make parameterized playbook includes work with vars as a list
Fixes #1610.
2012-11-13 12:12:18 +01:00
5752d2a850 Fix lookup plugin test properly 2012-11-13 12:09:42 +01:00
c200c26ced Keep hostvars from being templated 2012-11-13 11:34:34 +01:00
e3f7f86ac4 Merge pull request #1608 from dhozac/when_set-non-string
Try to ensure the entire value is quoted
2012-11-12 17:45:47 -08:00
d5be13c3f0 Merge pull request #1605 from romeotheriault/add-md5-support-to-fetch-module
add bsd md5 support to fetch module
2012-11-12 17:45:07 -08:00
96e5408046 Merge pull request #1607 from dhozac/j2-templated-vars
Templating fixes and features
2012-11-12 17:44:09 -08:00
0ca1775bda Try to ensure the entire value is quoted 2012-11-13 02:40:29 +01:00
25a8787e95 Template all variables before returning them to Jinja2 2012-11-13 02:39:33 +01:00
df458fb3b5 Merge pull request #1606 from romeotheriault/minor-linux-user-fixes
minor linux user module fixups
2012-11-12 17:39:07 -08:00
d2dce1d63f Make lookup plugin replacements part of the main variable logic 2012-11-13 02:18:05 +01:00
f91fa9f765 Fix lookup plugin test 2012-11-13 02:13:10 +01:00
a2bb3a09d2 Completely ignore stray $ in input
Previously, "a $ string $var" would not have gotten replaced at all.
2012-11-13 02:13:10 +01:00
24b536d7ed Add some comments to templating system 2012-11-13 02:13:04 +01:00
ae36fb1dc6 minor linux user module fixups 2012-11-12 11:13:51 -10:00
4cd133ed8f add bsd md5 support to fetch module 2012-11-12 10:37:00 -10:00
8f9bef9d51 Merge pull request #1604 from dhozac/consume-module_vars-early
Template using module_vars early
2012-11-12 08:24:00 -08:00
233a36b9e8 Template using module_vars early
Since no basedir is available at that time, avoid invoking
lookup plugins since they assume it is present.
2012-11-12 16:53:24 +01:00
f54af8f0f6 Merge pull request #1603 from dagwieers/rpm-makefile-fix
moduleformatter.py should include our own ansible clone
2012-11-12 05:25:38 -08:00
a162fa70da moduleformatter.py should include our own ansible clone
Without this, module_formatter.py relies on the installed ansible which is wrong in more than one way.
2012-11-12 14:22:30 +01:00
c890ae18e7 Merge pull request #1575 from dhozac/parameterized-playbook-include
Add parameterized playbook includes
2012-11-12 05:17:38 -08:00
3e855a5fcd Merge pull request #1593 from dhozac/lookup_generic
Add support for generic $XXX() to call $LOOKUP()
2012-11-12 05:07:52 -08:00
451f05fa3d Merge pull request #1594 from sfromm/issue1342
Add ability to specify syslog facility for modules
2012-11-12 05:06:47 -08:00
2f517f1cd3 Merge pull request #1600 from fdavis/devel
ansible-playbook verifies playbooks exist before running them
2012-11-12 05:05:03 -08:00
753ee0b88d Merge pull request #1601 from romeotheriault/fix-remote-md5-for-solaris10
remove verbose option on digest call
2012-11-12 05:01:50 -08:00
54b7f59416 remove verbose option on digest call 2012-11-11 19:43:40 -10:00
7256c5af1a ansible-playbook verifies playbooks exist before running them
refers to #1345
2012-11-11 18:08:35 -08:00
68e16773ae Merge pull request #1595 from sfromm/issue1564
Add --limit to calls to ansible and ansible-playbook
2012-11-11 16:23:34 -08:00
da210c3eff Added changelog note about 'when' 2012-11-11 11:59:38 -05:00
9c16b3fc91 Organize 0.9 changelog 2012-11-11 11:55:28 -05:00
a56dc03180 update changelog 2012-11-11 11:43:31 -05:00
06e54c0b97 Add ability to specify syslog facility for modules
Update constants.py so that one can specify environmental variable
ANSIBLE_SYSLOG_FACILITY or syslog_facility in ansible.cfg to define
the syslog facility to use.  Alternatively, you can specify
ansible_syslog_facility in inventory.  Runner now replaces
the syslog facility in the openlog() call with the default or
the injected variables ansible_syslog_facility.

This also updates hacking/test-module to behave similarly.
2012-11-11 00:14:08 -08:00
4ae3bee416 Add --limit to calls to ansible and ansible-playbook
--limit takes localhost, FQDN, and 127.0.0.1.
2012-11-11 00:13:59 -08:00
9924555623 Add support for generic $XXX() to call $LOOKUP() 2012-11-10 23:46:37 +01:00
40e49b6a5a Merge pull request #1592 from jpmens/lookup_dnstxt3
$LOOKUP(dnstxt): handle exceptions
2012-11-10 08:52:30 -08:00
bd55899a60 $LOOKUP(dnstxt): handle exceptions
de-spaced
2012-11-10 17:50:21 +01:00
001e2e564f Merge pull request #1590 from romeotheriault/minor-freebsd-user-module-fixes
minor freebsd user fixes
2012-11-10 06:33:13 -08:00
80f196fdbc Merge pull request #1589 from romeotheriault/add-sunos-user-support
Add solaris support to user module
2012-11-10 06:32:41 -08:00
db3e8c0803 Merge pull request #1579 from jpmens/lookup_env
Add environment $LOOKUP plugin
2012-11-10 06:30:37 -08:00
35679e0093 Merge pull request #1578 from jpmens/lookup_redis
Add Redis GET $LOOKUP plugin
2012-11-10 06:30:10 -08:00
6c6bcff4ee minor freebsd user fixes 2012-11-09 22:29:45 -10:00
3bab27abdb Add solaris support to user module 2012-11-09 21:58:51 -10:00
6efc98e8a3 Add environment $LOOKUP plugin
remove support for multiple vars
2012-11-10 08:26:09 +01:00
e3e545418d Add Redis GET $LOOKUP plugin
renamed
2012-11-10 08:21:48 +01:00
89f5a72a98 Merge pull request #1582 from jpmens/utils_docparser1
Move get_docstring from module_formatter into ansible/utils
2012-11-09 20:36:08 -08:00
0521cbc801 Merge pull request #1584 from arrfab/docsite-contribs
Added jp_mens' presentation and removed dead links
2012-11-09 15:48:00 -08:00
fba75aac0a Added Action.IO to who_uses_ansible and ansible-provisioning to contribs 2012-11-09 17:52:54 +01:00
2b3aeda33b Added jp_mens' presentation and removed dead links 2012-11-09 17:30:36 +01:00
e32f4a0564 Move get_docstring from module_formatter into ansible/utils 2012-11-09 17:15:41 +01:00
9c095b72b9 Add parameterized playbook includes
Also makes with_* work with them.

Fixes #1162.
2012-11-09 15:43:49 +01:00
383dc30560 Rename varReplaceWithItems to template_ds 2012-11-09 15:43:29 +01:00
2ff3fc6aa2 Merge pull request #1576 from vanne/devel
Fix exception catching for Python 2.4
2012-11-09 05:35:10 -08:00
e9a356bbde Fix exception catching for Python 2.4 2012-11-09 14:28:21 +01:00
37de471ab6 Fix exception catching for Python 2.4 2012-11-09 14:27:03 +01:00
325025a5b6 Merge pull request #1574 from dhozac/ssh-moar-data
Make sure we get all data
2012-11-09 05:08:27 -08:00
09cde86e83 Merge pull request #1571 from skvidal/ec2
add ec2 module
2012-11-09 04:53:03 -08:00
fa17540a06 Merge pull request #1570 from skvidal/addhost
Addhost module
2012-11-09 04:51:15 -08:00
5989a1c13c Merge pull request #1565 from miekg/debreadme
Add some python packages too
2012-11-09 04:50:26 -08:00
718a9af3f2 Merge pull request #1573 from jpmens/lookup_dnstxt
Add DNS TXT record $LOOKUP plugin
2012-11-09 04:50:16 -08:00
e97a22603f Make sure we get all data 2012-11-09 11:24:57 +01:00
38d9dc8bff Add DNS TXT record LOOKUP plugin 2012-11-09 11:06:49 +01:00
70d61fe7e8 need to use the variabled results 2012-11-09 00:16:17 -05:00
e147ad4213 add add_host action plugin - add hosts to inventory during a playbook
run - lets act on those hosts in the next play
2012-11-09 00:16:17 -05:00
7e0cb4f052 add ec2 module 2012-11-09 00:15:12 -05:00
35d841f780 Merge pull request #1569 from dagwieers/svr4pkg-doc-fix
Documentation of svr4pkg module breaks 'make rpm'
2012-11-08 17:47:25 -08:00
2fdb217be3 Documentation of svr4pkg module breaks 'make rpm'
Without this fix, generating documentation results in:

```
Traceback (most recent call last):
  File "hacking/module_formatter.py", line 376, in <module>
    main()
  File "hacking/module_formatter.py", line 365, in main
    text = template.render(doc)
  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 669, in render
    return self.environment.handle_exception(exc_info, True)
  File "hacking/templates/man.j2", line 20, in top-level template code
    {% for desc in v.description %}@{ desc | jpfunc }@{% endfor %}
  File "hacking/module_formatter.py", line 94, in man_ify
    t = _ITALIC.sub(r'\\fI' + r"\1" + r"\\fR", text)
TypeError: expected string or buffer
```
2012-11-09 02:22:20 +01:00
03591e0fc8 Merge pull request #1551 from dagwieers/local_action-fail
Turn 'fail' and 'debug' modules into action_plugins
2012-11-08 16:47:24 -08:00
f3cbcecf53 Merge pull request #1563 from lllama/devel
Add an "executable" option to the command and shell modules
2012-11-08 16:45:48 -08:00
a31ca213a5 Merge pull request #1562 from dagwieers/oneline-fix
Make --oneline return one line (except with multiline output)
2012-11-08 16:45:33 -08:00
03f4b0f923 Merge pull request #1560 from dagwieers/module-output-consistency
Make module output more consistent wrt. changed/failed
2012-11-08 16:45:05 -08:00
cbff02139f Merge pull request #1557 from sfromm/issue1412
Updates to git module: use git-fetch and other changes
2012-11-08 16:44:00 -08:00
42375d14b3 Merge pull request #1556 from sfromm/issue1099
Wrap getpwnam in try/except in authorized_key module
2012-11-08 16:43:45 -08:00
603a5a0803 Merge pull request #1555 from pas256/devel
Handle instances without keypairs
2012-11-08 16:43:30 -08:00
b79b8e5a99 Merge pull request #1545 from brontitall/svr4pkg
Add svr4pkg module for traditional Solaris packages
2012-11-08 16:43:03 -08:00
3dc31a049f Merge pull request #1527 from fdavis/devel
Support scp in an ssh connection
2012-11-08 16:42:37 -08:00
528a457848 Add svr4pkg module for traditional Solaris packages 2012-11-09 09:43:19 +11:00
b91896ff55 move scp_if_ssh to the ssh connection category 2012-11-08 11:51:24 -08:00
5c62cf3285 Add some python packages too
When starting from scratch those packages must be installed too.
2012-11-08 20:28:32 +01:00
e0f0e8c023 Add an "executable" option to the command and shell modules
The option will be passed to the Popen object created and will be used to
execute the command instead of the default shell.
2012-11-08 13:56:16 +00:00
d42eb2563b Make --oneline return one line (except with multiline output)
Currently the message prepared for --oneline mode adds a newline to the msg-string, which is then printed (adding another newline). This change removes the added newline so that successes and failures do not differ in output (except if the output is multiline).
2012-11-08 14:49:40 +01:00
fe0c70fe9d Make module output more consistent wrt. changed/failed
- Make sure exit_json() always returns a changed= value
- Modify the yum module to not return failed=False
- Modify install() and latest() similar to remove() in yum module
- Changed exit_json(failed=True, **res) into a fail_json(**res)
- Make sure yum rc= value reflects loop (similar to how we fixed remove())
2012-11-08 12:28:18 +01:00
39efcd0766 While I haven't done this, it is possible to bring up an instance
without a keypair, so this takes care of that scenario
2012-11-07 16:56:45 -08:00
3ec64d19a8 Wrap getpwnam in try/except in authorized_key module
This also adds module as an argument to keyfile().
2012-11-07 16:43:09 -08:00
6aa51a7cf3 Rewrite switch_version() to detect branch
Rewrote switch_version() to read .git/HEAD to find branch associated
with HEAD.  If in a detached HEAD state, will read
.git/refs/remotes/<remote>/HEAD.
2012-11-07 16:33:22 -08:00
36c1b4be0e Merge pull request #1554 from dagwieers/rpm-name-fix
Fix broken RPM names due to static _rpmfilename
2012-11-07 16:22:07 -08:00
d4b6aecd97 Fix broken RPM names due to static _rpmfilename 2012-11-08 00:09:18 +01:00
ab0f972715 Merge pull request #1553 from dagwieers/doc-authorized_key-fix
Fix example where imported ssh keys contain spaces
2012-11-07 15:00:07 -08:00
710b49de4b Merge pull request #1552 from dagwieers/invoked-fix
Only print 'Invoked with' if there are arguments to the module
2012-11-07 14:59:36 -08:00
2bccd7b1ac Fix example where imported ssh keys contain spaces
This fixes #1521
2012-11-07 23:58:16 +01:00
dd07011a65 Only print 'Invoked with' if there are arguments to the module
This closes #1519
2012-11-07 23:51:44 +01:00
d8459425a0 Turn 'fail' and 'debug' modules into action_plugins
This makes more sense as there is no purpose in running these remotely.
2012-11-07 23:34:53 +01:00
5e024243a8 Merge pull request #1522 from dhozac/LOOKUP-templating
Add $LOOKUP(<lookup plugin>,<data>) as a templating option
2012-11-07 14:26:07 -08:00
43419d7b20 Add tests for lookup plugins 2012-11-07 23:21:26 +01:00
47082a9171 Add $LOOKUP(<lookup plugin>,<data>) as a templating option
Also moves file and pipe to lookup_plugins.
2012-11-07 23:17:29 +01:00
176cc8380b Merge pull request #1524 from nigelm/devel
Split of rpm packaging into main/fireball/node-fireball
2012-11-07 13:55:29 -08:00
a1f7334634 Merge pull request #1525 from jhoekx/custom-filter-plugins
Support custom jinja2 filters.
2012-11-07 13:55:21 -08:00
c9ae19c44c Merge pull request #1547 from dagwieers/action-boolean
Bail out if an action is not a string
2012-11-07 13:52:07 -08:00
612aed55bb Merge pull request #1546 from dagwieers/get_url-nonthirsty-fix
Don't require thirsty mode for directory destination
2012-11-07 13:51:38 -08:00
0ed2595bc6 Merge pull request #1548 from dagwieers/inventory-host-exception
Fix for an exception when for whatever reason the inventory script fails
2012-11-07 13:51:12 -08:00
43410c46f9 Merge pull request #1550 from bcoca/1549_lininfile_backup_bug
fixes #1549
2012-11-07 13:50:54 -08:00
49d41da152 Use supplied remote name when cloning git repository 2012-11-07 12:15:22 -08:00
328951ef53 Checkout branch before rebase in switch_version 2012-11-07 11:44:48 -08:00
ccc04cf891 More work in git module
Rename pull() to fetch().  It does a git fetch and then a
git fetch --tags.
Add _run() method to handle all subprocess.Popen calls.  Change
all previous calls to subprocess.Popen to use _run().
2012-11-07 11:44:48 -08:00
5ea260f44b fix case in which file is created and backup is requested but fails, not it just doesn't attempt to backup the missing file
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-11-07 10:33:43 -05:00
c9e62d7061 Fix for an exception when for whatever reason the inventory script fails
This avoids a traceback that gave no clue as to what was happening.

This is in line with the change from #1535
2012-11-07 15:16:00 +01:00
dfa1e8b0dc Bail out if an action is not a string
Since YAML allows anything, we should enforce that actions are strings.

This closes #1419.
2012-11-07 15:04:04 +01:00
82ec405b05 Don't require thirsty mode for directory destination
There is no need to require thirsty mode when the destination is a directory. We add the basename of the url to the destination directory and proceed with that. If that file exists in non-thirsty mode continue as expected.

I also cleaned up some of the logic that is no longer necessary if we simply rewrite the destination from the very start the way it is expected.
2012-11-07 14:16:48 +01:00
75d3b77454 Merge pull request #1535 from dagwieers/inventory-exception
Fix for an exception when for whatever reason the inventory script fails
2012-11-07 04:06:33 -08:00
8bd56926f1 Merge pull request #1544 from pas256/devel
Adding more instance groups
2012-11-07 04:06:02 -08:00
7cd013f854 Merge pull request #1542 from arrfab/xen-fact-issue
Fixed the way dom0/domU xen role is defined in the setup module
2012-11-07 04:05:38 -08:00
aa0434535e Adding 2 more groups of instances - instance types and key pairs 2012-11-06 16:16:52 -08:00
29882f97e6 Fixed the way dom0/domU xen role is defined in the setup module 2012-11-06 22:49:33 +01:00
1b8d912d2a Merge pull request #1541 from dhozac/fix-first_available_file
Fix first_available_file and add test-case
2012-11-06 12:45:11 -08:00
40af8eff14 Add testcase for first_available_file 2012-11-06 20:57:35 +01:00
00aa584c57 Don't double dwim first_available_file in template 2012-11-06 20:34:05 +01:00
89b7fe663f Merge pull request #1537 from sfromm/issue1536
Fix to user module to use self when calling group_exists
2012-11-06 09:08:35 -08:00
2fab846f17 Fix to user module to use self when calling group_exists 2012-11-06 09:05:25 -08:00
89206a6b68 Fix for an exception when for whatever reason the inventory script fails
This avoids a traceback that gave no clue as to what was happening.
2012-11-06 16:39:10 +01:00
c13f40f516 Merge pull request #1530 from dagwieers/mail-fixes
Improve the mail callback to support differing failures
2012-11-06 06:52:33 -08:00
ac6f67b592 Merge pull request #1533 from dhozac/fireball-leaking-socket
Keep fireball from spreading its socket around
2012-11-06 06:43:56 -08:00
cf290a0064 Keep fireball from spreading its socket around 2012-11-06 15:10:34 +01:00
8323a03fa1 Improve the mail callback to support differing failures
Since callbacks are called with different argument-types, we have to be careful. We support two different distinct cases:

 - The error information can be in one ore more of the following items (msg, stderr or stdout)
 - The res/msg value returned can be a string or a list
2012-11-06 14:28:38 +01:00
b1dbeec66c Allows use of scp instead of sftp in
Added a boolean constant scp_if_ssh to the config
Added scp support for the ssh connection plugin
Refers to #1279
2012-11-05 14:25:40 -08:00
67321a6012 Add ansible.runner.filter_plugins package to setup.py 2012-11-05 15:23:04 +01:00
8ffed6df75 Support custom jinja2 filters.
This uses the plugin framework to add filter plugins.
The previously hardcoded core filters are defined using the plugin
framework now.
2012-11-05 15:11:34 +01:00
37bdee331c Merge pull request #1523 from nigelm/user_fixes
Fixes to the user module
2012-11-04 05:50:22 -08:00
5b076b086b Split of rpm packaging into main/fireball/node-fireball
Splitting of the packaging so that fireball mode, with the
additional requirements of 0mq, is separately packaged.
Also a end node fireball support package (reqs only).
2012-11-04 13:38:17 +00:00
f905e751ac FreeBSD user mod only fires when there are changes
Also fix missing -G on groups change
2012-11-04 12:09:19 +00:00
1ab1c8d374 Take SHADOWFILE from existing user object rather than class 2012-11-04 09:54:50 +00:00
75a2b2ba2d Use the existing framework when running ssh_keygen 2012-11-04 09:47:30 +00:00
19402a47cd Ensure user owns their ssh key directory on creation
Lost section from commit 8049777
2012-11-04 09:44:38 +00:00
793df5d4d9 Update changelog 2012-11-03 19:35:54 -04:00
aa0af271d6 Quote some stuff in docs 2012-11-03 19:27:14 -04:00
5bda1fc6cc Fix broken link 2012-11-03 19:25:17 -04:00
6f938c9f4c Merge branch 'playbook_ssh_ask_pass' of git://github.com/clatour/ansible into devel
Conflicts:
	examples/ansible.cfg

+ doc tweak
2012-11-03 19:23:38 -04:00
908c43ad7f Merge branch 'devel' of git://github.com/skorokithakis/ansible into devel 2012-11-03 19:19:59 -04:00
ac3983a249 revise docs text 2012-11-03 19:19:14 -04:00
fea6742a27 Merge branch 'docsite' of git://github.com/arrfab/ansible into devel 2012-11-03 19:10:35 -04:00
05de2152a0 Merge branch 'sudo_ask_pass_config' of git://github.com/bcoca/ansible into devel 2012-11-03 19:09:40 -04:00
154a00e612 Merge branch 'plugin-sanity' of git://github.com/dhozac/ansible into try_new_plugins 2012-11-03 19:04:23 -04:00
d639844923 Merge branch 'service_bsd' of git://github.com/bcoca/ansible into devel 2012-11-03 18:58:29 -04:00
970d06e03b Fix user example 2012-11-03 18:57:19 -04:00
6a5df97393 Manpage documentation ALSO should be sorted 2012-11-03 18:54:38 -04:00
626203a7c9 Module documentation should have options sorted 2012-11-03 18:52:59 -04:00
c96f2c968e Merge branch 'nigelm_freebsd' of git://github.com/nigelm/ansible into merge-service
Make things more reusable, correct some errors along the SSH key path

Conflicts:
	library/user
2012-11-03 18:38:05 -04:00
49ad8631b4 Merge pull request #1517 from skvidal/devel
if a module returns failed in the results, don't fail unless failed is n...
2012-11-03 05:45:59 -07:00
e19c81977d if a module returns failed in the results, don't fail unless failed is not false. 2012-11-02 15:24:17 -04:00
f436a8c88b Added config option for default ask for ssh_pass 2012-11-02 10:53:26 -05:00
8d1ed566da corrected mizpells environment
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-11-02 08:20:17 -04:00
e05e514861 Create a plugin loader system 2012-11-02 01:24:14 +01:00
000d3832cc Make ansible.utils a package 2012-11-02 00:42:37 +01:00
3616dffb68 Detect whether we're running in a virtualenv. 2012-11-02 01:42:04 +02:00
4c156e4df8 Merge pull request #1502 from dhozac/improved-lookup-plugins
Improved lookup plugins
2012-11-01 16:36:03 -07:00
025402c0bf Merge pull request #1507 from lorin/pretty-print-msg
Pretty-print "msg" when task fails
2012-11-01 16:33:41 -07:00
4cc1ff4b21 Merge pull request #1508 from dhozac/host_vars-in-include
Return original string for non-matched vars
2012-11-01 16:32:48 -07:00
cdfa81d905 Added some documentation to the classes 2012-11-01 19:16:54 +00:00
d9a377cbb1 Fix installing to virtualenvs. 2012-11-01 20:40:28 +02:00
56314f7225 Add test case for non-existing variable in varReplaceWithItems 2012-11-01 19:24:53 +01:00
07ba7e2013 Return original string for non-matched vars 2012-11-01 18:53:23 +01:00
1c5ac5cac8 Pretty-print "msg" when task fails
Several modules (e.g., pip) return stdout and stderr together in a "msg" variable (and the module development docs seem to suggest that the standard practice is to return status in this variable).

This change ensures that it is printed out with correct formatting (most importantly, with newlines appearing as newlines instead of \n).
2012-11-01 13:23:18 -04:00
6877a88c7e added comment to example config to show usage of new sudo password asking option
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-11-01 08:13:10 -04:00
4399d9c3cb Merge pull request #1505 from dhozac/delegate_to-port
Use default port if ansible_ssh_port is not set for the delegated node
2012-11-01 04:37:03 -07:00
fbda2d4628 Use default port if ansible_ssh_port is not set for the delegated node
Also add testcase for it.
2012-11-01 12:00:49 +01:00
c519d5dac0 Add a template lookup plugin
Requires that inject be passed to run
2012-10-31 16:57:10 +01:00
37d9acc097 Make lookup API extensible and allow basedir to be passed
This allows using with_fileglob in play context, e.g.
- include: $item
  with_fileglob: tasks/*.yml
as well as prepares for other data to be passed.
2012-10-31 16:55:38 +01:00
2c77cf1a49 Skip tasks with a with_* that is empty 2012-10-31 16:37:26 +01:00
c5a66e96a2 Added the ansible_ssh_host and ansible_ssh_port variable in the patterns/inventory file 2012-10-31 14:43:06 +01:00
4c4cc270fe Merge pull request #1496 from dhozac/varnish-init-script
Fix service module for varnish initscript in EPEL
2012-10-31 04:33:31 -07:00
20775c0b73 Fix service module for varnish initscript in EPEL
It outputs 'dead but pid file exists'.
2012-10-31 12:31:08 +01:00
604bf9f58a Added config option to control default of asking or not for sudo password
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-10-30 23:36:07 -04:00
13f75e5a8e Now can handle rc.conf and init.d/rc.d based systems
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-10-30 23:34:18 -04:00
9268aa0289 Use return codes > 255 for Ansible-specific errors.
I had made and pushed this change after you already pulled the request.

@dhozac indicated that it would probably be better to use return codes > 255 for anything related to Ansible itself. Which makes sens :)
2012-10-30 23:34:18 -04:00
be300b562a pyflakes fixes (mostly unused imports, unused vars) 2012-10-30 20:47:05 -04:00
c0747b7baa pep8 fixes 2012-10-30 20:42:07 -04:00
27e518a0b1 Rename 'domainname' to 'domain' 2012-10-30 20:07:36 -04:00
9251709941 Merge pull request #1490 from sfromm/issue1484
Make sure ownership is set correctly for user's new ssh keys
2012-10-30 17:03:07 -07:00
ef4ca11282 Merge pull request #1489 from arrfab/my-branch
- Fixed some typos for the ansible config file in the man page
2012-10-30 17:02:40 -07:00
768d293949 Merge pull request #1488 from dagwieers/lineinfile-create
Add option create= to lineinfile module
2012-10-30 17:02:00 -07:00
91cf257e9c Merge pull request #1487 from skvidal/devel
fix up remove and fix fixme checking to see if pkg was removed
2012-10-30 17:00:54 -07:00
cceb99acd5 Simplify the group_by example a small bit 2012-10-30 20:00:21 -04:00
0853ece810 Merge pull request #1474 from jhoekx/group-by-plugin-template
Add a group_by action plugin.
2012-10-30 16:54:07 -07:00
f9a6265fb2 Merge branch 'vars_files-list-no-default' of git://github.com/dhozac/ansible into devel 2012-10-30 19:50:31 -04:00
6dceef3a5f Merge branch 'fix-var-in-var' of git://github.com/dhozac/ansible into devel 2012-10-30 19:48:32 -04:00
1db563e064 Add domainname to ansible facts 2012-10-30 19:47:31 -04:00
aef9a95c1c Merge pull request #2 from sergevanginderachter/dagwieers/lineinfile-create
Fix typo
2012-10-30 13:01:25 -07:00
47d882f374 Fix typo 2012-10-30 19:43:22 +01:00
1e3dcfce4b Add option create= to lineinfile module
We use the lineinfile module to modify configuration files of a proprietary application. This application reads configuration options from files, but does not require those files to exist (if the default options are fine). However this application may modify the configuration file at will, so we cannot copy or template those files. And after a silent install the configuration may not exist (depending on the response file).

Whatever the case, during deployment we need to make sure some configuration options are set after the installation.

So the cleanest way to handle this situation is to allow the lineinfile module to create the file if it is missing (and this is the expected behavior). When I proposed this behavior, @sergevanginderachter needed the same functionality and was now working around it as well.
2012-10-30 17:57:15 +01:00
4619e99443 Make sure ownership is set correctly for user's new ssh keys 2012-10-30 09:37:23 -07:00
96770a3057 - Fixed some typos for the ansible config file
- added the ANSIBLE_CONFIG environment variable
2012-10-30 17:08:12 +01:00
efe83daf19 Fix ${var.$other_var} and add test cases for it 2012-10-30 13:05:45 +01:00
f0000a89b0 Merge pull request #1480 from dagwieers/command-fix2
Use return codes > 255 for Ansible-specific errors.
2012-10-30 05:04:44 -07:00
730031ec1f Merge pull request #1479 from wzzrd/selinux
More useful error message for if not HAVE_SELINUX
2012-10-30 05:04:28 -07:00
8d4f9febd8 Use return codes > 255 for Ansible-specific errors.
I had made and pushed this change after you already pulled the request.

@dhozac indicated that it would probably be better to use return codes > 255 for anything related to Ansible itself. Which makes sens :)
2012-10-30 10:36:11 +01:00
49dce05cdd fix up remove and fix fixme checking to see if pkg was removed 2012-10-29 23:48:21 -04:00
9a12873166 Merge pull request #1477 from skvidal/devel
add check that vars plugins are not handing back None
2012-10-29 16:02:26 -07:00
08cc961dcf Merge pull request #1475 from dagwieers/errors-fix
Missing errors-import causes traceback
2012-10-29 16:01:47 -07:00
9a2545957f Turn off some of the additional debug syslogging 2012-10-29 22:04:06 +00:00
3e0e572cce Rework of user module to support portability
Split module into a main calling function, and a generic
(Linux useradd/usermod/userdel) User class.
Added a __new__ function that selects most appropriate superclass
Added a FreeBSD User class
Tested against FreeBSD 9.0
2012-10-29 22:00:58 +00:00
7c1e0de141 fix removal case where first pkg in a list is not installed at all
and the next one gets ignored despite being installed.

also clean up unnecessary second check.
2012-10-29 13:48:20 -04:00
3fcc591f18 add check that vars plugins are not handing back None 2012-10-29 12:11:57 -04:00
82cc382c6a More useful error message for if not HAVE_SELINUX 2012-10-29 16:23:00 +01:00
3728b2f459 Missing errors-import causes traceback 2012-10-29 15:16:26 +01:00
b336d40101 Add a group_by action plugin. 2012-10-29 13:10:23 +01:00
ea8cb0b2e9 Merge pull request #1472 from jhoekx/action-host-letter
Send a host to runner executor instead of a letter.
2012-10-29 04:19:35 -07:00
f963db6c2a Fix output of pause plugin. 2012-10-29 10:57:13 +01:00
77162e95e4 Send a host to runner executor instead of a letter.
Discovered in #1463 .
2012-10-29 09:45:44 +01:00
e72fdccd87 Allow vars_files sequences without a default 2012-10-28 16:35:22 +01:00
fb27cb45e1 Merge pull request #1465 from dhozac/no-default-file-args
Don't add file module arguments by default
2012-10-28 06:43:08 -07:00
55a1473d50 Don't add file module arguments by default
This allows the postgresql_db module to work properly, as it uses
an argument named owner that conflicts with the file module.
2012-10-28 11:14:29 +01:00
457cdb2be0 Add note about when you still have to use only_if 2012-10-27 18:22:16 -04:00
2ae090b1db Update 'who uses' page 2012-10-27 18:10:24 -04:00
21258dcc66 Added 'when' as a shortcut around only_if. 2012-10-27 17:55:35 -04:00
a768e9a9ff Fix for sudo defaults if sudo is passed in via --extra-vars 2012-10-27 16:46:33 -04:00
7d7ff9d616 Fixup setup.py path 2012-10-26 20:20:02 -04:00
7f6aa2d3d5 Config parameter rename 2012-10-26 20:19:09 -04:00
6ba30170dd Make group_vars and host_vars available to usr/bin/ansible, and make vars_plugins exist 2012-10-26 19:55:59 -04:00
e04dab904a Use previous proven multiprocessing logic as the simplification didn't have the same Ctrl-C handling and may
be subject to race issues, though still don't pass Runner to each.  Still seems performant.
2012-10-26 18:11:38 -04:00
03f303fba3 Merge pull request #1460 from dhozac/init-sftp-paramiko
Initialize sftp variable to fix error on transferless session
2012-10-26 14:59:10 -07:00
1052dd9c8f Initialize sftp variable to fix error on transferless session 2012-10-26 23:54:21 +02:00
2d3c9452c9 Merge pull request #1456 from dagwieers/command-fix
Make sure we always return 'rc' from the command module
2012-10-26 06:13:12 -07:00
63fa33b0b7 Make sure we always return 'rc' from the command module
If this is not a certainty, playbooks will fail without an 'rc' and checking both if there is an rc, and whether the 'rc' is (not) 0 is very complicated. (especially because ${something.rc} will not be substituted and all that)
2012-10-26 15:02:03 +02:00
8dbe6b6a74 Add HP on request 2012-10-25 23:26:24 -04:00
ebd9673ceb Tweak docsite re: resources/contrib page 2012-10-25 23:17:05 -04:00
23533b60e3 update changelog 2012-10-25 23:05:31 -04:00
5e2c2564bc Explicitly execute /bin/sh versus $SHELL because some folks have very incompatible/weird shells. We do not
execute modules through the shell, this is only for basic ops, so should be sufficient.
2012-10-25 23:00:07 -04:00
ff787146d1 stray debug 2012-10-25 22:24:15 -04:00
24416b9e49 Remove stray debug message 2012-10-25 22:19:50 -04:00
3257c5b61f Some caching improvements to paramiko which are still not yet fully leveraged
in playbook mode, since the Runner still closes abstract host connections completely
and does not have a LRU.
2012-10-25 22:09:54 -04:00
4c83c274e0 Don't close paramiko SFTP multiple times in the same runner pass. Noticeable performance increase. 2012-10-25 21:49:28 -04:00
8b50ad7e85 Fix for atomic_replace patch if file does not yet exist 2012-10-25 21:40:05 -04:00
7a8009f979 When atomically replacing files, copy attributes 2012-10-25 21:40:05 -04:00
523f2bf327 Merge pull request #1455 from bleader/devel
user module: fix typo in documentation
2012-10-25 18:26:58 -07:00
19a5f86c2e Merge pull request #1452 from dhozac/with_items-as-plugin
Make with_items a lookup plugin
2012-10-25 18:24:34 -07:00
cbcc133cdd Merge pull request #1453 from sfromm/issue1211
Use shutil.copyfile so as to preserve file ownership in authorized_keys
2012-10-25 18:22:56 -07:00
5b36e374d7 Merge pull request #1451 from dhozac/command-strip-newlines
Only strip trailing newlines from output, preserving other space
2012-10-25 18:21:16 -07:00
c17aad3a59 Merge pull request #1450 from jpmens/docs_contrib1
Move contrib to .rst into the main docsite
2012-10-25 18:20:59 -07:00
9a141160a4 Merge pull request #1449 from dhozac/localhost-interpreters
Use the delegated host's interpreters
2012-10-25 18:19:26 -07:00
06fa3e820d Merge pull request #1448 from jpmens/user_user1
User is alias for name in 'user' module
2012-10-25 18:18:56 -07:00
347b0260c3 Merge varReplace cleanup and move code into new file 'template.py' so it's easier to keep template
code all together.
2012-10-25 21:18:08 -04:00
f8e946b71d Merge branch 'varfind-cleanups' of git://github.com/dhozac/ansible into devel 2012-10-25 20:14:20 -04:00
5a5751d1d0 user module: fix typo in documentation
tyep -> type

Signed-off-by: bleader <bleader@ratonland.org>
2012-10-25 20:56:13 +02:00
a033ad4d74 Use shutil.copyfile so as to preserve file ownership in authorized_keys 2012-10-25 11:20:53 -07:00
2f05e95d8a Use lookup plugins for task include with_* 2012-10-25 15:13:34 +02:00
026e251b94 Make with_items a lookup plugin 2012-10-25 15:10:33 +02:00
ffca0283b0 Closing pool explicitly may cause some exceptions on certain Pythons, disable for now. 2012-10-25 09:07:33 -04:00
73cd3ef617 Only strip trailing newlines from output, preserving other space 2012-10-25 14:26:37 +02:00
2d4e5ced90 Move contrib to .rst off the main docsite 2012-10-25 14:14:34 +02:00
13a422261b Use the delegated host's interpreters 2012-10-25 14:10:04 +02:00
89f28a98dd User is alias for name in 'user' module 2012-10-25 14:03:13 +02:00
895715b65b Merge pull request #1445 from sfromm/issue1439
Skip check of primary group when checking other group membership
2012-10-25 03:58:17 -07:00
27c38c357d Merge pull request #1444 from sfromm/issue1211
Write ssh key to temp file
2012-10-25 03:57:34 -07:00
544dc76704 Create temp file in directory where ssh key lives 2012-10-24 20:50:11 -07:00
b2e94e53fc Write keys file to temp location to avoid potential corruption 2012-10-24 20:47:45 -07:00
e97916cfc1 Skip check of primary group when checking other group membership 2012-10-24 20:39:42 -07:00
f2a7ca9a36 Merge pull request #1435 from stijnopheide/mysql-grant
Mysql grant, take 2
2012-10-24 18:18:13 -07:00
3e491513a9 Merge pull request #1432 from skvidal/devel
yum enablerepo/disablerepo option complete
2012-10-24 17:13:29 -07:00
bbe66e7610 Merge pull request #1437 from lorin/sudo-nonroot-bugfix
Fix chmod occurring as wrong user when sudo as non-root
2012-10-24 17:01:32 -07:00
2191a4d519 Merge pull request #1436 from jhoekx/dsquare-uses-ansible
Add D square to who_uses_ansible.
2012-10-24 17:00:29 -07:00
2dd6ee5f70 Merge pull request #1438 from dagwieers/selinux-module-fix
Resolve traceback when python-selinux is not installed
2012-10-24 16:59:52 -07:00
56ae266855 Merge pull request #1440 from jpmens/latex1
DOCUMENTATION: LaTeX template is back
2012-10-24 16:58:52 -07:00
9fca4eb241 Merge pull request #1441 from dhozac/better-error-missing-template
Improve the error message for missing files
2012-10-24 16:58:28 -07:00
29e272eb67 Merge pull request #1442 from dhozac/dwim-fileglob
path_dwim the path given to with_fileglob
2012-10-24 16:58:12 -07:00
b1200c16df path_dwim the path given to with_fileglob 2012-10-25 00:52:42 +02:00
e216116807 Improve the error message for missing files 2012-10-25 00:30:05 +02:00
afa467e975 DOCUMENTATION: LaTeX template is back
ongoing work for the Booklet
2012-10-24 19:42:52 +02:00
f4c4537327 Resolve traceback when python-selinux is not installed 2012-10-24 18:57:24 +02:00
38fdc24966 Fix chmod occurring as wrong user when sudo as non-root
If you sudo to a non-root user, you get a permission denied error.
Here's an example:

    $ ansible myserver.example.com -m postgresql_db -a "db=mydatabase" -u ubuntu -s -U postgres
    myserver.example.com | FAILED >> {
        "failed": true,
        "msg": "chmod: changing permissions of `/tmp/ansible-
        1351092257.96-157699143369671/postgresql_db': Operation not
        permitted\n/usr/bin/python: can't open file '/tmp/ansible-
        1351092257.96-157699143369671/postgresql_db': [Errno 13]
        Permission denied\n",
        "parsed": false
    }

The problem is that ansible is doing the chmod as the sudo user
when it should be doing it as the remote user.
2012-10-24 11:30:56 -04:00
0a153c6798 add comments that enablerepo/disablerepo are new in 0.9 2012-10-24 09:08:42 -04:00
b6ead4d9f8 Add D square to who_uses_ansible. 2012-10-24 15:05:35 +02:00
733693ffdc - removed space escapes from MySQL SHOW GRANTS regex
- proper checking for with grant option (if this is not the only option the user has)
- added revoking of grant option
2012-10-24 15:02:54 +02:00
6b92b69fe6 added the GRANT privilege for a mysql user (WITH GRANT OPTION) 2012-10-24 15:02:54 +02:00
f1f44843c3 close the pool. 2012-10-24 07:56:23 -04:00
92ce8a0517 Refine new keyboard interrupt handling. Output still a bit gross. 2012-10-24 07:46:24 -04:00
47b1315ac7 Reinstate Ctrl+C handling 2012-10-24 07:40:48 -04:00
ca4fb043ef Merge pull request #1433 from jpmens/doc_user
fix DOCUMENTATION for user
2012-10-24 04:26:50 -07:00
82955606c4 fix DOCUMENTATION for user 2012-10-24 07:35:56 +02:00
d8337dab06 tested and verified yum enable/disablerepo option for yum module 2012-10-24 00:46:15 -04:00
d89d07550f first cut at yum module with enable/disable repo 2012-10-24 00:24:40 -04:00
9626111d5b Merge pull request #1427 from bleader/devel
mount: update example with mandatory option
2012-10-23 21:02:46 -07:00
bfa66ba9ed Merge pull request #1429 from nigelm/nigelm_doc_tweaks
Fix $last_result documentation and spelling tweaks - issue #1420
2012-10-23 21:01:45 -07:00
cf4bcde220 Merge pull request #1430 from sfromm/issue1425
Document ssh_key options are in version 0.9
2012-10-23 21:01:03 -07:00
5d8c130a7f Document ssh_key options are in version 0.9 2012-10-23 08:21:40 -07:00
ccd8d7c287 Spelling fixes 2012-10-23 15:54:16 +01:00
dd5629cd51 Correct $last_result example in playbooks doc 2012-10-23 15:51:11 +01:00
e16e3fb4ca mount: update example with mandatory option
- 'state' is required, but wasn't in example

Signed-off-by: bleader <bleader@ratonland.org>
2012-10-23 15:49:47 +02:00
f9a2f4687e Merge pull request #1426 from jpmens/docs_examples1
Reformat code: examples consistently
2012-10-23 06:18:47 -07:00
feab57e270 Reformat code: examples consistently
- added terse syntax to modules.rst
 - added description of special variables to template module
2012-10-23 15:14:01 +02:00
a4af4a7049 Since we are not needing to pass runner through the multiprocessing queue, just use
multiprocessing.pool.  Pushing so it can get wider testing.
2012-10-23 08:19:15 -04:00
856dd5a9aa Don't pass runner instance through the mulitprocessing queue, fix temp dir removal 2012-10-23 08:04:32 -04:00
51d8e042df update changelog 2012-10-23 07:58:47 -04:00
ce413ab01d Merge pull request #1416 from skvidal/devel
make --limit take a , as a separator as well as ; or :
2012-10-22 18:33:14 -07:00
d63fa6f026 make --limit take a , as a separator as well as ; or : 2012-10-22 21:24:25 -04:00
8afa3abd41 Merge pull request #1413 from pas256/devel
Inventory script to gracefully handle AWS being down
2012-10-22 16:42:36 -07:00
ae351b71b6 Merge pull request #1414 from sfromm/issue1412
Help git module work when working in 'no branch' scenario
2012-10-22 16:42:05 -07:00
769bd9125a Help git module work when working in 'no branch' scenario
Detect when on a 'no branch' branch.  If so, checkout the HEAD branch
as reported by 'git remote show <remote>'.  That should put the repo
back on a branch such that git can then merge changes as necessary.
In addition, removed hard-coded references to origin and replaced
with remote var.
2012-10-22 16:03:35 -07:00
60c69e9845 Allowing the EC2 inventory script to gracefully handle AWS API issues 2012-10-22 14:08:30 -07:00
109632e3bc Revert "Vars specified via CLI have the highest priority."
Reverting as this as reported allows some variables to clobber each other.
We'll work on a different fix.

This reverts commit c5469f6367.
2012-10-21 16:42:15 -04:00
5020af0a45 Merge pull request #1404 from dagwieers/doc-fix1
Clarify how only_if works, also combined with with_items
2012-10-22 04:57:42 -07:00
7d990fa167 Clarify how only_if works, also combined with with_items
- The old documentation stated not to quote the variable in the function, which is obviously wrong. When using lists or integers, we have to quote otherwise the startswith() method will trip over its non-existence.
- It was unclear that the only_if statement is processed for each item when doing with_items, so I added an example making it crystal clear how this can be used in your advantage (or why a non-existing list variable can break your logic if you expected the only_if to be processed once before running the task)
2012-10-22 12:30:47 +02:00
52f2ed5fe1 Merge pull request #1399 from dhozac/set-delegate-for-alias
Fix ansible_ssh_host again
2012-10-21 15:25:10 -07:00
1449c8ac67 Fix ansible_ssh_host again
This time with unit tests to ensure it keeps working.
2012-10-21 21:22:56 +02:00
c9c5fc1456 Merge varFind and varLookup 2012-10-21 20:32:02 +02:00
572c66b7f6 Add a bit more info about tests to CONTRIBUTING 2012-10-21 07:15:30 -04:00
3c6d9972fe clarify message about name of configuration parameter 2012-10-21 07:12:06 -04:00
4fd14ac3e7 Merge pull request #1396 from nigelm/nigelm_doc_tweaks
Added some info on the unit tests requirements
2012-10-21 04:04:59 -07:00
cc30eb74e2 Added some info on the unit tests requirements 2012-10-21 09:41:18 +01:00
dad331d0a5 update changelog 2012-10-20 23:07:49 -04:00
cbc12f0dba Various performance streamlining and making the file features usable in all modules without daisy chaining. 2012-10-20 22:55:09 -04:00
60b9316ad8 Merge pull request #1393 from baalexander/devel
Adds release date for Cathedral
2012-10-20 18:58:03 -07:00
ce7656d9cd Adds release date for Cathedral
I also prepended each single digit month with a 0 for the dates to line up. Feel free to change that :)
2012-10-20 17:21:10 -07:00
4104478abd Added 'script', a module that can push and insantly run a remote script. Replaces the need to copy+command.
This is a bit of a rough draft, some error handling still needs to be added.
2012-10-20 12:12:07 -04:00
7e2d6c0050 Clarify first_available_file is only for copy/template 2012-10-20 11:16:05 -04:00
019f775a93 DWIM the paths for first_available_file 2012-10-20 11:11:31 -04:00
6fa1a49037 Fix the basic templating system such that when the template ends in '$', life continues as normal. 2012-10-20 10:57:52 -04:00
6b8448051f Merge pull request #1389 from sfromm/issue1214
Add ability to create SSH key for user in user module
2012-10-20 07:30:24 -07:00
3c739b1a88 Merge pull request #1339 from inertialbit/add-basic-pg-role-attribute-support
add role_attr_flags parameter to postgresql_user
2012-10-20 07:29:26 -07:00
ed9f5eed09 Merge pull request #1338 from alopropoz/extra_vars_override
Vars specified via CLI have the highest priority.
2012-10-20 07:29:12 -07:00
87954f2110 Use os.path.join where appropriate 2012-10-19 22:22:27 -07:00
63ba441163 Add ability to create SSH key for user in user module
This allows one to create a SSH key for user.  You may define:
ssh_key_type, ssh_key_bits, ssh_key_file, ssh_key_comment,
and ssh_key_passphrase.  If no passphrase is provided, the
key will be passphrase-less.  This will not overwrite an existing key.
In the JSON returned, it will provide the ssh_fingerprint and
ssh_key_file.
2012-10-19 22:00:31 -07:00
5bdc16338e Release version bump for 0.9 (development branch) 2012-10-19 21:01:57 -04:00
67b1372d63 Update packaging and CHANGELOG for release 2012-10-19 20:46:59 -04:00
ed7776d44c update changelog 2012-10-19 20:45:06 -04:00
68cf9a96fc Merge pull request #1388 from goozbach/selinux_bugs
make policy only be required if state is not disabled
2012-10-19 16:35:15 -07:00
f2b2777762 Merge pull request #1386 from jkleint/devel
Update Hadoop contrib URL.
2012-10-19 16:33:55 -07:00
51b423b593 Merge pull request #1387 from skvidal/devel
when a pkg is installed, but not from any repo, don't error out
2012-10-19 16:33:35 -07:00
99180e7da3 make policy only be required if state is not disabled 2012-10-19 17:17:30 -04:00
326b160241 when a pkg is installed, but not from any repo, don't error out
that it is not installed.

Also when a pkg is both installed and in a repo do not look it up
more than once
2012-10-19 16:28:39 -04:00
859a898df6 Update Hadoop contrib URL.
References issue #1380.
2012-10-19 10:49:44 -04:00
cde377bddb Merge pull request #1385 from dhozac/raise-error-for-scripts-too
Raise error for missing hosts in inventory scripts as well
2012-10-19 07:30:01 -07:00
b8021f12e0 Raise error for missing hosts in inventory scripts as well 2012-10-19 16:26:12 +02:00
2e3273595a Merge pull request #1383 from dhozac/fix-for-local-port
None is unfortunately not an integer
2012-10-19 07:24:48 -07:00
e3d18048d4 None is unfortunately not an integer 2012-10-19 16:18:38 +02:00
5a08da98a3 Update contrib/README.md 2012-10-18 21:58:17 -03:00
d509dfc969 delete extra else clause 2012-10-18 20:27:39 -04:00
452668ce83 Merge branch 'devel' of git://github.com/willthames/ansible into devel 2012-10-18 20:23:10 -04:00
33c1e6d9af update changelog 2012-10-18 20:21:27 -04:00
31b45479e8 When using delegation, local_action should always use the local connection type. 2012-10-18 20:18:33 -04:00
d58bc4da4e Merge pull request #1361 from lantins/devel
Copy module can replace symlink with a real file.
2012-10-18 16:59:45 -07:00
896be48ac9 Merge pull request #1367 from jpmens/mdtempl
Add support for Github-flavored Markdown to module_formatter
2012-10-18 16:59:18 -07:00
05866bba1e Merge pull request #1372 from jpmens/rst_template1
module_formatter: .rst now correctly handles code examples
2012-10-18 16:58:08 -07:00
e59f5d609b Merge pull request #1373 from jpmens/who1
Addition to WhoUses + typo fix
2012-10-18 16:57:50 -07:00
655682b7bb Merge pull request #1374 from brainpage/symlink_fix
symlink fix
2012-10-18 16:57:25 -07:00
1e6e5c216c Merge pull request #1375 from sergevanginderachter/devel
docsite: small typo in handlers example yaml
2012-10-18 16:57:06 -07:00
6300d93132 Merge pull request #1378 from dhozac/ansible_ssh-fixes
Fixes for ansible_ssh_host and ansible_ssh_port
2012-10-18 16:54:20 -07:00
979999b886 Port should be an integer 2012-10-18 21:48:57 +02:00
19797e1a29 Accessing a node that doesn't exist throws an exception 2012-10-18 21:48:10 +02:00
d04bd04f80 typo in handlers example yaml 2012-10-18 14:35:35 +02:00
702469f7bf symlink fix 2012-10-18 20:08:57 +08:00
b6eacd1631 Addition to WhoUses + typo fix 2012-10-18 14:03:22 +02:00
575459465e module_formatter: .rst now correctly handles code examples
- fixed template (it was the template), adding indentation with Jinja2
 - added description of code examples to man-page template (was missing)
 - fixed fireball, cron, and debug module examples to confrom
2012-10-18 13:49:19 +02:00
d4f89122f4 Add support for Github-flavored Markdown to module_formatter
- Uses HTML tables and Github-flavored code blocks (3 backticks)
2012-10-18 07:34:17 +02:00
5a769a5a4d Fixed tests to reflect desired configuration behaviour
Test for when environment variable and configuration file
variable both set now tests that the environment variable takes
precedence

Removed logic that would never be triggered from
lib/ansible/constants.py
2012-10-18 12:53:30 +10:00
556799a7c4 add error message if keyczar is not installed and the user tries to use fireball mode 2012-10-17 22:53:22 -04:00
d5db8e937e Fix port overrides such that with fireball mode you don't have to specify an explicit port. 2012-10-17 22:50:17 -04:00
8fca862e17 Merge branch 'documentation' of git://github.com/lantins/ansible into devel 2012-10-17 22:36:48 -04:00
fd6a26239c Env var vs config priority fixing 2012-10-17 22:34:59 -04:00
21b1e6c5a4 Add who uses ansible page back. 2012-10-17 22:28:24 -04:00
0dbd3aa821 Add examples to user module documentation. 2012-10-18 02:55:58 +01:00
4f17aa9fa0 Fix indent of fail module example to prevent unwanted <blockquote></pre></p> <br/></blockquote> from showing up in docsite output. 2012-10-18 02:09:11 +01:00
7d41045b2f Erroneous space in facter documentation. 2012-10-18 01:20:40 +01:00
6354898b09 Copy module can replace symlink with a real file. 2012-10-18 01:04:52 +01:00
54257a6a4c Remove "the the" 2012-10-17 19:38:17 -04:00
0837a29e51 Only expand lists in templating inside of module action lines, to avoid breaking usage with with_items and "in" statements, etc 2012-10-17 19:35:12 -04:00
acf2c23808 Various tweaking of the delegate_to loop code. 2012-10-17 19:17:41 -04:00
37b91c7b81 Fix ansible_ssh_host after 339c05bb 2012-10-17 19:17:41 -04:00
6ce844167a Merge pull request #1360 from dhozac/remove-debug-print
Remove debug print statements
2012-10-17 14:05:59 -07:00
519a1f3f23 Remove debug print statements 2012-10-17 22:45:17 +02:00
d9ce7adde7 Merge pull request #1357 from nigelm/nigelm_doc_tweaks
Added comment about long lines in playbooks
2012-10-17 07:50:12 -07:00
a457d24b97 Added comment about long lines in playbooks
I had trouble finding this information, so though it was worth
adding to docs... but am not sure its easy to find for someone
specifically to find.  At least I think this inclusion matches the
tone of document, but maybe this info should go into a FAQ
instead/as-well?
2012-10-17 15:31:33 +01:00
50abc73bd2 Merge pull request #1353 from jpmens/moduledev1
Indicate module_formatter can produce boilerplate DOCUMENTATION
2012-10-17 05:08:10 -07:00
9991dfee6c Indicate module_formatter can produce boilerplate DOCUMENTATION
add ./hacking/
2012-10-17 08:18:39 +02:00
47c4775e94 Merge pull request #1351 from cocoy/ec2-v2
Fix check boto version bug #1280. Using try/except for AttributeError.
2012-10-16 20:16:40 -07:00
8344511e47 Fix check boto version bug #1280 2012-10-17 10:47:28 +08:00
22e3e7f323 Allow use of variables in delegate_to 2012-10-16 21:05:09 -04:00
a69e59ab2b Allows delegate_to to use inventory host/port info. 2012-10-16 20:57:37 -04:00
8c3abe7e52 Fix cowsay! Moo. 2012-10-16 20:01:12 -04:00
edb7a054ae Merge pull request #1349 from bcoca/fix_bsd_dmesg_jails
fixed but in pulling data from dmesg command, wrong function to use as f...
2012-10-16 16:15:36 -07:00
26ee03a43f Searchindex should not be part of source control 2012-10-16 19:14:51 -04:00
2bef84e666 Rebuild docs 2012-10-16 19:14:21 -04:00
97bc11795a more 0.8 docs 2012-10-16 19:12:31 -04:00
0677891fc6 More docs 2012-10-16 19:09:15 -04:00
a98886c77f Further docs hacking 2012-10-16 19:03:54 -04:00
1801ded34d more playbook docs 2012-10-16 18:58:31 -04:00
ca261e8961 more 0.8 documenting 2012-10-16 18:51:10 -04:00
620aeeb572 fixed but in pulling data from dmesg command, wrong function to use as file for for loop
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-10-16 18:44:09 -04:00
63100c9bc0 Docs + fix variable precedence of environment variables (ok, ok, I give in!) 2012-10-16 18:40:01 -04:00
95db898cde add docs on fireball 2012-10-16 18:30:18 -04:00
5bb8dcea08 Fix help text 2012-10-16 18:17:44 -04:00
618418a440 RST typo 2012-10-16 18:17:04 -04:00
6f14e35c36 Merge pull request #1335 from phgrau/devel
Use && for executing next command if, and only if, command1 returns an e...
2012-10-16 15:16:46 -07:00
7583704144 "force=" code under the file module is problematic, remove it 2012-10-16 18:14:42 -04:00
f3407dec0e Merge branch 'basedir-plugins' of git://github.com/dhozac/ansible into devel 2012-10-16 18:00:55 -04:00
4405244224 Docs rebuild 2012-10-16 18:00:47 -04:00
fea5d36417 Merge pull request #1343 from jpmens/eeemail
typo
2012-10-16 05:47:43 -07:00
e35d5188f9 typo 2012-10-16 14:40:35 +02:00
f160502b7b Merge pull request #1337 from skvidal/devel
trivial --syntax-check option to ansible to just do the yaml validation
2012-10-15 16:24:12 -07:00
7da94e0359 Merge pull request #1334 from bcoca/cowsay4bsd
cowsay for BSD!
2012-10-15 16:22:23 -07:00
37bdefae74 add role_attr_flags parameter to postgresql_user
Pass role_attr_flags a list of comma separated role
attributes when creating or updating a user.
2012-10-15 16:03:10 -07:00
41195d0d49 trivial --syntax-check option to ansible to just do the yaml validation
check. Lots of room to make this more interesting - but not today
2012-10-15 17:48:25 -04:00
c5469f6367 Vars specified via CLI have the highest priority. 2012-10-16 04:34:54 +07:00
4290a904ff Add note: Debian Squeeze has no add-apt-repository 2012-10-15 17:20:23 +02:00
9b15b5d592 Use && for executing next command if, and only if, command1 returns an exit status of zero. 2012-10-15 16:56:55 +02:00
e98153d26d cowsay for BSD!
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-10-15 10:17:21 -04:00
ab44a4abba Load additional plugins from path specified in configuration 2012-10-14 21:09:24 +02:00
1aaf86069a Look for plugins in the playbook's basedir 2012-10-14 21:09:23 +02:00
036f853d42 Merge pull request #1330 from wzzrd/pip
Test for python-pip as well as pip
2012-10-14 06:57:15 -07:00
2f6b9e69a7 Test for python-pip as well as pip
On Red Hat, CentOS and Fedora systems, the pip binary will be called python-pip
instead of pip. This commit makes the pip module also check for python-pip.

The reason we check for python-pip *first*, is to have ansible fail on not
finding 'pip' and reporting *that*. This is consistent with current behaviour
and will not confuse users of Debian et al., where the 'python-pip' binary
never exists.

Tested on Fedora 18 and Ubuntu 12.04.
2012-10-14 12:14:59 +02:00
05ae500d78 Merge pull request #1329 from tbielawa/pausequotes
The pause 'prompt' parameter now requires quotes around the message.
2012-10-13 07:49:04 -07:00
8831e59700 The pause 'prompt' parameter now requires quotes around the message. 2012-10-12 23:48:08 -04:00
8dadf8a905 Use 'path' in file documentation, though src/dest work, it's less intuitive. 2012-10-12 22:08:07 -04:00
7b6f8e485a refine example 2012-10-12 21:39:35 -04:00
2c90298841 Merge pull request #1314 from apenney/bugfix/git
Check rc instead of parsing for errors.
2012-10-12 18:18:04 -07:00
fb686d40bc Merge pull request #1322 from sfromm/moduleformatter
Miscellaneous fixes to module_formatter.py
2012-10-12 17:17:59 -07:00
971dd53622 Added documentation on looping over with_* like fileglob 2012-10-12 20:15:13 -04:00
dd3beb844f add lookup plugins to setup.py 2012-10-12 20:07:45 -04:00
c5d2f6b0d3 implement lookup plugins for arbitrary enumeration over arbitrary things. See the mailing list for some cool examples. 2012-10-12 20:07:05 -04:00
60f06c36b3 Miscellaneous fixes to module_formatter.py
Try to autodetect MODULEDIR, instead of hardcoded path in jpmens
homedir.
Check if MODULEDIR exists; exit if it doesn't.
Rewrite boilerplate() to use DOCUMENTATION.yaml in examples/.  This
makes use of tbielawa's recent change that added this example file.
This also fixes -G so that it works.  boilerplate() was commented out
before.
2012-10-12 16:27:01 -07:00
29d49d415f fix mentioning of redundant aliases in module docs, remove was removed anyway 2012-10-12 18:14:09 -04:00
7644dbe330 Update some examples to explain why notify is not used 2012-10-12 18:12:22 -04:00
621708e976 user module should be using module.BOOLEANS for choices 2012-10-12 18:06:36 -04:00
aa98c84a62 HP and vsphere modules are crazy awesome but I am thinking these belong in contrib not core. 2012-10-12 17:49:48 -04:00
85d6af637a update changelog 2012-10-12 17:38:31 -04:00
70ed560fb3 Add FILES to manpage 2012-10-12 17:37:30 -04:00
6886683e16 small patch to fact gathering for when no dmesg.boot exists on freebsd, mainly happens in jails
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-10-12 17:37:30 -04:00
291648ccd9 Fix documentation consistency in .gitignore 2012-10-12 17:37:30 -04:00
579b80ab8f Fix redundancy in .gitignore file 2012-10-12 17:37:30 -04:00
d90210973d Merge pull request #1307 from sfromm/pull2
updates to ansible-pull
2012-10-12 14:34:53 -07:00
271db7bddb Merge pull request #1308 from abondis/named_action
named actions + modules list in utils.py
2012-10-12 14:33:43 -07:00
35163bce96 Merge pull request #1310 from dagwieers/hpilo_boot-cleanup
hpilo_boot: Various clean ups in documentation and code
2012-10-12 14:33:05 -07:00
b1ccda00f8 Merge pull request #1311 from dagwieers/hpilo_facts-cleanup
hpilo_facts: Various clean ups in documentation and code
2012-10-12 14:32:46 -07:00
1487b6a1bb Merge pull request #1313 from dagwieers/vsphere_facts-cleanup
vsphere_facts: Various cleanups in documentation
2012-10-12 14:32:31 -07:00
3a8dc2308b Merge pull request #1315 from dagwieers/mail-callback-improvement
This should set the sender properly.
2012-10-12 14:31:30 -07:00
a82522a5c4 Merge pull request #1317 from abondis/fix_mysql_db
fix issue with mysql authentication and states not dump or import
2012-10-12 14:26:45 -07:00
20a7227056 Merge pull request #1318 from dsummersl/cron24
fixed cron library so backups are python2.4 compatible
2012-10-12 14:25:51 -07:00
6d8d1ad426 Merge pull request #1320 from tbielawa/DOCUMENTATION
Add DOCUMENTATION for module documentation.
2012-10-12 14:25:07 -07:00
90944ec45a Merge pull request #1319 from jhoekx/virt-boot
Add virt_boot module.
2012-10-12 14:23:19 -07:00
4b04d7a914 Add DOCUMENTATION for module documentation. 2012-10-12 17:22:55 -04:00
0028a9d651 Merge pull request #1309 from abondis/tasks_sudo_option
#1303: add sudo option to tasks
2012-10-12 14:21:32 -07:00
25e415c031 Add virt_boot module to define libvirt boot parameters. 2012-10-12 22:40:04 +02:00
7399224428 fixed cron library so backups are python2.4 compatible 2012-10-12 16:34:34 -04:00
1f91a70310 fix issue with mysql authentication and states not dump or import 2012-10-12 16:26:59 -04:00
de34c7c133 This should set the sender properly. 2012-10-12 20:40:06 +02:00
f4484f800b Further cleanup to add another rc check and remove a now redundent one. 2012-10-12 18:26:40 +00:00
6042419624 Check rc instead of parsing for errors. This now catches the case where the remote branch has been deleted and you're still trying to pull against it. 2012-10-12 18:16:37 +00:00
5927373c26 Various clean ups in documentation and code
This commit improves the following items:
 - Remove the 'match' functionality, this can now be achieve by using the `fail` module together with `only_if` after running the `hpilo_facts` module. Since this gives more functionality, e.g. comparing server names, but also serial numbers or uuids with other inventory information, this is prefered. An example is added to show how this is achieved.
 - Clean up all C() calls in documentation
 - Added state=poweroff in order to power off a server. The use-case is here that in general we do not want to provision systems that are already running (this enforcement can be disabled using force=yes) but for test systems we should be able to power them off so we can start the normal provisioning process. (We could also force boot them, but that's less elegant)
 - The module now correctly indicates when something has changed. So if a server is powered off that was not off already, this is indicated, or when media boot-settings have been changed, this is also correctly indicated. Previously every call to hpilo_boot was (incorrectly) considered a change.
2012-10-12 19:49:30 +02:00
5fe8205d36 vsphere_facts: Various cleanups in documentation
This commit improves the following items:
 - Clean up all C() calls in documentation
 - Reindent the documentation
2012-10-12 19:46:20 +02:00
5612cce4a4 hpilo_facts: Various clean ups in documentation and code
This commit improves the following items:
 - Remove the 'match' functionality, this can now be achieve by using the `fail` module together with `only_if` after running the `hpilo_facts` module. Since this gives more functionality, e.g. comparing server names, but also serial numbers or uuids with other inventory information **and** a proper message, this is prefered. An example is added to show how this is achieved.
 - Clean up all C() calls in documentation
 - Remove trailing spaces in HP iLO's Serial Number output so that they can be compared to CMDB or other inventory information
2012-10-12 19:38:59 +02:00
6d183959ba #1303: add sudo option to tasks 2012-10-12 12:39:45 -04:00
2063e10c00 named actions + modules list in utils.py 2012-10-12 11:28:10 -04:00
60d3e9f3de Add --purge option to ansible-pull
Removes git checkout after playbook run.
2012-10-12 07:55:22 -07:00
034e8f59ed Clean up auto-selection of playbook and miscellaneous changes
Direct any ansible-pull specific messages to stderr.
Introduce try_playbook() and select_playbook() to remove try/except-y.
2012-10-12 07:55:22 -07:00
0841ed4796 change method of obtaining hostname to match ansible/library/setup 2012-10-12 07:55:22 -07:00
2b24131baa fetch the git repo before trying to find a playbook 2012-10-12 07:55:22 -07:00
788e11f1db Merge commits from copperlight's branch ansible-pull_playbook_parameter branch
Merged commits: 3cd25b5 and ed9fc76.  Some massaging of changes applied.
2012-10-12 07:55:22 -07:00
dfaef8061a Merge pull request #1289 from abondis/mysql_migration
mysql_db: connection test, dump/import state
2012-10-11 17:39:13 -07:00
a18e9d64c7 Merge pull request #1297 from sergevanginderachter/devel
updated gitignore for docssite stuff
2012-10-11 17:31:39 -07:00
34acc95435 Merge pull request #1296 from sergevanginderachter/da92ce796b48ec80e3ead1cfe9bcbc71f5fce805
fix missing --limit in docssite examples
2012-10-11 17:30:55 -07:00
69ad124bd2 Merge pull request #1298 from dagwieers/doc-optparse
Moving now from getopt to optparse
2012-10-11 17:30:33 -07:00
5849ab3162 Merge pull request #1300 from tbielawa/fix_module_path
Add DIST_MODULE_PATH so setup.py and ansible.spec can live in harmony
2012-10-11 17:30:23 -07:00
89f8562df9 Merge pull request #1304 from dhozac/vars_files-process-whole-list
Keep processing the rest of the vars_files even if one has vars
2012-10-11 14:56:41 -07:00
b8b34b5110 Keep processing the rest of the vars_files even if one has vars 2012-10-11 23:52:01 +02:00
baa91ebc95 Add DIST_MODULE_PATH so setup.py and ansible.spec can live in harmony. Closes #1277 2012-10-11 13:22:30 -04:00
2786149bdc Moving now from getopt to optparse
Let me know if we can move to another library instead ;-)
2012-10-11 18:14:38 +02:00
d5837aab23 Add some docssite and deb package related stuff to gitignore. 2012-10-11 18:13:08 +02:00
f3d7294690 Test for directory existance, fix exception catching granularity 2012-10-11 07:56:01 -04:00
448c89a06d It has been reported that occasionally the md5sum command on certain platforms (?) can fail, where I suspect there is noise in the output stream.
In those events, capture the output so we can report the error more properly.
2012-10-11 07:44:41 -04:00
d6b3f40cb7 Merge pull request #1290 from dagwieers/mail-doc-fix
Damn you, colons...
2012-10-11 04:20:05 -07:00
dfdf4ab8eb Damn you, colons... 2012-10-11 09:26:21 +02:00
1a51af0e38 mysql_db: use the database to test connexion, added dump and import state - requires target=path/to/a/file 2012-10-10 23:28:42 -04:00
6d2f003ceb Update formatter to not include orange blocks all over docsite page 2012-10-10 21:25:19 -04:00
7e542d78a7 Merge remote branch 'stijnopheide/jinja-relative' into devel
Conflicts:
	.gitignore
2012-10-10 20:24:12 -04:00
062484b9bd Put generated manpages back in correct directory 2012-10-10 20:09:40 -04:00
e74b9e1d34 Add .gitdir 2012-10-10 20:00:15 -04:00
b505a3796c Fix docsite example 2012-10-10 19:56:53 -04:00
e2497f0cff Merge remote branch 'abondis/named_actions_2' into devel 2012-10-10 19:53:19 -04:00
79069827c2 add presentation 2012-10-10 19:50:47 -04:00
6b0ef9fd26 Merge remote branch 'dagwieers/contrib-vsphere-boot' into devel
Conflicts:
	contrib/README.md
2012-10-10 19:50:04 -04:00
a873e1a467 Don't check in any module RST files as these are generated too. 2012-10-10 19:48:40 -04:00
e593c828b4 Merge remote branch 'dagwieers/module-mail' into devel 2012-10-10 19:46:38 -04:00
110244d7b4 Merge branch 'remove-argparse' of git://github.com/dagwieers/ansible into devel
Conflicts:
	hacking/module_formatter.py

Don't run webdocs build when building packages
2012-10-10 18:46:51 -04:00
8ae9831439 Don't check in docsite static HTML, so folks will know to just edit the RST. 2012-10-10 18:41:50 -04:00
dbeb26ad6d Don't check in modules.js either 2012-10-10 18:41:50 -04:00
fc9a6bb07c Docs/json should not be checked in 2012-10-10 18:41:50 -04:00
ee679c0190 Unified document generator and make to generate JSON and JS files 2012-10-10 18:41:50 -04:00
85fb83a5db Merge pull request #1282 from dagwieers/mail-callback
Example plugin to send out mails on error
2012-10-10 15:37:59 -07:00
da92ce796b fix missing --limit in docssite examples 2012-10-10 19:38:30 +02:00
ae94b050af Merge pull request #1283 from jhoekx/fix-inventory-api-groups
Fix inventory API groups
2012-10-10 09:51:36 -07:00
23a62f5a78 Return multiple groups from inventory API. 2012-10-10 18:35:45 +02:00
30c019447b Fix typo in inventory API test script. 2012-10-10 18:17:24 +02:00
bb58d3f20c Example plugin to send out mails on error
This is useful mostly for playbooks that run unattended and for a limited set of systems. In case of provisioninging this plugin (together with a final mail action) helps to get notified when something went wrong, or when the installation finished successfully.

Unfortunately, there is no way to enable/disable a plugin from a playbook. So installing the plugin means all other use-cases (provisioning, troubleshooting, reporting or management) all send mails on failure. Something we may want to fix in the future...
2012-10-10 17:28:00 +02:00
7788dea238 Merge pull request #1268 from dagwieers/hpilo-reboot-fix
Workaround for when HP iLO is in a state it won't accept requests
2012-10-10 05:34:22 -07:00
d855b4bcf6 Merge pull request #1270 from jhoekx/yaml-inventory-plugin
Add a yaml format inventory plugin.
2012-10-10 05:33:33 -07:00
8ae9125ff2 Merge pull request #1271 from mavimo/openstack-rackspace-update
Openstack rackspace update
2012-10-10 05:33:17 -07:00
822cb74aed Merge pull request #1274 from dagwieers/contrib-network-facts
Module network_facts to gather facts based on network information
2012-10-10 05:33:00 -07:00
f1dfddc5e5 Fix typo in autogenerated docs 2012-10-10 08:32:41 -04:00
bbf95abc8f Merge pull request #1276 from mxxcon/patch-1
Typo in example section for 'setup' module docs.
2012-10-10 05:31:22 -07:00
d5bb7258c8 Working on makefile 2012-10-10 08:03:52 -04:00
6b5f19a796 Typo in example section for 'setup' module. 2012-10-09 20:41:26 -03:00
0ebc46628a Module vsphere_boot to boot VMWare virtual machine using specific media 2012-10-10 00:29:59 +02:00
e8b0b07311 Module network_facts to gather facts based on network information 2012-10-10 00:20:50 +02:00
cdb8343ec6 Added documentation for nova inventory system 2012-10-09 21:44:39 +02:00
7fed89b51d Improved RackSpace configuration support (needed by latest version of rackspace API) 2012-10-09 21:43:58 +02:00
2290dfe1ef Add a yaml format inventory plugin.
This fixes #1265.
2012-10-09 19:56:52 +02:00
2f74cd84bd Module mail to send out emails as an action
Sending mails could be part of the workflow to have teams/responsibles perform specific task. Or simply to notify that a process has finished successfully (e.g. provisioning).
2012-10-09 19:36:23 +02:00
790ed81b14 Workaround for when HP iLO is in a state it won't accept requests
This workaround is recommended from HP iLO's documentation, but may not be sufficient in all cases. Time will tell.

I also made a few cosmetic changes with no impact.
2012-10-09 19:31:31 +02:00
de912381ac Update CHANGELOG.md 2012-10-09 10:38:48 -03:00
06688efb24 Merge pull request #1263 from dagwieers/hpilo_facts-fix
Sigh, another retypo
2012-10-09 05:22:49 -07:00
49fc8c7634 Merge pull request #1264 from dagwieers/doc-fixes
Fixes to documentation
2012-10-09 05:22:26 -07:00
98624cb394 Fixes to documentation 2012-10-09 12:42:10 +02:00
3f149e09bc Sigh, another retypo problem 2012-10-09 12:30:00 +02:00
2dcd0846ab Use getopt instead of argparse
On RHEL5 and RHEL6 there is not argparse, and 'make rpm' fails because of this.
With this change it works, and I can test and fix my own documentation...
2012-10-09 12:23:30 +02:00
e07bfd9ef8 playbook/tasks: allow to use a module's name instead of action: 2012-10-09 00:21:13 -04:00
4bd17ee518 Fix up changelog 2012-10-08 19:24:20 -04:00
dcee25c6db Update gitignore 2012-10-08 19:21:50 -04:00
3d66ca59f9 Update changelog 2012-10-08 19:20:55 -04:00
04954dbc1e Makes ports configurable for fireball. Note port defaults really belong in the connection plugins, not runner, which can be refactored later. 2012-10-08 19:03:37 -04:00
612561ad0e Merge pull request #1250 from dagwieers/hpilo_boot-fixes
Various small fixes to boolean usage and defaults
2012-10-08 14:27:20 -07:00
62a56a219b Merge pull request #1243 from dsummersl/squash2-cron
cron feature (w/o tests)
2012-10-08 14:25:55 -07:00
013aa2533a Merge pull request #1256 from tbielawa/keep_man3_dir
Keep the man3 directory. 'make docs' breaks without it.
2012-10-08 14:25:35 -07:00
1b36446ab3 Merge pull request #1255 from dagwieers/module-namespace
Add this module's namespace to the 'module_' namespace.
2012-10-08 14:25:20 -07:00
5a16a270fc Merge pull request #1257 from tbielawa/service_typo
Fix typo in service module docs
2012-10-08 14:21:41 -07:00
136a7d5604 Merge pull request #1260 from jhoekx/inventory-in-hostvars
Add inventory variables for hosts not in the play to hostvars.
2012-10-08 14:19:33 -07:00
46a4ae74a7 Add inventory variables to hostvars.
Look up only when requested and cache the result.
2012-10-08 20:26:58 +02:00
1e35ac7603 Fix typo in service module docs 2012-10-08 12:46:16 -04:00
9541b47b52 Keep the man3 directory. 'make docs' breaks without it. 2012-10-08 12:28:20 -04:00
c3a6e8dfd6 added new documentation string to cron library 2012-10-08 11:10:40 -04:00
b39aed8736 Add this module's namespace to the 'module_' namespace.
Much like we currently have *setup* register the variable `module_setup`, we would like other facts-modules register their own namespace. This means that:

 - *network_facts* registers `module_network`
 - *hpilo_facts* registers `module_hw`
 - *vsphere_facts* registers `module_hw`

In retrospect, it would have made more sense to have `setup` register `module_ansible` instead as the setup module uses the `ansible_` namesepace.

Having the `module_` namespace allows us to check whether a certain namespace has already been loaded so we can avoid running the facts module a second time using only_if.

```yaml
 - action: network_facts host=${ansible_hostname_short}
   only_if: is_unset('$module_network')
```
2012-10-08 15:13:17 +02:00
5503cfaa44 Various small fixes to boolean usage, using module.params.get and default values 2012-10-08 15:07:02 +02:00
f32778aa93 Update links to contrib 2012-10-08 08:23:11 -04:00
5c09fd4210 update links to plugins 2012-10-08 08:22:05 -04:00
343e07a31a chapter 3 manpage source does not belong in git because it includes datestamps that constantly change. Willing to re-add if datestamps
are removable.
2012-10-08 08:10:37 -04:00
4a95194424 Docs rebuild in new project structure. 2012-10-08 08:09:27 -04:00
dd727ecebf Update README 2012-10-08 08:06:48 -04:00
56e8863683 Update README 2012-10-08 08:04:21 -04:00
2319c4d74f Redundant CONTRIBUTING file 2012-10-08 08:03:59 -04:00
35fdc5411f update CONTRIBUTING 2012-10-08 08:03:44 -04:00
87d9eeae57 Remove unused graphics 2012-10-08 07:49:00 -04:00
2eac8c6c29 Merge ansible-resources tree 2012-10-08 07:48:07 -04:00
41dd4a1f93 Merge plugins tree 2012-10-08 07:45:25 -04:00
d6e4b1bf5b Subtree merge of ansible-docs 2012-10-08 07:44:38 -04:00
bb0b2305e3 rebuild 2012-10-08 07:39:06 -04:00
f010bcde33 Docs should indicate with_items and yum/apt logic is available 2012-10-08 07:38:21 -04:00
4a6b5c5de2 relative paths for (include/extends) in jinja2 templates 2012-10-08 08:56:57 +02:00
c8854a23ea Merge pull request #1251 from dagwieers/hpilo_facts-fixes
Fix typo/cosmetic change
2012-10-07 16:58:05 -07:00
63b0e5e752 Merge pull request #1252 from dagwieers/vsphere_facts-fixes
Vsphere facts fixes
2012-10-07 16:57:19 -07:00
250f52bfba Add an alias 'name=' for guest
This is the opposite as library/virt, but much better than using name= as the default option name.
2012-10-07 22:23:22 +02:00
8c5a146013 Fix typo/cosmetic change 2012-10-07 22:12:00 +02:00
c5d7ef3d7f Merge pull request #1249 from dagwieers/module-hpilo_boot
Module hpilo_boot to boot from specific media using an HP iLO interface
2012-10-07 06:12:42 -07:00
26bbac3062 Merge pull request #1246 from jpmens/nocows
Not for cow lovers: optionally disable cowsay
2012-10-07 06:11:29 -07:00
051f66cf16 Not for cow lovers: optionally disable cowsay
spaces now cow-compatible
2012-10-07 11:23:42 +02:00
b58228a73b Module hpilo_boot to boot from specific media using an HP iLO interface
This module allows to boot a system through HP iLO and can be used to start the provisioning process.
2012-10-06 23:56:50 +02:00
323cbdafb7 Merge pull request #1240 from jpmens/hpdoc
fix examples in hpilo_facts DOCUMENTATION
2012-10-06 13:39:31 -07:00
d74a61d362 Merge pull request #1248 from mmikulicic/force-color
Added a ANSIBLE_FORCE_COLOR env var, which forces the color output
2012-10-06 13:37:44 -07:00
cc82e7dd06 Added a ANSIBLE_FORCE_COLOR env var, which forces the color output no matter what ncurses says. 2012-10-06 20:36:07 +02:00
3d65d6159f cron feature (w/o tests) 2012-10-05 21:35:37 -04:00
a1c23af6fc Merge pull request #1239 from jpmens/shelldoc
fix wording of shell documentation
2012-10-05 06:11:31 -07:00
91dc8bc136 fix examples in hpilo_facts DOCUMENTATION 2012-10-05 15:07:45 +02:00
70907f574e fix wording of shell documentation 2012-10-05 14:59:49 +02:00
0679537495 Merge pull request #1235 from jpmens/man3
man pages have wrong chapter number
2012-10-05 05:10:08 -07:00
1737d6b884 Merge pull request #1236 from jpmens/manansible1
remove duplicate private-key option from manpage
2012-10-05 05:09:57 -07:00
9f1690ab64 Merge pull request #1237 from dagwieers/lineinfile-alias
Use the standard 'dest' option for target files, make 'name' an alias
2012-10-05 05:09:36 -07:00
70b063ce0e Use the standard 'dest' option for target files, make 'name' an alias 2012-10-05 11:03:14 +02:00
a9dad7f3bd remove duplicate private-key option from manpage 2012-10-05 09:18:19 +02:00
ba22ca13ba man pages have wrong chapter number 2012-10-05 09:09:49 +02:00
f470ebe6b7 Merge pull request #1213 from dagwieers/debug-module
Module debug to assist users in understanding Ansible
2012-10-04 16:28:25 -07:00
0592e1be79 Merge pull request #1222 from alopropoz/devel
Indicate errors with exit code.
2012-10-04 16:26:00 -07:00
ebc2fe08c3 Merge pull request #1218 from jpmens/jtempl3
Allow user-specified $ansible_managed string
2012-10-04 16:18:57 -07:00
a95bff0f5f Merge pull request #1230 from dagwieers/module-vsphere_facts
Module vsphere_facts to add facts from a VMWare vSphere guest
2012-10-04 16:18:39 -07:00
5d7ab8a300 Merge pull request #1231 from dagwieers/fail-doc-fix
This hopefully fixes the documentation for the fail module
2012-10-04 16:18:10 -07:00
adfc4d6f59 Merge pull request #1232 from dagwieers/module-hpilo_facts
Module hpilo_facts to add facts from HP iLO interfaces
2012-10-04 16:17:40 -07:00
8c8552ac32 Module vsphere_facts to add facts from a VMWare vSphere guest
This module gathers facts from a VMWare vSphere guest by querying vSphere. The facts include OS, network info (vlan, macaddress) and system info (cpu, memory, uuid) information. Useful information for provisioning and management.
2012-10-04 21:55:16 +02:00
e07674d756 Module hpilo_facts to add facts from HP iLO interfaces
This module gathers facts from the hardware interface by querying HP iLO. The facts include network info (vlan, macaddress) and system info (cpu, memory, uuid) information. Useful information for provisioning and management.

This module was previously named ilo_facts and mentioned in #1080, #1085, #1125 and #1217.
2012-10-04 21:50:34 +02:00
3d5c4df2ac This hopefully fixes the documentation for the fail module 2012-10-04 20:58:07 +02:00
184523ecac Merge pull request #1220 from tbielawa/pause_variables
Fix variable injection in pause module args. Closes #1209
2012-10-04 05:14:41 -07:00
c3f443f56c fix sorting 2012-10-04 07:08:13 -04:00
8f5beb74c5 Fix sort order issue 2012-10-04 07:08:01 -04:00
05464816c2 Different return codes for different errors. 2012-10-04 17:43:25 +07:00
03af450bdc Module to assist users in understanding Ansible
After helping someone on IRC he was interested to have this debug module in upstream. This module simply 'prints' a message, and can be ordered to fail if needed. It helps to troubleshoot or understand inventory/facts issues and/or experiment with statements and conditions using only_if.

Here is a small example playbook:

```yaml
- hosts: all
  tasks:
  - local_action: debug msg="System $inventory_hostname has uuid ${ansible_product_uuid}"
  - local_action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
    only_if: "is_unset('$ansible_default_ipv4.gateway')"
  - local_action: debug msg="System $inventory_hostname has gateway ${ansible_default_ipv4.gateway}"
    only_if: "is_set('$ansible_default_ipv4.gateway')"
```

outputting:
```
[root@moria ansible]# ansible-playbook -v -l localhost:x220 test6.yml

PLAY [all] *********************

GATHERING FACTS *********************
ok: [localhost]
ok: [x220]

TASK: [debug msg="System $inventory_hostname has uuid $ansible_product_uuid"] *********************
ok: [localhost] => {"msg": "System localhost has uuid d125a48c-364f-4e65-b225-fed42ed61fac"}
ok: [x220] => {"msg": "System x220 has uuid d125a48c-364f-4e65-b225-fed42ed61fac"}

TASK: [debug msg="System $inventory_hostname lacks a gateway" fail=yes] *********************
failed: [localhost] => {"failed": true, "msg": "System localhost lacks a gateway", "rc": 1}
ok: [x220] => {"msg": "System x220 has gateway 192.168.1.1"}

PLAY RECAP *********************
localhost                      : ok=2    changed=0    unreachable=0    failed=1
x220                           : ok=3    changed=0    unreachable=0    failed=0

```

I had some other plans for the module, like displaying host inventory and complete inventory to help understand inventory and facts modules, but that would require an action-plugin for transfering inventory information etc... And I am not sure this is wanted/best done in a module.
2012-10-04 09:50:18 +02:00
9ed59da294 Allow user-specified $ansible_managed string with named parameters 2012-10-04 08:50:51 +02:00
9f6da7b885 Fix variable injection in pause module args. Closes #1209 2012-10-03 23:52:26 -04:00
761330b125 Fix module formatter indexing 2012-10-03 23:31:50 -04:00
94546831b4 Typo fix/rebuild 2012-10-03 23:31:19 -04:00
348b49c166 Fix typo 2012-10-03 23:27:43 -04:00
88433eb93f Fix typo / rebuild 2012-10-03 21:00:27 -04:00
826c71fcb1 Fix patterns typo, rebuild 2012-10-03 21:00:26 -04:00
e170d7304b Added documentation on file force parameter 2012-10-03 20:57:36 -04:00
a6f64a8e04 Merge pull request #1219 from tbielawa/move_modulepages
Library functions and modules should be in the 3 man page section. Also ...
2012-10-03 17:49:03 -07:00
01e922aa69 Indicate errors with exit code. 2012-10-04 03:11:14 +07:00
85fb7c6d4b Library functions and modules should be in the 3 man page section. Also the files should end in '.3' 2012-10-03 10:18:55 -04:00
8fa2070074 Merge pull request #8 from jpmens/rstlist
Makefile uses module_formatter now creates list of modules to include in .rst
2012-10-03 05:38:30 -07:00
53d24ef002 Check in generated manpage documentation from modules 2012-10-02 22:46:49 -04:00
046c6c66f2 various small doc tweaks 2012-10-02 22:43:46 -04:00
ad5433b166 include version added info for individual fields 2012-10-02 22:36:27 -04:00
f67aa85c3f Fixing various module related things. 2012-10-02 22:32:17 -04:00
85a31616de Call os.path.expanduser in the creates= and removes= section of the command module so ~/ and the like works. 2012-10-02 22:12:49 -04:00
b3548703f7 Merge pull request #1203 from dagwieers/fail-module
A fail module in order to fail execution on certain conditions
2012-10-02 19:07:38 -07:00
d14741799a Merge pull request #1204 from dagwieers/fatal-red
Make fatal errors red
2012-10-02 19:06:36 -07:00
459d9ea30d Merge pull request #1205 from dagwieers/ignore-cyan
Make ignored/skipped different from changed
2012-10-02 19:06:14 -07:00
212296e59c Merge pull request #1207 from dagwieers/gather_facts-fix
Fix gather_facts assumption that SETUP_CACHE for a host is empty
2012-10-02 19:05:54 -07:00
cef73d1545 Merge pull request #1202 from dagwieers/abort-play-abort-playbook
Abort a play at the start when no hosts matches, or no hosts are remaining
2012-10-02 19:02:27 -07:00
fedfd18774 Fix gather_facts assumption that SETUP_CACHE for a host is empty
We now check explicitely for 'module_setup' in the SETUP_CACHE in order to avoid skipping setup because SETUP_CACHE was populated some other way. Other modules can implement the same mechanism to test if they've already run.

This closes #1206.
2012-10-02 23:17:45 +02:00
f11ab4383a Make ignored/skipped different from changed
Since a skipped/ignored action is _very_ different from actual changes to a system, it always bothered me that  it was not easily distinguishable when skimming the output. This change makes ignore/skip a different color, and I chose cyan. Contemplated using dark-gray/blue, but prefered something that is readable with most terminal colors.
2012-10-02 21:49:04 +02:00
7acc0a632b Make fatal errors red 2012-10-02 21:45:42 +02:00
1d27909ec0 Added a fail module in order to fail execution on certain conditions
In some cases you may want to deliberately fail the execution of a playbook. In our provisioning workflow we want to have safeguards in place to avoid provisioning systems that are already in production. Since we reboot physical and virtual systems, it is mandatory we take all the precautions to prevent accidental provisioning.

So in our use-case we have the following at the very start of the provisioning playbook:

    ### Safeguard to protect production systems
    - local_action: fail msg="System is not ready to be staged according to CMDB"
      only_if: "'$cmdb_status' != 'to-be-staged'"

and we repeat the same task in the (separate included) play that takes care of (re)booting the system using our own boot-media, so that it cannot be accidentally separately run by someone.
2012-10-02 21:40:28 +02:00
20c1a67711 Abort a play at the start when no hosts matches, or no hosts are remaining
This change makes a distinction between no_hosts_matched and no_hosts_remaining.

In both cases we do not start facts-gathering, or run any tasks.

In the case that there are no more hosts remaining, we abort running tasks and abort the playbook.

I also cleaned up the leftovers from the previous patchsets, as these are no longer required.

This closes #1187.

Example playbook:

```yaml
---
- hosts: emptygroup
  tasks:
  - action: command date
  - action: command false

- hosts: all
  gather_facts: False
  tasks:
  - action: command ls
  - action: command false
  - action: command true

- hosts: all
  tasks:
  - action: command true
  - action: command false

- hosts: all
  tasks:
  - action: command pwd
```
2012-10-02 15:54:24 +02:00
e1b1702616 Merge pull request #1201 from dhozac/setup-once-per-node
Only gather facts once per node per playbook run
2012-10-02 06:36:31 -07:00
564a212b3c Only gather facts once per node per playbook run
Unless gather_facts: True is on the play
2012-10-02 15:30:19 +02:00
56d45074af Merge pull request #1200 from broferek/master
Fix for issue #1194
2012-10-02 06:27:03 -07:00
17423c9268 Fix issue https://github.com/ansible/ansible/issues/1194 2012-10-02 15:12:33 +02:00
9bab05bafc Merge pull request #1197 from dagwieers/utc-date
Make use of UTC dates for RPM timestamp
2012-10-02 05:32:10 -07:00
765061d445 Make use of UTC dates for RPM timestamp
So they can be shared/compared by people in different timezones
2012-10-02 14:29:57 +02:00
4677699500 Merge pull request #1195 from jpmens/jtempl
Feature: file info on templates accessible to Jinja2 templates
2012-10-02 05:18:27 -07:00
6616fba1ab Merge pull request #1189 from jpmens/nagpause
standardize DOCUMENTATION for nagios, pause
2012-10-02 05:15:56 -07:00
5f04ef8b4c Feature: file info on templates accessible to Jinja2 templates
add ansible_managed
2012-10-02 14:15:27 +02:00
7779da264d Merge pull request #1190 from jpmens/asy1
attempt at DOCUMENTATION for async_status
2012-10-02 05:15:21 -07:00
a1f192976f attempt at DOCUMENTATION for async_status 2012-10-02 09:56:55 +02:00
83029755f7 standardize DOCUMENTATION for nagios, pause 2012-10-02 09:15:11 +02:00
f897f19fc5 Teach fireball mode to disable the fireball by paying attention to 'minutes=N' (default 30) and do not let fireball module crash
on input.
2012-10-01 22:41:00 -04:00
14f7c85ce7 Include a space and a colon after prompts, so you don't have to put them in yourself. Consistent with documented behavior in examples/playbooks/prompts.yml 2012-10-01 22:15:34 -04:00
b90eccc4f8 Merge pull request #1186 from dhozac/varreplacewi-nonstr
Allow non-string types in with_items variables
2012-10-01 19:10:05 -07:00
2165351f2c Merge pull request #1185 from tbielawa/pause_docs
Add DOCUMENTATION to pause task
2012-10-01 19:09:24 -07:00
b2ad63a860 Merge pull request #1183 from tbielawa/nagios_docs
Add DOCUMENTATION to nagios module.
2012-10-01 19:08:58 -07:00
5683277e4a Be smarter about when to abort a playbook -- if it's early, we just didn't match any hosts, so keep on, hosts might be dynamic. 2012-10-01 22:07:08 -04:00
ca87fa56d8 Add DOCUMENTATION to pause task 2012-10-01 12:42:03 -04:00
f3d9f8da7b Add DOCUMENTATION to nagios module. 2012-10-01 12:26:57 -04:00
35de8da108 Merge pull request #1180 from dhozac/remove-debug-print
Remove debug print statement
2012-10-01 08:24:21 -07:00
48c5d696d2 Remove debug print statement 2012-10-01 17:23:21 +02:00
f785f1ea15 Merge pull request #1179 from dhozac/fix-per-task-mv
Give each task its own module_vars
2012-10-01 08:19:43 -07:00
a83aa1071b Give each task its own module_vars
Otherwise each task will overwrite the previous' items, among
other things.
2012-10-01 17:17:39 +02:00
695b4bcb46 Allow non-string types in with_items variables 2012-10-01 17:07:51 +02:00
886a17853f Merge pull request #1176 from jpmens/fireball-doc1
fireball DOCUMENTATION
2012-10-01 05:46:02 -07:00
f2dc815e3f fireball DOCUMENTATION
- amended
2012-10-01 14:39:15 +02:00
6600f7b7ac Merge pull request #1170 from jpmens/docspatch01
Jumbo DOCUMENTATION patch
2012-10-01 05:19:16 -07:00
ac3ec0a410 Merge pull request #1173 from dhozac/command-quote-less
Use a regexp to filter out arguments instead
2012-10-01 05:17:29 -07:00
b86dc96d55 Merge pull request #1174 from jpmens/docs-authors
Added missing attribution to all module DOCUMENTATION strings
2012-10-01 05:14:44 -07:00
a72a6e42c5 Added attribution to all module DOCUMENTATION strings 2012-10-01 12:37:51 +02:00
6477bdc6fc Use a regexp to filter out arguments instead
pipes.quote is a bit overzealous for what we want to do, quoting ;
and other characters that you most likely want to use in your shell
invocations. The regexp is the best I could come up with to be able
to only replace the parts of the arguments that shouldn't be
executed.
2012-10-01 12:13:17 +02:00
e620fed755 Jumbo DOCUMENTATION patch 2012-10-01 09:18:54 +02:00
880328c10f organize changelog 2012-09-30 21:33:38 -04:00
31a4fe412f Complain when modules do not have documentation. 2012-09-30 21:10:07 -04:00
a2f76c1c69 If all hosts in a play fail, fail the whole playbook and don't bother printing out every remaining task. 2012-09-30 21:06:00 -04:00
22f3aef4dc remove test for private function that is no longer present 2012-09-30 20:49:16 -04:00
19b78cedc8 Abort a play when there are no more hosts in it. 2012-09-30 20:48:35 -04:00
5846c1b8c4 Merge pull request #1125 from dagwieers/setup-retain
Make sure we retain facts between playbooks
2012-09-30 17:18:40 -07:00
d0eba79760 Template out sudo_user so you can pass in variables using --extra-vars 2012-09-30 20:11:51 -04:00
8e9344eef7 add an error when user tries to async something that can't be asynced 2012-09-30 20:06:55 -04:00
d9bc01f443 Merge pull request #1169 from jpmens/modformatter01
module_formatter can output lists of files to process (.rst and .tex)
2012-09-30 12:59:18 -07:00
635689b3af Merge pull request #1168 from sfromm/issue1007
Add message reporting skipped action in cli callback
2012-09-30 12:56:28 -07:00
eb8a11237c module_formatter can output lists of files to process (.rst and .tex) 2012-09-30 19:07:40 +02:00
7ef70c263f module_formatter now creates list of modules to include 2012-09-30 19:02:58 +02:00
cf3e368d15 Add message reporting skipped action in cli callback 2012-09-30 08:54:20 -07:00
190e4c26d1 Merge pull request #1167 from jpmens/slurp01
module docs for slurp
2012-09-30 08:15:19 -07:00
f67c070c0a Merge pull request #7 from jpmens/slurp
Added missing slurp and fireball to modules list
2012-09-30 08:14:52 -07:00
2275b2f950 Added missing slurp and fireball to modules list
- This list should probably be generated by module_formatter ...
- modules.rst includes _list.rst for list of modules
- module-formatter will generate that list
2012-09-30 17:11:58 +02:00
8b737c959d module docs for slurp 2012-09-30 16:58:15 +02:00
a00d6d7234 Merge pull request #1166 from mavimo/documentation-seboolean
Added DOCUMENTATION to seboolean module.
2012-09-30 06:44:02 -07:00
f9bdf07387 Added DOCUMENTATION to seboolean module. 2012-09-30 15:41:00 +02:00
f8060d109e Merge pull request #1165 from mavimo/documentation-selinux
Added DOCUMENTATION to selinux module.
2012-09-30 06:36:27 -07:00
349af83c91 Merge pull request #1164 from jpmens/modformatter
module_formatter now also uses Jinja2 trim_blocks
2012-09-30 06:36:09 -07:00
1290aa2668 Merge pull request #1163 from jpmens/fireball-doc
template DOCUMENTATION added to fireball
2012-09-30 06:35:57 -07:00
7491054ed6 Added DOCUMENTATION to selinux module. 2012-09-30 15:34:26 +02:00
e4338d0ca3 module_formatter now also uses Jinja2 trim_blocks
- Updated man template accordingly
- seem to have left in illegal char in facter DOCUMENTATION...
2012-09-30 15:06:18 +02:00
8a4df98f69 template DOCUMENTATION added to fireball 2012-09-30 14:50:32 +02:00
f13e20655e Merge pull request #1161 from jpmens/rst03
rst output template tweak for 'required'
2012-09-30 05:34:31 -07:00
f5e0fbf65b rst output template tweak for 'required' 2012-09-30 14:21:30 +02:00
e756ee3741 Merge pull request #1159 from dhozac/include-with_items
Allow task includes to work with with_items
2012-09-30 05:13:32 -07:00
5aab75e71a Merge pull request #1160 from jpmens/virt01
Attribute author of virt correctly (sorry)
2012-09-30 05:10:54 -07:00
28698d5fcf Attribute author of virt correctly (sorry) 2012-09-30 14:08:47 +02:00
b96da3e5b0 Merge pull request #1158 from jpmens/man01
documentation: man template: support empty options; add Version
2012-09-30 05:00:39 -07:00
705f19d0e2 Merge pull request #1157 from jpmens/rst01
module docs: fixed rst template
2012-09-30 05:00:07 -07:00
b8a2a526fc Merge pull request #1156 from jpmens/m-docs5
DOCUMENTATION for virt
2012-09-30 04:59:24 -07:00
39c4a4f8a7 Merge pull request #1155 from jpmens/m-docs4
DOCUMENTATION for fetch,mount,ohai,easy_install; .rst template tweaks
2012-09-30 04:57:50 -07:00
3582c20abb Merge pull request #1154 from dhozac/varreplace-list-join
Replace lists with a comma-separated join
2012-09-30 04:57:11 -07:00
bf6e783d7a Merge pull request #1152 from sfromm/moduledocs
Add module documentation for git, group, service, and user
2012-09-30 04:56:37 -07:00
8ca106d266 Merge pull request #1153 from SleeplessAnnoyedNerd/gitignore
Ignoring PyCharm/IntelliJ and Mac OS X stuff (2nd try)
2012-09-30 04:56:07 -07:00
1af4677b66 Merge pull request #1151 from sfromm/lsb
Add LSB facts, as derived from lsb_release -a
2012-09-30 04:52:45 -07:00
8a8ffa2342 Allow task includes to work with with_items 2012-09-30 13:40:52 +02:00
61ee632d23 documentation: man template: support empty options; add Version to Makefile 2012-09-30 13:33:21 +02:00
80a9016636 module docs: fixed rst template
- notes is now supported
- multiline code examples are now supported (HTML rendering was off)
2012-09-30 13:20:24 +02:00
7a3b2ac287 DOCUMENTATION for virt 2012-09-30 12:40:11 +02:00
754888d896 DOCUMENTATION for fetch,mount,ohai,easy_install
- .rst now supresses default if none is set (looks better in HTML)
  - .rst now handles empty options list
  - Fixed postgresql_user and mysql_user because YAML contained colons
  - docs for facter
2012-09-30 12:29:32 +02:00
dfee6e19ca Replace lists with a comma-separated join 2012-09-30 11:41:44 +02:00
ddb358a3cf Ignoring PyCharm/IntelliJ and Mac OS X stuff 2012-09-30 11:08:41 +02:00
ed07940386 Add LSB facts, as derived from lsb_release -a
This gathers LSB facts via lsb_release.  This complements the
platform facts collected via the platform module.  This reoprts
release, id, description, release, and codename.  It also adds
'major_release', which is the major version number of a distribution.
2012-09-29 23:58:04 -07:00
be19e21126 Add module documentation for git, group, service, and user 2012-09-29 23:50:25 -07:00
13e8ef5f35 Merge pull request #1146 from dhozac/command-escape-args
Properly parse escaped special arguments
2012-09-29 16:25:37 -07:00
7d86663dd2 Merge pull request #1150 from dhozac/varreplacefile-typo
Fix typo in $FILE()
2012-09-29 16:25:17 -07:00
62db667760 Fix typo in $FILE() 2012-09-30 01:19:22 +02:00
2d7691500e Merge pull request #1139 from lorin/config-precedence
ANSIBLE_CONFIG take precedence over ./ansible.cfg
2012-09-29 13:27:07 -07:00
e744e864d9 Merge pull request #1140 from mavimo/devel
Refs #1116: DOCUMENTATION string update
2012-09-29 13:26:42 -07:00
1fd5de21d2 Merge pull request #1149 from dhozac/non-greedy-filepipe
Complete the change from $FILE{} to $FILE()
2012-09-29 13:25:32 -07:00
8b55217df0 Merge pull request #1148 from dhozac/multiline-only_if
Allow multiline strings to work okay in only_if
2012-09-29 13:25:07 -07:00
e442175a9e Merge pull request #1147 from dhozac/filepipe-exception
Raise AnsibleError if $FILE() or $PIPE() fail
2012-09-29 13:24:48 -07:00
78911f1b26 Merge pull request #1145 from mavimo/documentation-supervisorctl
Added DOCUMENTATION to supervisorctl module.
2012-09-29 13:23:54 -07:00
4823371aff Merge pull request #1144 from mavimo/documentation-pip
Added DOCUMENTATION to pip module.
2012-09-29 13:23:41 -07:00
5599287927 Merge pull request #1143 from mavimo/documentation-shell
Added DOCUMENTATION to shell module.
2012-09-29 13:23:22 -07:00
2d81a1fa77 Complete the change from $FILE{} to $FILE()
Otherwise, parsing e.g. '$FILE(myfile)'.find("stuff") will include
everything up to the last ) as the filename.
2012-09-29 21:16:13 +02:00
be9d7df6c4 Allow multiline strings to work okay in only_if
Fixes issue #1137
2012-09-29 21:13:19 +02:00
e655e2f051 Raise AnsibleError if $FILE() or $PIPE() fail 2012-09-29 21:09:57 +02:00
9261d3962b Properly parse escaped special arguments
Fixes issue #1134
2012-09-29 21:05:49 +02:00
d80ec35183 Fixed error in author name 2012-09-29 21:04:17 +02:00
95d7b4c5db Added DOCUMENTATION to supervisorctl module. 2012-09-29 21:02:07 +02:00
ac5afcae28 Added DOCUMENTATION to pip module. 2012-09-29 20:53:28 +02:00
b1d88235f0 Added DOCUMENTATION to shell module. 2012-09-29 20:40:06 +02:00
e1c83b0367 Fixed error on official docs (reported on DOCUMENTATION string). Name param must be pkg and is required. 2012-09-29 18:23:13 +02:00
e30e9a74c2 Added DOCUMENTATION to postgresql_user module. 2012-09-29 16:46:30 +02:00
a4620920b2 Added DOCUMENTATION to postgresql_db module. 2012-09-29 16:46:13 +02:00
aa5ef9561d ANSIBLE_CONFIG take precedence over ./ansible.cfg 2012-09-29 10:44:14 -04:00
6184a0a313 Fixed doc string 2012-09-29 16:43:21 +02:00
0d0bc5e620 Added DOCUMENTATION to subversion module. 2012-09-29 16:28:55 +02:00
29ffed869c Added ping module author in docs. 2012-09-29 16:23:58 +02:00
2aaaf986d3 Added DOCUMENTATION to ping module. 2012-09-29 16:21:00 +02:00
a75348b406 Added DOCUMENTATION to musql_db module. 2012-09-29 16:15:52 +02:00
8898643c1d Added DOCUMENTATION to musql_user module. 2012-09-29 16:15:41 +02:00
9377c3f525 Merge pull request #1130 from commandtab/templates-trim-blocks
Setting trim_blocks to True
2012-09-29 05:25:56 -07:00
5a9ca1e513 Merge pull request #1135 from jpmens/mod-formatter3
Removed embedded colon in DOCUMENTATION of apt_repository
2012-09-29 05:15:42 -07:00
57c9534abb Simplify register example 2012-09-29 08:10:45 -04:00
0604d580d9 Removed embedded colon in DOCUMENTATION of apt_repository: building manpages failed 2012-09-29 12:53:17 +02:00
e108d1758c Merge pull request #1132 from jpmens/m-doc-inifile
removed EXAMPLES from ini_file
2012-09-28 17:59:30 -07:00
bc01f0d6fb Merge pull request #1133 from jpmens/doc-apt-fix
module DOCUMENTATION for apt, apt_respository cleanup
2012-09-28 17:59:10 -07:00
1193810d46 module DOCUMANTATION for apt, apt_respository cleanup 2012-09-29 01:51:55 +02:00
0649e637d3 removed EXAMPLES from ini_file
testing YAML in YAML: small glitch in rst template; a </pre></p> is outdented and causes messy display
2012-09-29 01:26:40 +02:00
ce5dceab0e Merge pull request #1128 from mavimo/devel
Added documentation to APT module
2012-09-28 16:12:58 -07:00
08a77135f3 Merge pull request #1126 from dagwieers/choices-fix
Fix to make sure only strings are being joined
2012-09-28 16:12:17 -07:00
508e6ecf43 Merge pull request #1131 from jpmens/m-docs3
Module DOCUMENTATION for template, wait_for, and yum
2012-09-28 16:11:33 -07:00
25a460fe0f Merge pull request #1127 from jpmens/m-docs1
Module DOCUMENTATION: assemble, authorized_key, command, copy
2012-09-28 16:11:03 -07:00
5e9793d742 Merge pull request #1123 from ralphbean/fireball-cleaning
Close zeromq context and socket.
2012-09-28 16:07:59 -07:00
a040807fd0 Module DOCUMENTATION for template, wait_for, and yum 2012-09-29 00:49:02 +02:00
7c600ae0d3 Setting trim_blocks to True 2012-09-28 14:58:05 -07:00
7b8bd280e8 Added documentation to APT_REPOSITORY module 2012-09-28 23:07:41 +02:00
94de4db928 Add JSON output format to DOCUMENTS and EXAMPLES parser 2012-09-28 22:38:27 +02:00
c976238a81 Added documentation to APT module 2012-09-28 22:35:29 +02:00
e0fb264a89 Module DOCUMENTATION: assemble, authorized_key, command, copy
plus a small fix in rst.j2 template
  manpages generated & checked
  modules.html generated & checked
2012-09-28 21:55:49 +02:00
27b2ae8ddc Fix to make sure only strings are being joined
Since BOOLEANS also contains integers, joining the list returns an error. Easy to test by giving a wrong value to a boolean argument:

    service name=httpd enabled=True

Since True is not in the allowed BOOLEANS, it will cause the error, which in its turn bails out because it joins strings and integers.
We may want to remove the integers from the choices since '0' and '1' are already in the list as strings. Personally I would expect only strings as arguments, not sure where these could be integers ??
2012-09-28 17:51:59 +02:00
c84e76e31d Make sure we retain facts between playbooks
This is mandatory if we want to make facts-modules (like network_facts, ilo_facts and esx_facts) work.
2012-09-28 17:44:51 +02:00
d25ee940c4 Close zeromq context and socket. 2012-09-28 08:22:53 -04:00
cc7b34e9bd Change syntax to module formatter script 2012-09-28 08:21:33 -04:00
6bbaa26f64 Merge pull request #1119 from jpmens/mod-formatter2
module_formatter fixes
2012-09-28 05:07:19 -07:00
8c370645a6 Merge pull request #1122 from dhozac/varreplace-no-repr
Revert pull request #1091
2012-09-28 05:06:05 -07:00
4b29c2cf74 Revert pull request #1091
Automatic quoting of variables in only_if breaks existing playbooks
where entire statements are put in a variable, and other cases. See
issue #1120 for details.
2012-09-28 13:58:23 +02:00
62d038dca4 module_formatter fixes 2012-09-28 09:59:43 +02:00
06cfc52afd fix tests and change nosetests flags so asserts show what comparisons failed 2012-09-27 22:12:15 -04:00
618a519ee3 Merge branch 'varreplace-lessre' of git://github.com/dhozac/ansible into devel 2012-09-27 22:08:38 -04:00
6b5088c676 update changelog 2012-09-27 21:48:38 -04:00
88f1294f74 Add ini file RST 2012-09-27 21:43:37 -04:00
0c855a85bc fix module formatter output messages 2012-09-27 21:34:28 -04:00
dff7b0fdbc Tweaking module docs as a result of integrating the new module docs generator 2012-09-27 21:33:55 -04:00
405c097c43 Various fixes for the module documentation auto-generator 2012-09-27 21:30:32 -04:00
83f277cfe6 Various tweaking to get the module formatter to work for 'make docs' in the docs project. Likely the templates for other module formatting types will have to change
by the time I'm done.
2012-09-27 21:06:31 -04:00
9a7a2a4d60 Merge branch 'mod-formatter1' of git://github.com/jpmens/ansible into devel 2012-09-27 19:50:00 -04:00
d68f22a28d Merge pull request #1115 from dagwieers/only_if-revert
Revert only_if for variables and templating prompt, little practical use
2012-09-27 16:43:24 -07:00
e7af005408 Revert only_if for variables and templating prompt
Since the condition was not templated, it wasn't working.
Only variables in local scope were used, which made this not very practical
2012-09-28 01:32:09 +02:00
10bce54ef0 Merge pull request #1098 from jpmens/ini_file
New module: manipulate INI-style settings
2012-09-27 16:03:45 -07:00
9e4fac5ebd Create a string parser for varReplace instead of using re
This fixes a few issues,
- ${foo}${bar} would be parsed as a variable named foo}${bar,
  which wouldn't be easily fixed without breaking ${foo.${bar}}
- allows escaping . in variable parts so e.g.
  ${hostvars.{test.example.com}.foo} works

This is slower than using re. 3 million templating calls take about
about twice as long to complete with this compared to the regexp,
from ~65 seconds to ~115 seconds on my laptop.
2012-09-28 01:03:34 +02:00
6506e17eff Merge pull request #1109 from dhozac/fix-varReplace-repr
Fix only_if statements referencing non-string types
2012-09-27 15:57:50 -07:00
6c6f2b46b4 Merge pull request #1110 from dhozac/rm-assemble-ap
Remove assemble action plugin, fix daisychaining
2012-09-27 15:54:27 -07:00
ee5246fc36 Merge pull request #1113 from jpmens/file_pipe
Strip trailing white space from $FILE()/$PIPE()
2012-09-27 15:54:09 -07:00
42620d2f19 Strip trailing white space from $FILE()/$PIPE() 2012-09-27 23:47:34 +02:00
b55ef665ba Fix only_if statements referencing non-string types
This fixes e.g. only_if: ${task.changed} which would always
evaluate to true due to it having been replaced by a string for its
boolean value. Also adds a test case to ensure it doesn't get
missed again.
2012-09-27 18:36:52 +02:00
66d0acfde3 Remove assemble action plugin, fix daisychaining 2012-09-27 18:30:08 +02:00
151085c745 Merge pull request #1105 from alopropoz/devel
Don't use ssh-agent if password is specified.
2012-09-27 05:29:23 -07:00
0db5ccfecb Don't use ssh-agent if password is specified. 2012-09-27 14:57:06 +07:00
69612ba16d The very first start of 'fireball mode', which uses ansible in SSH mode to deploy a ephemeral zeromq daemon (entirely optional) that is will die after
it is no longer used.  No key signing will be required.  At this point, development use only -- NOT complete.
2012-09-26 23:51:59 -04:00
d47e15a1f2 module_formatter in hacking/ 2012-09-26 20:41:44 +02:00
3035394159 Added support for module_formatter (in ansible/hacking/) 2012-09-26 20:36:48 +02:00
c2daa77089 New module: manipulate INI-style settings
split off examples from DOCUMENTATION into own array as per #1098
2012-09-26 13:44:19 +02:00
af8f11e3f7 Merge pull request #1096 from sfromm/issue1067
Ignore failure of stop command if start succeeds with state=restarted
2012-09-26 04:02:02 -07:00
19c0202aaf Ignore failure of stop command if start succeeds with state=restarted
In some cases (see issue #1067) with state=restarted, a failure to stop
the service (which wasn't running) would appear to the module to be a
failure to restart the service even though it successfully started the
service.  This changes the behavior of the service module to focus
on the return code of the start command.  If the rc of stop is not
0 and the rc of start does equal 0, it considers the service
successfully restarted.  It then ignores the rc, stdout, and stderr
from the unsuccessful stop command.
2012-09-25 22:51:13 -07:00
69517832cd Update changelog 2012-09-25 20:50:21 -04:00
c63189f650 Make output be cleaner on multi-line failed commands and parse errors. 2012-09-25 20:38:12 -04:00
07101085ca Merge pull request #1093 from brainpage/make_local_action_consistant
2 improvements to delegate_to
2012-09-25 17:17:33 -07:00
51216dcfae Add tests for varReplace repr 2012-09-25 20:14:58 -04:00
84f98534ae Make varReplace recursive instead of iterative 2012-09-25 20:14:58 -04:00
d181a64315 Use repr on replacements for only_if 2012-09-25 20:14:58 -04:00
489844f960 Merge pull request #1095 from pas256/devel
Getting negative host pattern matching to work with external inventory
2012-09-25 17:13:32 -07:00
5530d771b4 Merge pull request #1094 from sfromm/issue1048
Give nice error message if destination directory doesn't exist
2012-09-25 17:12:59 -07:00
df147ab921 Merge pull request #1089 from tbielawa/runner_pause
Add 'pause' action plugin and support plugins skipping the host loop.
2012-09-25 17:11:54 -07:00
8a4e969b93 Getting negative host pattern matching to work with external inventory
(same as commit 4caf85e37b, but for
excluded hosts as well as subsets)
2012-09-25 16:16:25 -07:00
f52624f6d2 Give nice error message if destination directory doesn't exist (issue #1048) 2012-09-25 14:57:32 -07:00
faed650bb1 allow vars in delegate_to 2012-09-26 03:47:17 +08:00
620accf117 make delegate_to localhost act like local_action 2012-09-26 02:57:00 +08:00
f500eeec1d Update README.md
URL update
2012-09-25 09:33:34 -03:00
f8a9541405 add __init__ to action plugins 2012-09-25 08:24:35 -04:00
730b617186 Add init, though it's not really used. 2012-09-25 08:21:59 -04:00
8e71b26264 Fix up 'changed' playbook output patch 2012-09-25 08:07:11 -04:00
3270c097ef Merge pull request #1090 from dagwieers/prompt-fix
Fix a typo in the prompt code
2012-09-25 04:58:43 -07:00
6b6e3c64c8 Fix a typo in the prompt code
This is unfortunately related to not being able to reuse the same code that was tested.
2012-09-25 11:51:33 +02:00
58a4d2f7b4 Add 'pause' action plugin and support plugins skipping the host loop. 2012-09-25 01:13:35 -04:00
27d3ac9dc6 Update website link 2012-09-24 21:56:37 -04:00
5dab2efcdf Fixed obvious bug with missing self parameter to is_executable method 2012-09-24 21:03:45 -04:00
29ac1a8efc Replace os.access with stat calls for determining the executability of a given path. 2012-09-24 21:03:45 -04:00
734db4ffe9 Merge pull request #1080 from dagwieers/prompt-only_if
Add an only_if option to vars_prompt to make prompts conditional
2012-09-24 17:42:17 -07:00
9778eaf4f9 Merge branch 'module_args-argument' of git://github.com/dhozac/ansible into devel 2012-09-24 20:39:48 -04:00
4e9a970616 Add an only_if option to vars_prompt to make prompts conditional
Sometimes you may want to allow variables through host_vars or inventory, but prompt for a value if it is not set or if the value does not conform to something specific. This option allows you to specify when you want to offer a prompt.

This patch also moves check_conditional to utils, and adds an is_unset() function which is nicer to read:

    only_if: "not is_set('${var}')"

vs

    only_if: "is_unset('${var}')"
2012-09-24 23:55:54 +02:00
b355dca7dd Merge pull request #1081 from dsummersl/changelabel
Modified 'ok' to 'changed' when a change has occured
2012-09-24 13:46:06 -07:00
b45437541a Merge pull request #1083 from dagwieers/prompt-template
Template the variable prompt to customize the message
2012-09-24 13:44:00 -07:00
069feb5d9c Template the variable prompt to customize the message
We have a password-prompt for a configurable login name. Since we require to ask the password for this specific login, it is important to indicate what password needs to be prov ided on the prompt. So the prompt needs to be templated. That's what this patch does.
2012-09-24 22:37:51 +02:00
04c535b1e9 Modified 'ok' to 'changed' when a change has occured 2012-09-24 16:07:56 -04:00
5d6022b001 page rebuild, FAQ now part of main site. 2012-09-23 20:43:01 -04:00
34f7e6ffa0 Pass module arguments as argument instead of keeping it in runner 2012-09-23 23:38:26 +02:00
3939f7a812 Merge pull request #1076 from SleeplessAnnoyedNerd/Issue-1075
[Issue #1075] Fixing setup module fails if PATH is not set on target hos...
2012-09-23 10:23:18 -07:00
2f97afb634 Merge pull request #1071 from dhozac/git-expanduser
User-expand the destination path of the git module
2012-09-23 10:21:04 -07:00
fc1d6ab6b5 Merge pull request #1070 from elementalvoid/devel
Distribution packaging should install all manpages
2012-09-23 10:20:49 -07:00
f5f17e98ff Merge pull request #1065 from dhozac/varreplace-include
Allow including files through variables
2012-09-23 10:20:26 -07:00
0b3e05d9a4 Merge pull request #1066 from jpmens/doc3_lineinfile
Added DOCUMENTATION to lineinfile module
2012-09-23 10:20:08 -07:00
b75c662ab7 Merge pull request #1072 from dhozac/ansible_ssh_host
Add an ansible_ssh_host inventory variable
2012-09-23 10:19:53 -07:00
4e6d89b5b5 Merge pull request #1073 from dcoutu/devel
Added cases for 'dead but subsys locked' status
2012-09-23 10:19:19 -07:00
0ff151f70b Merge pull request #1063 from jpmens/geturl_doc2
Tweak DOCUMENTATION YAML as per latest 991
2012-09-23 10:19:02 -07:00
78b7a3a115 [Issue #1075] Fixing setup module fails if PATH is not set on target host 2012-09-22 17:01:37 +02:00
8d97bb4f8e Add an ansible_ssh_host inventory variable 2012-09-22 00:57:55 +02:00
9bb83067bc Added cases for 'dead but subsys locked' status 2012-09-21 14:55:59 -04:00
f6af88fe9f User-expand the destination path of the git module 2012-09-21 19:20:05 +02:00
21e23b34d2 distribution packaging should install all manpages
closes #1069
2012-09-21 11:15:40 -06:00
5a75433ce9 Added DOCUMENTATION to lineinfile module 2012-09-19 22:29:11 +02:00
4ded8cb3b3 Change $FILE{} and $PIPE{} to $FILE() and $PIPE() 2012-09-19 17:58:16 +02:00
cc948f339c Allow including files through variables
$FILE{file} will be replaced with the contents of "file"
$PIPE{cat file} will be replaced with the output of "cat file"
2012-09-19 17:57:17 +02:00
b8c4bb9e6e Revert "Allow including files through variables"
This reverts commit bf47bb4753.

Conflicts:

	lib/ansible/utils.py
	test/TestUtils.py
2012-09-19 10:31:23 -04:00
60e0410298 Tweak DOCUMENTATION YAML as per latest 991 2012-09-19 16:09:26 +02:00
c22d86b92f Merge pull request #226 from lorin/cwd-config
Can specify ansible.cfg in current directory.
2012-09-19 06:44:41 -07:00
1bd9ea6440 Merge pull request #1062 from dagwieers/wait_for-fix
Fix on older python versions, plus various improvements
2012-09-19 06:36:56 -07:00
8912258016 Fix on older python versions, plus various improvements
This change includes:

 - (on possibly older python versions ?) a string variable test using the 'is' operator fails (so it always return ok immediately after initial delay)
 - add a missing socket.settimeout() for the state=started case (if the machine does not exist, timeout defaults to 60 seconds)
 - add a connect_timeout option to customize the default connection timeout
 - use socket.shutdown(2) to close immediately
 - return the elapsed time
2012-09-19 15:19:59 +02:00
4cd3262f50 Merge pull request #1054 from jpmens/geturl_doc1
First attempt at standardizing DOCUMENTATION string
2012-09-19 06:09:39 -07:00
e039d88438 Merge pull request #1061 from copperlight/fix-make-error
fix Makefile date command error on OSX
2012-09-19 06:06:07 -07:00
5072ed3bd3 date parsing for OSX is BSD-like 2012-09-19 05:56:55 -04:00
95bbe2ef8b Merge pull request #4 from mavimo/master
Add support for ./nova.ini file
2012-09-18 19:06:18 -07:00
b2af95e4a6 Change $FILE{} and $PIPE{} to $FILE() and $PIPE() 2012-09-18 21:34:55 -04:00
57f6ad458a update changelog 2012-09-18 21:29:00 -04:00
e1ecb95b3d Delete test that was coded against *local* resolv.conf -- obviously not going to be the same between people's computers 2012-09-18 21:16:35 -04:00
08b70949c7 Fix a test and a typo in an example 2012-09-18 21:10:07 -04:00
eefe66f1cc Squashed commit of the following:
commit 80a26a8175b779b707bc08e9d28c451c30ee4ada
Merge: b25b9fd 61e9b27
Author: Michael DeHaan <michael.dehaan@gmail.com>
Date:   Tue Sep 18 21:01:47 2012 -0400

    Merge branch 'devel' of git://github.com/alopropoz/ansible into file-force

commit 61e9b27df2
Merge: 3f6f329 16bf3e1
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:48:02 2012 +0700

    Merge remote branch 'upstream/devel' into devel

commit 3f6f3291df
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:41:31 2012 +0700

    'force' option for 'file' module.

commit 6223bba941
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:40:19 2012 +0700

    changed = True when changing symlink referent, #1008. Needed for tests.
2012-09-18 21:04:42 -04:00
b25b9fd840 Merge pull request #1058 from jkleint/devel
Support iteration over command output in with_items.
2012-09-18 17:55:40 -07:00
544a8e44d7 Merge pull request #1053 from dhozac/varreplace-include
Allow including files through variables
2012-09-18 17:53:02 -07:00
e041c2e2cd First attempt at standardizing DOCUMENTATION string (new DICT) 2012-09-18 14:04:43 +02:00
e7e68e69c2 Move patch notes to CONTRIBUTING.md 2012-09-17 23:03:11 -04:00
c607ba5740 Add CONTRIBUTING.md file 2012-09-17 22:59:35 -04:00
a478e5c981 update contributing file 2012-09-17 22:55:06 -04:00
086400cde0 Add CONTRIBUTING doc since github now supports this. 2012-09-17 22:42:32 -04:00
d77be4eecf Merge pull request #1052 from romeotheriault/add-SunOSVirtual-facts
Adding SunOSVirtual facts
2012-09-17 17:27:43 -07:00
5da4ab2d90 Merge pull request #1051 from sfromm/wile-e-coyote
Add pkg_mgr fact to setup (take 2)
2012-09-17 16:59:12 -07:00
d5b8553d1c Merge pull request #1056 from dhozac/task-transport
Allow transport on tasks, and use it for local_action
2012-09-17 16:53:33 -07:00
2a002f5c0b Support iteration over command output in with_items.
When the output of a command is stored in a register, this will create a
stdout_lines field in the result object that contains stdout split into a list
of lines.  This list can then be iterated over using with_items.
2012-09-17 16:57:33 -04:00
dd11b01350 Keep delegate_to so all auxiliary logic based on that works 2012-09-17 20:28:14 +02:00
9e78b10ae3 Add test data file 2012-09-17 18:31:49 +02:00
5bb0f6908b Allow transport on tasks, and use it for local_action 2012-09-17 18:28:37 +02:00
bf47bb4753 Allow including files through variables
$FILE{file} will be replaced with the contents of "file"
$PIPE{cat file} will be replaced with the output of "cat file"
2012-09-17 16:03:59 +02:00
d72eaa3fc5 Adding SunOSVirtual facts 2012-09-16 23:14:06 -10:00
65fe7b7003 Update package manager fact innards to a list of dicts 2012-09-16 21:42:55 -07:00
94eb11a6d7 Add pkg_mgr fact to setup
This should help facilitate playbook decision making that are not
strictly distribution specific, but more package manager.
2012-09-16 21:42:54 -07:00
7df0e5259f Merge pull request #1038 from bcoca/atomic_copy2
Atomic copy2
2012-09-14 15:53:49 -07:00
70777f044d Merge pull request #1047 from lotia/get_url_require_thirsty_if_dest_is_dir
Make get_url module always return dest.
2012-09-14 15:38:08 -07:00
4cffdbbc56 Merge pull request #1049 from copperlight/ansible-pull_example_logrotate
add logrotate config
2012-09-14 15:37:39 -07:00
0f5a4e2112 add logrotate config 2012-09-14 14:01:44 -04:00
c0aac03b0c url_get module returns dest
The url_get module now includes the destination in the returned JSON.
2012-09-14 08:34:41 +01:00
99746d4a83 Indicate thirsty argument required if dest is dir.
The check for the destination being a directory is now done before
checking if the file exists, that way the user is informed that the
thirsty argument is required.
2012-09-14 08:02:30 +01:00
49db16752f Can specify ansible.cfg in current directory. 2012-09-13 14:24:50 -04:00
16bf3e15c7 Merge pull request #1042 from dhozac/yum-install-rpm
Invoke is_installed correctly from rpm path
2012-09-13 05:12:09 -07:00
56b1a8ceed Invoke is_installed correctly from rpm path 2012-09-13 12:34:52 +02:00
88d1285f33 time is what i wanted, not gmtime
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-09-12 14:52:54 -04:00
06b914c5b3 small fix to prevent temp file from living past its succesful usage
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-09-12 14:47:06 -04:00
f5481621f8 made copy atomic by creating tmp file in dest location (ensures same partition)
uses pid and epoch to prevent collisions, good enough for most cases
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2012-09-12 14:42:51 -04:00
4a2bf7f60a rebuild from various pull requests 2012-09-11 22:29:42 -04:00
0725dd8dc8 Merge pull request #218 from marktheunissen/fix_password
Fix parameter names in documentation: passwd doesn't exist anymore
2012-09-11 19:29:07 -07:00
aca23f9402 Merge pull request #220 from lorin/include-playbook
Document including one playbook inside another
2012-09-11 19:28:42 -07:00
f9a65f42d1 Merge pull request #221 from lorin/postgres-priv
Fix priv argument in postgresql_user example.
2012-09-11 19:27:36 -07:00
4c5d98c7ee Merge pull request #222 from romeotheriault/copy-module-backup-option-docs
add backup option to the copy modules docs
2012-09-11 19:27:09 -07:00
7f3736bc2c Merge pull request #223 from nigelm/master
Pair of trivial documentation fixes
2012-09-11 19:26:40 -07:00
1f4cb79787 Merge pull request #224 from wzzrd/master
Small fix in documentation for seliux module
2012-09-11 19:25:59 -07:00
4503ad7c04 fix broken link 2012-09-11 22:13:59 -04:00
e7eab93243 Update changelog 2012-09-11 18:08:57 -04:00
04555f525e Fix a test from a previous pull request. 2012-09-11 18:04:54 -04:00
58ad934283 Merge pull request #1024 from tima/groups-pb
Made $groups and $group_names variables accessible in with_items
2012-09-11 14:59:05 -07:00
1829d519b5 Merge pull request #1030 from lorin/import-playbook-pathfix
Support import of playbooks in other directories
2012-09-11 14:58:27 -07:00
d7f83471ae Merge pull request #1032 from mavimo/patch-2
Add support for ./ansible.cfg file
2012-09-11 14:56:22 -07:00
522a3b5974 Merge pull request #1033 from jkleint/hosts-list-fix
Fix inventory.get_hosts when hosts is a list.
2012-09-11 14:55:18 -07:00
1f8696f5c1 Fix inventory.get_hosts when hosts is a list. 2012-09-11 13:00:40 -04:00
046e43ec11 Module user - typo corrected for state 2012-09-11 11:50:31 +01:00
cf9d7cd68e added backup option to the assemble,lineinfile and template module docs 2012-09-10 17:26:18 -10:00
ba1c9b04cb Correct selinux policy name: targetted -> targeted 2012-09-10 22:08:08 +02:00
dd023d137a Add support for differnt nova.ini file location: ./nova.ini, ~/nova.ini, /etc/ansible/nova.ini 2012-09-10 18:31:40 +02:00
84f2968023 Added a paragraph linking to the Jinja2 template docs 2012-09-10 16:09:30 +01:00
0cdd081b53 Add support for ./ansible.cfg file
Ansible support configuration in:
```
~/.ansible.cfg
/etc/ansible/ansible.cfg
```

this patch add current user (usefull where user have some different projects) with the oreder:
```
./ansible.cfg
~/.ansible.cfg
/etc/ansible/ansible.cfg
```
2012-09-10 17:57:32 +03:00
9d5a79f586 Made groups.groupname and group_names variables accessible in playbooks.
Also modified code that feeds the groups data structure to templates so
that it resolves groups inside of groups to hostnames.
2012-09-10 10:42:26 -04:00
c0495c3b9b Typo fix - playbook ignoring shell status return 2012-09-10 12:31:52 +01:00
1da9d23f90 Typo fix for assemble module 2012-09-10 11:51:16 +01:00
e12f3d4029 add backup option to the copy modules docs 2012-09-09 18:12:27 -10:00
b9e100a506 Support import of playbooks in other directories
Previously, importing a playbook in a different directory didn't
work because all of the relative paths were resolved relative to
the top-level playbook.

This patch resolves relative paths on a per-play level instead of
relative to the directory of the top-level playbook.

Also removes the dirname argument from the Play._get_vars method
since this argument wasn't used in the metho dbody.
2012-09-09 22:59:56 -04:00
df779decf6 who uses + rebuild 2012-09-08 23:03:54 -04:00
565f336182 lineinfile should use 'search' everywhere 2012-09-08 14:53:34 -04:00
14a9c3ab9e Line in file regexep should match a portion of the line, not the whole line! 2012-09-07 21:03:59 -04:00
95540f40b0 Add package to setup.py 2012-09-07 21:03:59 -04:00
5b57011152 Merge pull request #1027 from mcodd/setup_bug_python24
setup not python24 compatible in 0.7
2012-09-08 05:24:09 -07:00
335f136e71 Merge pull request #1023 from lorin/postgres-user-fix
Fix postgresql_user bug
2012-09-08 05:23:29 -07:00
e795fa1ec2 Merge pull request #1014 from marktheunissen/journald
Fix regex that allows passwords to get into syslog, use journal if available.
2012-09-08 05:22:27 -07:00
925c9eb38f Merge pull request #1021 from lorin/config-key
Have ansible respect private_key_file option
2012-09-08 05:21:02 -07:00
8ebd228bd3 Merge pull request #1022 from skvidal/devel
add import sys to virt module b/c it needs it if the libvirt python
2012-09-08 05:20:07 -07:00
c0638842d8 make this python24 compatible 2012-09-07 22:47:03 -04:00
aa91e11906 Merge pull request #1025 from dhozac/action_plugins-setup
Install action_plugins
2012-09-07 16:10:36 -07:00
5b49a059ac Install action_plugins 2012-09-08 00:21:56 +02:00
20fc6a29d3 Made groups.groupname and group_names variables accessible in playbooks. 2012-09-07 18:07:52 -04:00
b3b01bb7a3 Fix postgresql_user bug
If I create a database from scratch and assign permissions by doing:

      - name: ensure database is created
        action: postgresql_db db=$dbname

      - name: ensure django user has access
        action: postgresql_user db=$dbname user=$dbuser priv=ALL password=$dbpassword

Then it fails with the error:

  File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 565, in <module>
    main()
  File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 273, in main
    changed = grant_privileges(cursor, user, privs) or changed
  File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 174, in grant_privileges
    changed = grant_func(cursor, user, name, privilege)\
  File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 132, in grant_database_privilege
    prev_priv = get_database_privileges(cursor, user, db)
  File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 118, in get_database_privileges
    r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl)
  File "/usr/lib/python2.7/re.py", line 142, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

This fix fixes the problem by not executing the regex if the
db query on pg_database returns None.
2012-09-07 16:24:00 -04:00
20c6e5302b Fix priv argument in example.
Should be "priv", not "privs". Was correct in table, but wrong in
examples.
2012-09-07 16:18:39 -04:00
9d88b3eedd add import sys to virt module b/c it needs it if the libvirt python
module is missing
2012-09-07 16:05:42 -04:00
eabbaaec46 Have ansible respect private_key_file option
The ansible command-line tool was ignoring the private_key_file option.
2012-09-07 14:37:32 -04:00
869a97e1cb Fix comment in example config file.
The config file incorrectly mentions the --private-key-file flag.
Should be --private-key
2012-09-07 14:34:36 -04:00
ccd0952d54 Document including one playbook inside another 2012-09-07 09:16:08 -04:00
0709c48f64 Merge pull request #1018 from willthames/template_perms
Fix templates for non root sudo_user
2012-09-07 05:20:02 -07:00
f456d999a9 Fix templates for non root sudo_user
When using template module, if a restrictive umask is set, the
sudo_user won't be able to read the /tmp/ansible-dir/source file
after it is copied across following _transfer_str

I wonder if this behaviour shouldn't be abstracted somehow (as
this correction also happens after put_file in the copy module too)
2012-09-07 16:35:53 +10:00
ad9e2939bf Fix parameter names 2012-09-06 18:16:05 -07:00
c25ead382c Adapt module common code to use the systemd journal if it's available 2012-09-06 17:59:38 -07:00
022b2290bb Changelog update for 0.8 initial merges 2012-09-06 20:58:23 -04:00
dc14681530 rename isset to is_set 2012-09-06 20:55:27 -04:00
8621539341 Merge branch 'only_if-isset' of https://github.com/dhozac/ansible into devel 2012-09-06 20:55:11 -04:00
4280e00d56 Merge pull request #1000 from mavimo/patch-1
Add support to removes control param
2012-09-06 17:52:02 -07:00
7ef3e7dccb Merge pull request #1003 from bladypirat/devel
added support for custom port definition for postgresql_* modules
2012-09-06 17:51:35 -07:00
49bef3f6c2 Merge pull request #1005 from dagwieers/cmdline
Add /proc/cmdline information to the default facts
2012-09-06 17:51:19 -07:00
fa71237f8a Merge pull request #1012 from jpmens/sshhostkeysosx
Add support for RSA/DSA SSH host key detection in setup module for OS/X
2012-09-06 17:50:32 -07:00
ba97ad13e3 Merge pull request #1010 from tima/yaml-jinja
Added to_yaml and from_yaml filters to Jinja environment.
2012-09-06 17:50:01 -07:00
8a09e1281b Fixup modularized template module 2012-09-06 19:04:27 -04:00
633e513a65 Modular server-side actions (squash merge) 2012-09-06 18:57:04 -04:00
975c323e39 Release version bump 2012-09-06 18:56:38 -04:00
979b778430 Spec version fixes 2012-09-06 18:53:01 -04:00
b36aa61237 Add support for RSA/DSA SSH host key detection in setup module for OS/X
s/<8spaces>/<4spaces>/g
2012-09-06 20:40:21 +02:00
23cd7ad08a Added to_yaml and from_yaml filters to Jinja environment. 2012-09-06 10:19:56 -04:00
d158218c3f Add /proc/cmdline information to the default facts
The use-case here is that based on information in the /proc/cmdline certain actions can be taken.

A practical example in our case is that we have a play at the end of the provisioning phase that reboots the system. Since we don't want to accidentally reboot a system (or restart the network) on a production machine, having a way to separate an Anaconda post-install (sshd in chroot) with a normal system is a good way to make that distinction.

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "not '${ansible_cmdline.BOOT_IMAGE}'.startswith('$')"

A practical problem here is the fact that we cannot simply check whether it is set or empty:

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "'${ansible_cmdline.BOOT_IMAGE}'"

If ansible_cmdline was a string, a simple only_if: "'${ansible_cmdline}'.find(' BOOT_IMAGE=')" was an option, but still not very "beautiful" :-/

This implementation uses shlex.split() and uses split(sep, maxsplit=1).
2012-09-06 09:35:33 +02:00
14db2fa376 Add an isset("$var") function to only_if 2012-09-05 23:18:47 +02:00
8360f9f46c added support for custom port definition 2012-09-05 18:18:30 +02:00
a2307aa7a0 Fix error with servers without group metadata. Add this servers to undefined group. 2012-09-05 16:26:01 +02:00
2dd430d9c0 Add support to removes control param
Execute action only if specified file using param removes exist (execute reverse control of creates).

Some usage eg.:

```yaml
- name: enable apache2 default websites
  action: command /usr/sbin/a2ensite $item
creates=/etc/apache2/sites-enabled/$item
  with_items:
    - default
    - default-ssl

- name: disable apache2 default websites
  action: command /usr/sbin/a2dissite $item
removes=/etc/apache2/sites-enabled/$item
  with_items:
    - default
    - default-ssl
```
2012-09-05 14:06:47 +03:00
e4d827e6de Fix logging callback parameters 2012-09-04 21:57:34 -04:00
df5d134ab9 Merge pull request #3 from mavimo/master
Fix error with servers without group metadata.
2012-09-05 07:46:57 -07:00
151a9b385d Update list of provided facts for 0.7 2012-09-04 21:40:49 -04:00
4d003127fa Rebuild 2012-09-04 20:22:14 -04:00
074667261e rebuild 2012-09-04 20:02:28 -04:00
8cb9cace33 Merge pull request #213 from tbielawa/nagios_services_required
nagios module should advertise 'services' attribute as required.
2012-09-04 17:01:45 -07:00
e052cf4727 nagios module should advertise 'services' attribute as required. 2012-09-04 13:55:11 -04:00
16c57c6674 rebuild 2012-09-02 08:35:54 -04:00
92de282430 rebuild 2012-09-02 08:35:38 -04:00
edfcdbffa1 Merge pull request #210 from mavimo/patch-1
Fixed typo un user
2012-09-02 05:34:11 -07:00
c0d40439a1 Fixed typo un user
In playbook users is not valid, please change to user.
2012-08-31 17:44:26 +03:00
2b6d21d23c Merge pull request #2 from skvidal/master
eucalyptus support into ec2 inventory module
2012-08-31 07:09:16 -07:00
b3ee7fdd97 add eucalyptus private cloud support to the ec2 module 2012-08-31 09:52:12 -04:00
566f220d16 API docs update + fix -u reference 2012-08-30 23:55:31 -04:00
edd2a3c6ed Rebuild 2012-08-30 22:58:22 -04:00
620a6c4185 Grammar fix 2012-08-30 22:58:09 -04:00
496a2b7f56 Update README.md 2012-08-30 20:28:58 -03:00
deb51becc2 lineinfile now refactored and & in core 2012-08-30 20:27:39 -03:00
4c42721619 Merge pull request #4 from cegeddin/master
Included cegeddin playbooks in README.md
2012-08-30 16:26:46 -07:00
92c37c9c07 Add seboolean RST 2012-08-30 19:14:14 -04:00
104c3d7d6e Document SELinux modules 2012-08-30 19:14:01 -04:00
256d61e1e7 Document SELinux module 2012-08-30 19:08:05 -04:00
23ae68de4f add docs on wait_for 2012-08-30 19:01:53 -04:00
56649eb76b rebuild 2012-08-30 18:50:24 -04:00
e8a760a042 add version added 2012-08-30 18:50:10 -04:00
800bf4b232 Who uses additions 2012-08-30 18:49:31 -04:00
e7de31bb18 Fix table / rebuild 2012-08-30 18:42:45 -04:00
500941917d Add line in file, rebuild 2012-08-30 18:41:27 -04:00
a2e5d38f59 Merge pull request #209 from dhozac/lineinfile
Add lineinfile module
2012-08-30 15:40:25 -07:00
c68a5661a4 Update README.md 2012-08-30 16:15:49 -03:00
f247579221 Update README.md 2012-08-30 16:14:54 -03:00
b0c2545dc4 updated README.md to include cegeddin playbooks 2012-08-30 11:12:13 -04:00
f3ae13a052 added cegeddin repo to playbooks 2012-08-30 11:07:34 -04:00
09f7bd1a9b Add lineinfile module 2012-08-30 04:22:51 +02:00
b12eeec85f Rebuild 2012-08-28 20:48:25 -04:00
f542e10cc6 Merge pull request #205 from tbielawa/playbooks2_toc
Add auto-gen TOCs to a bunch of pages.
2012-08-28 17:45:20 -07:00
67fcd7bea1 Merge pull request #206 from tbielawa/future
You can include playbooks now.
2012-08-28 17:44:33 -07:00
87edeaf5b6 Merge pull request #1 from mavimo/master
OpenStack inventory
2012-08-28 17:43:57 -07:00
85277e9e64 You can include playbooks now. 2012-08-28 16:04:36 -04:00
d9e8a6c2e1 Added basic support for OpenStack inventory support. Tested only with RackSpace. Require python-novaclient to work. 2012-08-28 21:56:16 +02:00
b9f7ea7198 Add auto-gen TOCs to a bunch of pages. 2012-08-28 15:41:10 -04:00
47eea55d13 rebuild 2012-08-28 07:39:55 -04:00
5b6046545e Merge pull request #204 from tbielawa/nagios_cfg
change default desc for cmdfile parameter
2012-08-28 04:39:19 -07:00
720953664c change default desc for cmdfile parameter 2012-08-28 02:13:49 -04:00
989817657f Add versionadded to nagios docs 2012-08-27 22:33:31 -04:00
9e51b96a10 Rebuild 2012-08-27 22:07:35 -04:00
3830b2ce1d Remove part about module config file as I don't want to encourage modules to take configuration files. 2012-08-27 22:06:14 -04:00
3299485d9b Merge documentation sections. 2012-08-27 22:05:40 -04:00
47542aefc5 rebuild 2012-08-27 21:59:44 -04:00
be6b9b0594 Fix rst formatting + rebuild 2012-08-27 21:59:37 -04:00
d91e07b611 Undo README change 2012-08-27 21:59:36 -04:00
3a8c277cb8 updated subversion/git RST for new subversion module and git force option 2012-08-27 21:59:36 -04:00
922e34c144 updated docs for pull request #922 (subversion module) 2012-08-27 21:59:36 -04:00
c4522d9f29 Merge pull request #202 from elventear/postgresql_user
Docs for postgresql_user recent changes
2012-08-27 18:53:12 -07:00
b57e9c9a27 Merge pull request #203 from tbielawa/nagios_docs
Add docs for nagios
2012-08-27 18:52:24 -07:00
038ebac577 Fix typo 2012-08-27 19:52:47 -04:00
49cc3c05b8 Also, the mysql_user module didn't have a proper :ref: tag. 2012-08-27 15:42:07 -04:00
1133b6dd94 Put modules list into three columns. 2012-08-27 15:41:37 -04:00
ee2e913315 Remove words about using 'host' in the parameters desc. Also, fix delegate to nagios.example.com 2012-08-27 15:17:57 -04:00
68e31cf23f Add docs for nagios 2012-08-27 15:12:37 -04:00
514f491514 Missing owner option on postgresql_db 2012-08-27 10:56:48 -05:00
07580692f5 Update documentation for postgresql_user 2012-08-27 10:53:58 -05:00
3ebf6cb223 fix uptime API example 2012-08-24 19:33:14 -04:00
b8ba2d3066 Document variable precedence / rebuild 2012-08-21 22:02:43 -04:00
0483da674b Fix directory names 2012-08-21 20:37:42 -04:00
4caa76cbd8 Add a callback that logs activity for each host in /var/log/ansible/hosts 2012-08-20 20:42:57 -04:00
fce2650d5f Add connections directory 2012-08-20 20:05:41 -04:00
68f07e83d9 Moved inventory to plugins repo 2012-08-20 19:57:18 -04:00
cadd806a67 Keep inventory scripts in plugins repo 2012-08-20 19:46:45 -04:00
c351c47cea docs tweak/rebuild 2012-08-20 18:53:19 -04:00
0e83972847 Merge branch 'master' of github.com:ansible/ansible.github.com 2012-08-20 18:47:05 -04:00
a252abcc6c Rebuild 2012-08-20 18:29:56 -04:00
beb9d3ac1e Fix link 2012-08-20 18:29:43 -04:00
2019a97b4e Merge pull request #196 from tbielawa/local_action
Add docs for 'local_action' (ansible:#905). Oh, and fix 'make viewdocs'.
2012-08-20 15:29:13 -07:00
9ad592965a Add docs for 'local_action' (ansible:#905). Oh, and fix 'make viewdocs'. 2012-08-19 22:04:18 -04:00
8a9b8a727b Fix a comment 2012-08-19 10:34:25 -04:00
5c2bad90c9 Minor OSX callback fixups 2012-08-18 22:56:00 -04:00
1605fc1fad Add osx_say plugin. 2012-08-18 22:45:48 -04:00
b72b1eb50c Initial commit 2012-08-18 19:42:28 -07:00
1824dd33cf Document the new 'serial' and 'delegate_to' features. 2012-08-18 10:23:17 -04:00
6a5a7bd0f8 rebuild 2012-08-17 20:36:30 -04:00
e02457015b rebuild 2012-08-17 20:36:24 -04:00
3b562aa367 add service pattern= parameter 2012-08-17 20:36:24 -04:00
f81f541354 Merge pull request #192 from lorin/missing-dot
fix typo: ~/ansbile.cfg -> ~/.ansible.cfg
2012-08-17 17:30:59 -07:00
3c4e9fdc98 fix typo: ~/ansbile.cfg -> ~/.ansible.cfg 2012-08-17 14:27:41 -04:00
de207dc3fa rebuild 2012-08-16 22:09:45 -04:00
dad0e0fefb document --list-hosts 2012-08-16 22:08:17 -04:00
815a5408e0 New quotes from the tweet stream 2012-08-16 22:04:07 -04:00
7fc9ac4cf9 various tweaks/rebuild 2012-08-16 21:12:36 -04:00
1676ff4e2d Fix RPM path 2012-08-14 22:21:57 -04:00
44e3eef15e Document -u change 2012-08-14 22:20:47 -04:00
1ac07ee677 "Who uses" additions 2012-08-14 22:18:17 -04:00
0926c91b28 Document host ranges (new in 0.6) 2012-08-14 22:14:47 -04:00
0219d88fdd Document more playbook features in 0.7, docs build 2012-08-14 22:11:56 -04:00
7bd6fde2a3 Document --limit and range selection 2012-08-14 22:07:00 -04:00
cb0fb4c42f Merge pull request #184 from tbielawa/bashifiedexamples
'bashify' the examples page.
2012-08-14 18:26:07 -07:00
728df81bab Merge pull request #185 from tbielawa/SplitModuleRst
Break the modules docs into separate files.
2012-08-14 18:25:31 -07:00
f28ea0cda1 Break the modules docs into separate files. 2012-08-13 15:39:00 -04:00
a07e928358 'bashify' the examples page. 2012-08-13 14:51:36 -04:00
1f3e22687e rebuild 2012-08-10 01:24:32 -04:00
10c89f4d49 Merge pull request #181 from mattupstate/master
Add notes about easy_install and pip
2012-08-10 18:22:37 -07:00
41e524eb58 Add notes about easy_install and pip 2012-08-10 10:35:27 -04:00
df53801e0f fix doc example 2012-08-10 00:07:10 -04:00
ce9401beda fix typo 2012-08-09 22:13:24 -04:00
b721176bdd rebuild 2012-08-09 22:12:10 -04:00
2befb446a3 Merge branch 'RefreshBestPractices' of https://github.com/tbielawa/ansible.github.com 2012-08-09 22:11:42 -04:00
f4245ee5f0 add versionadded info to new modules 2012-08-09 22:10:57 -04:00
331cfa6b36 rebuild 2012-08-09 22:10:57 -04:00
ea3bf960aa rebuild 2012-08-09 22:10:57 -04:00
688086c54a Add consistent versionadded/deprecated tags. 2012-08-09 22:10:57 -04:00
391acfb20c Freshen up the examples page. 2012-08-09 22:10:57 -04:00
af762446a1 Merge pull request #172 from tbielawa/RefreshNotes
Refresh the use of 'note' to make it consistent.
2012-08-09 19:05:43 -07:00
54a9f17b25 formatting/rebuild 2012-08-09 22:04:34 -04:00
fc7591eeaa Merge pull request #175 from mattupstate/apt_repository
Add apt_repository documentation
2012-08-09 19:02:48 -07:00
b1c6990129 rebuild 2012-08-09 22:01:58 -04:00
3e296ae3aa Merge pull request #174 from anotherjesse/master
correct hacking/test-module arguments
2012-08-09 19:01:42 -07:00
04cc44bf17 Merge pull request #176 from mattupstate/pip
Add pip module documentation
2012-08-09 19:01:18 -07:00
4581c19fa0 rebuild 2012-08-09 22:00:45 -04:00
b3f0678f2d fix tags and reuse of link name (annoying habit of sphinx to require uniqueness in HREFs) 2012-08-09 22:00:19 -04:00
a29d532711 Merge pull request #178 from anotherjesse/link_resources
link ansible resources
2012-08-09 18:58:45 -07:00
50e95372d3 Merge pull request #177 from mattupstate/easy_install
Add basic easy_install module documentation
2012-08-09 18:57:04 -07:00
05ded8d363 Merge pull request #179 from mattupstate/supervisorctl
Add supervisorctl documentation
2012-08-09 18:56:34 -07:00
056061922e page update 2012-08-08 22:17:32 -04:00
65b3792130 Update README.md 2012-08-08 20:54:45 -03:00
ff9072db7d Add supervisorctl documentation 2012-08-08 11:04:44 -04:00
0716835e47 Rebuild 2012-08-08 08:17:35 -04:00
2085ec0971 Update the RST as well 2012-08-07 15:49:10 -07:00
2be8cbfa2b correct test-module arguments 2012-08-07 15:43:40 -07:00
d36fdb84b0 link ansible resources
Fix the link to ansible resources in moduledev and link to it
in the module list page.
2012-08-07 15:20:24 -07:00
e028ce7c2e Add apt_repository documentation 2012-08-07 17:08:58 -04:00
2f9e3d141e Add pip module documentation 2012-08-07 17:05:21 -04:00
f1ae9eb98b Add basic easy_install module documentation 2012-08-07 16:56:08 -04:00
fb5d2d10db Refresh the use of 'note' to make it consistent. 2012-08-07 02:50:48 +00:00
8328bb7d63 Lighter refresh of the Best Practices page. 2012-08-07 02:21:23 +00:00
10387cb19c Since master branch are named release-XX now, just link to examples on the devel branch. 2012-08-06 22:00:50 -04:00
d47a833a8d Merge pull request #168 from marktheunissen/add-host-to-mysql-user
Adding the host
2012-08-06 18:12:58 -07:00
866863c209 Adding the host 2012-08-06 20:03:20 -05:00
6642d2447e rebuild 2012-08-06 20:56:26 -04:00
77e471650b I actually forget. 2012-08-06 20:53:45 -04:00
532381203e Merge pull request #167 from marktheunissen/fix_mysql_docs
Fixing the MySQL docs
2012-08-06 17:52:34 -07:00
4d7f9fbb70 Fixing the MySQL docs 2012-08-03 10:31:43 -05:00
f732aa3d1c Add start of a glossary 2012-08-03 00:01:23 -04:00
fa6aa5ef98 Added info about ignore_errors: True and added a user to the who uses page 2012-08-02 22:08:00 -04:00
b9d8ca4f30 Merge pull request #166 from lorin/tasks-not-element
'tasks' should not be preceded by '-' in examples
2012-08-02 19:04:24 -07:00
ce2cdc22c4 'tasks' should not be preceded by '-' in examples 2012-08-01 22:50:03 -04:00
71d7f1acf9 add naming info to FAQ 2012-08-01 21:03:14 -04:00
157bdbbd73 slight tweak to 'who uses' 2012-08-01 20:44:34 -04:00
53328a8f80 Update README.md 2012-08-01 21:39:09 -03:00
d6a1adb1d3 Update README.md 2012-08-01 21:38:28 -03:00
980b675e5d Update README.md 2012-08-01 21:38:05 -03:00
1ff800bab3 Update README.md 2012-08-01 20:42:01 -03:00
717884b61a amend best practices 2012-08-01 00:52:48 -04:00
47629a455c rebuild 2012-08-01 00:50:35 -04:00
dde93ae55a fixup service docs 2012-08-01 00:50:16 -04:00
6dd26386af update docs readme 2012-07-31 23:30:01 -04:00
30f42b9735 Module docs cleanup + rebuild 2012-07-31 23:19:41 -04:00
5d5231c4d0 undocument service list=status, since that's gone now 2012-07-31 23:10:15 -04:00
dde17404c6 Mention the AnsibleModule common code on the docs site 2012-07-31 23:08:04 -04:00
962e6e5572 module doc updates for 0.6 (release pending soon) 2012-07-31 22:47:04 -04:00
1aa3c1522c Updating various doc items with 0.6 features, releasing soon, and removing references to things new in 0.4, which
has been out long enough to no longer be new.
2012-07-31 22:19:04 -04:00
3b5ea2aa71 Merge pull request #1 from lorin/master
Added OpenStack playbooks
2012-07-31 11:26:17 -07:00
dac0db9ca2 Add company + rebuild 2012-07-30 22:57:01 -04:00
b76e8c9028 Merge pull request #158 from ADRIyas/patch-1
Update rst/modules.rst
2012-07-31 12:40:56 -07:00
2de89035e7 Merge pull request #159 from lorin/apt-args
Minor doc fixups for apt module.
2012-07-31 12:40:24 -07:00
49385bb3a3 Minor doc fixups for apt module.
Change hyphens to underscores in argument names, e.g.:
 update-cache -> update_cache

Remove question mark in description of behavior of update_cache.
2012-07-31 09:02:37 -04:00
1e32e8bbf7 add donation link 2012-07-30 20:08:13 -04:00
2253fa1019 Update rst/modules.rst 2012-07-31 00:14:50 +08:00
75d5f2579d Merge pull request #141 from pas256/master
EC2 external inventory documentation
2012-07-29 17:14:34 -07:00
cd2f44877a Merge pull request #154 from lorin/postgres-docs
Document postgresql_db and postgresql_user modules.
2012-07-29 12:36:51 -07:00
840f3c951b Document postgresql_db and postgresql_user modules. 2012-07-29 13:49:42 -04:00
bb7ef45347 add a user + docs rebuild 2012-07-28 16:34:37 -04:00
2baf4f2e22 rebuild 2012-07-28 10:24:56 -04:00
8fb2e2707c name is optional on a task 2012-07-28 10:24:47 -04:00
a4b07056ce docs rebuild 2012-07-28 10:18:46 -04:00
c39b7261f1 node -> tier and some feature matrix reorg 2012-07-28 10:17:14 -04:00
eef5bf4778 add note about sudo_user 2012-07-28 08:42:20 -04:00
e32866d137 Update README.md
Added OpenStack playbooks
2012-07-28 00:30:03 -03:00
2078627e3b docs rebuild 2012-07-27 22:56:53 -04:00
c4a6b68cb9 Update index 2012-07-27 22:42:07 -04:00
288499e391 homepage cleanup 2012-07-27 22:30:36 -04:00
10fc56adf0 Attempt to make the home page less of a wall of text. Probably more to come. 2012-07-27 22:16:14 -04:00
db19d83e40 Update the format of the modules page to use tables. 2012-07-27 20:35:45 -04:00
58cb60c8af fix company name + docs rebuild 2012-07-27 19:22:51 -04:00
ebdb991813 link fix 2012-07-25 23:49:33 -04:00
fb7ab7b7ed fix up html 2012-07-25 23:38:47 -04:00
40d790f6b9 Add who uses to git 2012-07-25 23:36:14 -04:00
e15da1563b Rebuild 2012-07-25 23:34:20 -04:00
a4004e50df Rebuild 2012-07-25 23:34:02 -04:00
0ca377eea4 Build + cleanup who uses page 2012-07-25 23:33:47 -04:00
69e8b75dc3 Merge pull request #151 from lorin/apt-get-update
Document that apt-cache=yes is equivalent to apt-get update.
2012-07-26 07:51:42 -07:00
6491e0a1fb Merge pull request #150 from Lennie/patch-1
Update index.html
2012-07-26 07:50:26 -07:00
f187227cb6 Merge pull request #146 from lorin/git-nobranch
Remove branch arg from git docs.
2012-07-26 06:05:40 -07:00
1694146c2d Document that apt-cache=yes is equivalent to apt-get update. 2012-07-26 08:57:09 -04:00
769ea7aefc Document the 'remote' argument for the git module. 2012-07-26 08:53:05 -04:00
5a58eb16c0 Update index.html
I propose this quote from the mailinglist should go in the "What People Are Saying" section.
2012-07-26 15:34:12 +03:00
2f71eb0366 Merge pull request #140 from ludovicc/master
Document sudo_user in playbook
2012-07-25 18:48:08 -07:00
f131a7da36 Merge pull request #145 from lorin/link-to-setup
Add link to setup module when ansible vars first referenced.
2012-07-25 18:45:59 -07:00
355bfc6d21 Update README.md 2012-07-25 20:31:22 -03:00
4825c0f9c0 Update README.md 2012-07-25 20:29:46 -03:00
616cfd27b2 Update README.md 2012-07-25 20:29:13 -03:00
d7a7b6cb59 Update README.md 2012-07-25 19:54:20 -03:00
6eabfa0749 Update README.md 2012-07-25 19:34:14 -03:00
a87f46727b Update README.md 2012-07-25 19:28:46 -03:00
f39ab48239 Update README.md 2012-07-25 19:28:21 -03:00
726d0bd79f Update README.md 2012-07-25 19:25:20 -03:00
d3aaecba43 Initial commit 2012-07-25 15:03:43 -07:00
def22a9cf0 Remove branch arg from git docs.
The "branch" arg doesn't work, users should use "version" instead
for specifying branches.
2012-07-25 17:18:31 -04:00
dfd60149c0 Add link to setup module when ansible vars first referenced.
Add a cross-reference link to the setup module documentation, so
users know where to look to find more detail about what ansible
variables are available.
2012-07-25 15:21:42 -04:00
799fb60051 Rebuild 2012-07-20 11:51:23 -04:00
db014182e6 Update the inventory docs + rebuild 2012-07-20 11:51:17 -04:00
c5f791a297 Completed documentation of the EC2 external inventory script 2012-07-17 17:30:47 -07:00
4c4a96b088 Beginning to add EC2 documentation. 2012-07-16 17:57:22 -07:00
8e0560f41c Document sudo_user 2012-07-16 18:28:32 +02:00
52bcdf5e38 Merge pull request #138 from lorin/master
Fix missing colon in YAML example
2012-07-14 11:58:03 -07:00
78654d7b6d Merge pull request #137 from pas256/patch-3
Adding the documentation for 'install-recommends' to APT.
2012-07-14 11:57:32 -07:00
def40d0389 Missing a colon in a YAML example. 2012-07-10 14:39:52 -03:00
3807e16cad Adding the documentation for 'install-recommends' to APT. 2012-07-09 11:34:06 -07:00
429d1108ce Merge pull request #136 from pas256/patch-2
Issue 135: Updating to reflect reality
2012-07-06 18:04:51 -07:00
107784980e Issue 135: Updating to reflect reality 2012-07-06 11:13:40 -07:00
d3fa1c36a5 docs build + formatting fix on the modules page 2012-07-04 17:47:04 -04:00
6eb53ad540 misc doc updates for 0.5 2012-07-04 17:44:39 -04:00
c963278c58 Merge pull request #129 from goozbach/master
Add a global_vars file for use of all playbooks.
2012-07-04 11:31:14 -07:00
1669620379 Merge pull request #130 from jpalley/patch-1
Add/update documentation about magic variables.
2012-07-04 11:30:35 -07:00
c3221f12cc Add/update documentation about magic variables. 2012-07-02 14:17:21 +08:00
3aefdb0e87 added global vars to best practice 2012-06-21 16:50:57 -04:00
21381fc533 Rebuild of everything already merged 2012-06-19 21:22:27 -04:00
73f7416864 Fix formatting glitch. 2012-06-19 21:22:18 -04:00
dd7113cc63 Merge pull request #122 from alanorth/getting_started
Clarify getting started instructions for git checkouts
2012-06-15 04:38:48 -07:00
f52d403d55 Merge pull request #123 from goozbach/master
Fixed best practice
2012-06-15 04:38:05 -07:00
cf3da1bd25 vars_files doesn't use include 2012-06-14 13:19:05 -04:00
78c02a9163 Clarify getting started instructions for git checkouts
The default branch is already devel (as of June 14, 2012), so there's
no need to check this one out explicitly.  Also, it was being checked
out before we had even entered the source folder, which was obviously
a mistake.
2012-06-14 16:45:15 +03:00
1b249b87be Merge pull request #118 from nafeger/master
simple docs request about using ${var}
2012-06-12 18:03:20 -07:00
2797b9f7fb Adding note about ${vars}
Add a note about how it is possible to use ${var} in addition to $var
2012-06-12 19:32:42 -05:00
f7d4b418d5 Docs rebuild 2012-05-19 20:57:34 -04:00
e21595fcc7 Merge pull request #113 from johncallender/master
Found a couple more broken doc links
2012-05-19 17:57:10 -07:00
71350a176c Merge pull request #112 from wgjohnson/examples-edits
removed '-' from ansible calls
2012-05-19 17:56:42 -07:00
9395ebd479 Merge pull request #114 from maxjustus/master
Fix misspelling of necessary
2012-05-19 17:56:09 -07:00
abdd5c1060 Docs rebuild 2012-05-19 17:30:30 -04:00
340faa5fde Add service state=reloaded 2012-05-19 17:30:20 -04:00
72e8a40ccd Change neccesssary to necessary 2012-05-16 10:39:10 -05:00
b243b8dcbf Fixing a couple more internal doc links. 2012-05-15 18:16:32 -07:00
992c2b8234 removed '-' from ansible calls 2012-05-15 13:03:10 -07:00
b896157d61 Merge pull request #110 from johncallender/master
I noticed a few small issues in the new docs
2012-05-14 15:57:34 -07:00
25d868c654 minor format and typo edits for the 0.4 doc update. 2012-05-13 17:08:42 -07:00
b71cf6653f Add missing files 2012-05-13 12:03:24 -04:00
0127df97b5 new playbooks best practices page + docs rebuild 2012-05-13 11:56:09 -04:00
4994566124 Various docs reorg and additions 2012-05-13 11:00:02 -04:00
bdba38c790 Merge pull request #109 from dne/patch-1
Remove outdated note about apt module
2012-05-12 12:27:13 -07:00
2673b4b8a4 Remove outdated note about apt module 2012-05-12 22:22:43 +03:00
85cedf52ef fix rst + docs rebuild 2012-05-10 01:41:31 -04:00
f81000c127 Document list on service module 2012-05-10 01:41:00 -04:00
8559f0167d var section tweaks 2012-05-10 01:36:52 -04:00
c193f774c2 Doc custom facts 2012-05-10 01:33:19 -04:00
d9fe6e959b update docs 2012-05-10 01:27:34 -04:00
7ea369a068 Doc system flags 2012-05-10 01:26:40 -04:00
a00ab37b22 Document raw module. 2012-05-10 01:20:31 -04:00
c9f6a2c978 Undocument override hosts (gone in 0.4, use -i "host1,host2" if you must, but want to leave that undocumented
as it's not a best practice so much.
2012-05-10 01:05:32 -04:00
2166ed8e98 Document sudo -U 2012-05-10 01:04:26 -04:00
f4e01d2b19 notes about EPEL and release cycles 2012-05-10 00:58:27 -04:00
0151ed4508 misc clarifications 2012-05-10 00:46:12 -04:00
1051d8f5ca Update git module docs 2012-05-10 00:42:26 -04:00
7b5f77aba6 Merge pull request #107 from mcodd/executable_inventory_clarification
Clarifications/fixes for executable inventory examples
2012-05-11 15:26:18 -07:00
fc7bb858e4 Clarifications/fixes for executable inventory examples 2012-05-11 17:20:25 -04:00
2d75199d83 Fix doc error about nested groups 2012-05-06 17:16:42 -04:00
e485aec355 Rebuild 2012-05-06 17:14:21 -04:00
f0d9f9652c Document inventory format upgrades in 0.4 2012-05-06 17:13:57 -04:00
7f5c1b8f02 Temporary note about YAML support in 0.4, in case anyone tries it, coming back very very soon! 2012-05-06 15:05:42 -04:00
eadc78549f Rebuild 2012-05-02 00:55:54 -04:00
0dcbffe784 Merge branch 'minor_edits' of https://github.com/johncallender/ansible.github.com
Conflicts:
	rst/modules.rst
2012-05-02 00:55:19 -04:00
2f04126ea8 Merge pull request #94 from wgjohnson/master
Change the 'name' value for Playbook's variable example
2012-05-03 19:12:02 -07:00
77f33a70ba remove old dest entries 2012-05-03 18:01:11 -07:00
b06c4a1618 rewrite file's 'dest' argument
Previously, there were two entries for 'dest'. I've combined them in a
way that makes sense to me.

This will be superfluous when 'path' is made. Ideally, I'd like to see
'path' have the bulk of the definition, and 'dest' to be an alias to
'path'.
2012-05-03 17:47:44 -07:00
8f165e1d3c Revert "ignore eclipse's .project file"
This reverts commit 21550f6586.
2012-05-03 17:04:47 -07:00
21550f6586 ignore eclipse's .project file 2012-05-03 16:55:17 -07:00
dfd671d60e change 'name' to a better description for variable example.
'make a directory' is a bad description, since the command "template …"
doesn't actually create a directory.
2012-05-03 16:54:41 -07:00
5954a7d8cc Merge pull request #88 from sfromm/selinux
Update file documentation for se* options
2012-05-03 15:47:41 -07:00
449c60153c Merge pull request #90 from pas256/patch-1
Add UID to user module documentation
2012-05-03 15:46:59 -07:00
01576f9447 Add UID to user module documentation 2012-05-03 10:47:27 -07:00
2059c5f657 Update file documentation for se* options
Describes how you can use '_default' to seuser, serole, setype, and
selevel to use the default context from the policy, if available.
2012-05-02 12:03:56 -07:00
26c141e96e Issue #84: Doc tweaks for modules, moduledev, and playbooks 2012-05-02 06:53:29 -07:00
b247da54f1 Issue #82: Minor edits to doc text and formatting 2012-05-01 22:35:02 -07:00
1c5f5acadf Rebuild 2012-05-02 00:34:56 -04:00
0c2dd7b057 Clarify include section 2012-05-02 00:34:37 -04:00
16c4802476 Docs rebuild 2012-05-02 00:24:01 -04:00
139a1324e9 Allude to ansible-pull, more docs coming later. 2012-05-02 00:23:47 -04:00
7d228c5198 Add github fork banner to docs project to correct for missing akamai resource. 2012-04-28 11:20:38 -04:00
b388ac721e move stuff back into footer 2012-04-28 10:53:15 -04:00
07d7b7c802 Remove double tweet links 2012-04-28 10:50:55 -04:00
589ae67d95 work on footer 2012-04-28 10:50:20 -04:00
ee20586d28 Attempt to cleanup rendering of social buttons 2012-04-28 10:46:09 -04:00
57c4559a47 Attempt to add +1/like/etc buttons. 2012-04-28 10:42:32 -04:00
d049d425e6 Clarify stderr behavior of modules 2012-04-27 01:39:15 -04:00
aed5414cb6 Add note about variable precedence 2012-04-25 22:48:04 -04:00
d6368ab4fa Update facter/ohai parts to talk about ansible facts in most recent release 2012-04-25 22:46:00 -04:00
eba1340542 Document ansible facts 2012-04-25 22:40:11 -04:00
0165ceb3cc Document how to reference variables about another host from any host. 2012-04-25 22:32:24 -04:00
81773f5635 rebuild 2012-04-25 22:28:38 -04:00
c6a709a954 Add new apt options and replace 'ensure' with 'state' 2012-04-25 22:28:22 -04:00
26fb8eeb99 Update docs to explain how to get Python 2.6 going on EPEL 2012-04-25 22:25:13 -04:00
9177b7f30f rebuild 2012-04-22 20:05:32 -04:00
ab5ea63ae7 Add another item to testimonials section. 2012-04-22 20:05:11 -04:00
e38ea3807c Merge pull request #66 from sfromm/selinux 2012-04-22 16:50:13 -07:00
ab75ff5b39 Add "What People Are Saying" section. Rebuild. 2012-04-22 11:43:03 -04:00
439b218309 Add documentation for context option to file module 2012-04-21 23:51:03 -07:00
666afef0e5 Small edits to packaging section, docs rebuild 2012-04-21 12:12:46 -04:00
7b7108928e Merge pull request #62 from tbielawa/fixYumExample
Fix yum example
2012-04-21 09:09:15 -07:00
3671d046b9 Merge pull request #63 from leucos/master
Adds URL to AUR page
2012-04-21 09:08:56 -07:00
4aac448b06 Adds AUR link for Arch build
Adds URL to AUR ansile page
Adds suggestion to symlink python to python2 since most Arch users have
python3 by default. This suggestion might not be wise, though it doesn't
seem to break anything.
It might be probably wiser to have a patch for the AUR build that takes
care of this.
2012-04-20 21:34:44 +02:00
7b7428a31e Fix yum example 2012-04-20 14:26:45 -04:00
bc0980496c Typo + fix header depth 2012-04-19 10:45:41 -04:00
bbde1bdfa0 Rebuild 2012-04-19 10:15:38 -04:00
6831fb796c Shorten things up. We probably need a better slogan :) 2012-04-19 10:15:20 -04:00
f63d7bcacc Since the first h2 appears as the title (need to fix this) put something up there
that makes some sense.  Should put Ansible first in the html TITLE, need to investigate
Sphinx details
2012-04-19 10:13:45 -04:00
02bd7b74e1 rebuild 2012-04-19 09:57:45 -04:00
806fdf0fbe Clarify update-cache 2012-04-19 09:57:30 -04:00
6c99039a9b Merge pull request #58 from leucos/master
Adds doc for apt modules
2012-04-19 16:38:42 -07:00
de25ec1f29 Fixes typo
Fixes typo in apt/update-cache blurb
2012-04-19 22:27:29 +02:00
25e86ddb7d Adds doc for apt operations
Documents update-cache and puge apt module options
2012-04-19 22:25:12 +02:00
0b9610e845 reinstate 'fork me on github' ribbon 2012-04-19 09:39:50 -04:00
2eba6d71e3 Logo should link to web page index 2012-04-19 09:24:45 -04:00
85647b252d Various doc updates 2012-04-18 23:02:28 -04:00
837061879f rebuild 2012-04-18 21:22:02 -04:00
a510bdc469 Update fetch docs 2012-04-18 21:21:49 -04:00
da97024419 Explain template dep further 2012-04-17 21:02:19 -04:00
7c43ca4fb1 Make note about jinja2 dependency going away 2012-04-17 20:57:01 -04:00
cd5fe8a467 update FAQ 2012-04-17 20:54:01 -04:00
0ab8d9e193 Logo on every page. 2012-04-17 20:47:29 -04:00
6c547e5f0f Logo update 2012-04-17 20:42:46 -04:00
4c6c953992 Docs rebuild 2012-04-17 20:36:22 -04:00
9d7668207e Merge pull request #53 from sfromm/selinux
Describe selinux functionality in file module
2012-04-17 17:34:44 -07:00
b9b0cd775b Describe selinux functionality in file module 2012-04-17 17:08:17 -07:00
4f95dacee1 Document with_items 2012-04-17 20:04:24 -04:00
85f0ff2572 Remove legacy port usage, now belongs in inventory file 2012-04-17 20:00:41 -04:00
b733b43e00 Rebuild 2012-04-17 19:59:53 -04:00
1caca11647 Rebuild + port docs 2012-04-17 19:59:41 -04:00
bdeff18675 Merge pull request #52 from dagwieers/master
Fix small typo
2012-04-17 16:56:59 -07:00
48d3881d17 Document YAML inventory + eBuilds 2012-04-17 19:54:23 -04:00
4dec1d172b Fix small typo 2012-04-17 15:06:12 +02:00
b30aadcf0b Undocument --extra-vars 2012-04-16 23:07:59 -04:00
3f82b9b889 Docs rebuild 2012-04-16 22:36:58 -04:00
8c091b35c5 remove contrib repo 2012-04-16 22:36:41 -04:00
a12ee6f30b Make note about pending port change 2012-04-16 22:18:08 -04:00
55f4824735 Fix inconsistent heading sizes 2012-04-14 11:09:26 -04:00
05b559805b update index 2012-04-14 09:00:16 -04:00
e481c456e0 Fix spelling/text + docs rebuild 2012-04-14 08:56:17 -04:00
adbf3590c5 Add info about sudo. 2012-04-14 08:45:27 -04:00
2850b8d921 Add sudo password info. 2012-04-14 08:42:24 -04:00
7c1b25e49b Add some security notes 2012-04-14 08:41:10 -04:00
e030d0854c Docs rebuild 2012-04-12 22:47:15 -04:00
449725a214 Document local playbook usage. 2012-04-12 22:44:04 -04:00
ecfb22c8d8 Add info about contrib repo to docs 2012-04-12 22:33:21 -04:00
39e052acbb update virt docs 2012-04-12 22:31:43 -04:00
daed69a4b1 Stub reference to SELinux. 2012-04-12 22:30:43 -04:00
da00799c56 Document the fetch module. 2012-04-12 22:29:49 -04:00
ace0d5ade4 Merge pull request #46 from makuk66/master
some doc fixes
2012-04-12 19:24:33 -07:00
06fce9a0b3 update requirements 2012-04-12 22:23:16 -04:00
e5baf5a926 Docs rebuild 2012-04-12 21:38:47 -04:00
2b1a7dacc9 Pulling manpage references out of index so we don't have to maintain them in two places -- docs are more explanatory anyway 2012-04-12 21:34:25 -04:00
f05a84ad42 cat -> echo 2012-04-12 21:33:54 -04:00
6497570967 doc fixes 2012-04-12 23:20:52 +01:00
bef07194c0 Update docs 2012-04-06 11:41:18 -04:00
1171da6fcd Update examples page to mention group capabilities aren't all that are listed on the examples page 2012-04-04 20:33:00 -04:00
9a0e2e338c Docs build 2012-04-04 20:31:04 -04:00
c7f799675d Fix example typo + misc text 2012-04-04 20:30:41 -04:00
4d4b10309d Merge pull request #41 from mgwilliams/file-module-symlinks
docs for file module -- symbolic links
2012-04-04 17:27:27 -07:00
6a1c0ca718 Document playbook command for --extra-vars 2012-04-02 21:07:33 -04:00
fbc48a0d23 Document vars_prompt in playbooks 2012-04-02 21:03:46 -04:00
04196e20a8 docs for file module -- symbolic links 2012-04-01 17:03:13 -07:00
59d2f57d64 Add favicon to pages 2012-03-31 22:44:02 -04:00
402e3b8934 Add favicon 2012-03-31 22:32:31 -04:00
94d8ea5ee9 Add speakerdeck link. 2012-03-31 22:31:42 -04:00
a879278713 Update module docs to include new user/group control features, fix formatting on playbooks page. 2012-03-31 12:08:28 -04:00
8d92efa9fc image tweaks 2012-03-31 10:48:37 -04:00
f7a3b6a537 Update image width 2012-03-31 10:46:34 -04:00
a7c532e3f9 update architecture diagram, minor format changes 2012-03-31 10:43:34 -04:00
337de79cf4 Add sudo/port info to examples, and sudo info to playbooks. 2012-03-30 22:10:32 -04:00
f316c1b131 Docs build. 2012-03-30 22:05:45 -04:00
d17cb6a910 only_if actually works in playbooks for handler tasks, remove the note that says otherwise 2012-03-30 22:05:15 -04:00
1a5aa89be8 Attempt to explain reason for project more on the home page. 2012-03-26 23:38:52 -04:00
ace55c6160 Update user module docs 2012-03-26 23:06:14 -04:00
d7b11e4a10 Allude to apt on the examples page. 2012-03-26 21:41:50 -04:00
1f565c3d76 add documentation stub for apt, and fix agreement issues caused by Tim's doc ref link fixup. 2012-03-26 19:48:32 -04:00
d584cdf501 Merge pull request #38 from tbielawa/littlefixes
little fixes here and there (docs, makefile)
2012-03-24 13:47:36 -07:00
ef632db9f3 Fix cross-document references to 'playbooks' in the modules source.
Update manpages from ansible repo to show when options require args.

Update clean target Makefile so 'rm' doesn't print a useless error
when files aren't found while cleaning.
2012-03-23 22:38:29 -04:00
5a9fe3ac62 Update shell terminal example to reflect need to single quote shell variables. 2012-03-23 21:13:51 -04:00
5327f52c3c Remove some note callouts on the example page and inline the commentary so it's easier to read. 2012-03-22 01:14:26 -04:00
87ab7d76af Document the user module 2012-03-22 01:01:02 -04:00
315a6358b4 Mention variable for context 2012-03-21 21:02:17 -04:00
9951888af3 Docs build 2012-03-21 20:43:51 -04:00
96357407e0 Make chat a web link. 2012-03-21 20:42:31 -04:00
ee2622ee7c Show how to save conditional predicates in vars sections, which makes only_if cleaner. 2012-03-21 20:35:06 -04:00
7136ef756d Fix formatting error 2012-03-20 21:12:35 -04:00
0a20e65f92 Add subscribe link to main page 2012-03-20 21:04:47 -04:00
a045630c02 Add docs on only_if 2012-03-20 20:15:53 -04:00
a98e0a8cc4 quoting 2012-03-19 23:56:35 -04:00
6b8f5224b8 Added docs on conditional import usage 2012-03-19 23:43:03 -04:00
860fe50048 Fix grammatical error. 2012-03-18 20:41:38 -04:00
57dec507f0 List less alternative apps 2012-03-18 13:17:25 -04:00
29293ba51d Rename 'design goals' to 'features' 2012-03-18 13:08:45 -04:00
cd06703fa2 Clarify some things on index page 2012-03-18 13:03:45 -04:00
00bf6f1ebf Mention other distributions. 2012-03-18 12:55:18 -04:00
f29db92052 more complete from checkout docs 2012-03-18 12:45:23 -04:00
3f75fd575c Show how easy it is to run from checkout. 2012-03-18 12:41:00 -04:00
c81aed412a Fix rst syntax errors 2012-03-17 17:16:31 -04:00
bedde394fc Tell folks about packaged releases, but encourage usage of git. 2012-03-17 17:00:41 -04:00
e12e724a42 Fix error on examples page 2012-03-31 11:19:35 -04:00
12c3e04023 Fix reference 2012-03-31 10:51:48 -04:00
f535335fe0 Add shell module to examples page. 2012-03-31 10:50:47 -04:00
15acaec687 Crossref playbooks from async poll section 2012-03-31 10:41:29 -04:00
f708b75d41 Fix formatting 2012-03-31 10:40:01 -04:00
1a926c69a1 Added some foreshadowing of CLI syntax to the patterns page. 2012-03-31 10:38:24 -04:00
7a8397d60f link module dev guide from modules page 2012-03-31 10:21:28 -04:00
bbc2aca10f Make additional reference to playbooks examples dir 2012-03-31 10:17:35 -04:00
a4c23463fb Add IRC and google groups links to each page 2012-03-31 09:55:37 -04:00
31c353543c Reinstate page nav, various TOC structure cleanup 2012-03-31 09:36:37 -04:00
3a1bbac3a7 Move see also blocks to bottom of each page to include reading docs, remove 'fork me' to avoid text overlap,
simply menu nav so folks find the chapter link.
2012-03-31 09:29:31 -04:00
39d02eeff4 Add external inventory script info (and Cobbler example) to API page. 2012-03-30 22:28:30 -04:00
d78817c426 Add file features to examples. 2012-03-15 22:57:10 -04:00
0674c31dbc Added documentation on the 'file' module and how 'copy' and 'template' can also use the options that 'file'
provides.
2012-03-15 22:47:21 -04:00
e0bc949219 Fix doc indent level 2012-03-14 23:45:02 -04:00
ea8770ad54 Fix pathing in example 2012-03-14 13:13:32 -04:00
0427ec8ad6 Add missing file 2012-03-14 12:53:17 -04:00
d9c626e686 Added start of a module development guide, prob needs some editing and maybe some simpler examples 2012-03-14 12:50:40 -04:00
505d3942b0 Added documentation on the 'shell' module, which is a virtual module and isn't really in the library folder.
Docs build.
2012-03-14 20:57:35 -04:00
38e8771785 update docs, fix playbook page formatting 2012-03-13 21:55:55 -04:00
496686629a Slight tweaks to playbook docs + docs rebuild 2012-03-13 20:32:55 -04:00
8484fe3147 Clarify YAML doesn't always use a list as external variables files are hashes. 2012-03-12 23:18:54 -04:00
0b94d3d3f8 replace 'foo' with a more meaningful example + 1 other typo 2012-03-12 23:17:59 -04:00
37adadcc50 Updating docs, added extensive info on playbook async + external vars_files for keeping variables outside of
the playbook file.
2012-03-12 23:12:21 -04:00
cf4ac3b6b2 Add yum latest to docs and examples 2012-03-12 19:23:58 -04:00
3f834cfe3e Docs rebuild, removing submodule because it was causing build problems and I don't quite grok them :) 2012-03-12 19:13:19 -04:00
884d8af759 Attempt to force docs rebuild? Please? 2012-03-11 23:28:04 -04:00
4a184b57c8 Docs build 2012-03-11 23:20:55 -04:00
d5c239404b Update .gitignore 2012-03-11 04:23:00 -04:00
e5386b82c6 Put index.html back in git, problem with staleness was related to .buildinfo, not git. 2012-03-11 04:21:53 -04:00
e3adca1431 Makefile needs to clean things up 2012-03-11 04:21:19 -04:00
f7ff5d1055 Doc build 2012-03-11 21:53:13 -04:00
4cc8fe7561 Split paragraph 2012-03-11 21:53:00 -04:00
91d8d0e502 update faq 2012-03-11 21:47:57 -04:00
e726b9796d Fix some example command line options, add some more links to home page. 2012-03-11 21:46:05 -04:00
817cac7954 Add missing "-a" to examples page 2012-03-11 21:20:30 -04:00
0bccec9fb5 Add polling info to docs 2012-03-11 21:09:21 -04:00
d3fe5f617a Rename 'yamlscripts' to 'yamlsyntax', add some extra crosslinking to make sure folks find the
interesting docs pages, some misc editing here and there.
2012-03-11 15:34:21 -04:00
02549869b1 Attempt to force update 2012-03-11 15:04:08 -04:00
0404acfcc2 Move all html content on the website to build top level such that we do not need the redirect. 2012-03-10 22:34:53 -05:00
0035181c59 Remove URL target for clicking on arch diagram, add width/height so it loads
nicer.
2012-03-10 19:57:24 -05:00
667aa81bee Add arch diagram to website + docs build 2012-03-10 19:48:53 -05:00
a13def0fbe Add yum module to examples + playbook examples 2012-03-10 11:40:49 -05:00
8bf7e79ee3 Add yum to examples 2012-03-10 11:35:36 -05:00
d397c13d9c Added "Fork Me On Github" 2012-03-10 10:39:34 -05:00
557f4d382b add links 2012-03-09 22:58:17 -05:00
ff64996542 doc build 2012-03-09 22:49:40 -05:00
88140938cb Fix heading 2012-03-09 22:49:30 -05:00
4ecad80725 Add google stats 2012-03-09 22:31:54 -05:00
10d197d77f Add missing files 2012-03-09 22:14:31 -05:00
a631c21e5a Add ansible-playbook(1) manpage. 2012-03-09 22:11:41 -05:00
8e7ae6cf69 Minor reordering and linking some things up. 2012-03-09 21:50:00 -05:00
37864337eb Added FAQ page (limited space in menu, so trimmed some topics on lesser used bits) + docs build 2012-03-09 21:41:18 -05:00
e575c0639f Added one last image to header + docs rebuild 2012-03-09 19:13:34 -05:00
1346fd02c9 Added stub yum docs + docs rebuild 2012-03-09 19:04:40 -05:00
ef5e326215 Docs build 2012-03-09 18:51:06 -05:00
fae963a6d2 Docs build + attempt to add image to website 2012-03-09 18:29:01 -05:00
2fb25f1fe8 Merge pull request #9 from tbielawa/master
Spellcheck. Formatting. References.
2012-03-09 15:05:22 -08:00
a1010e5405 Spellcheck. Formatting. References. 2012-03-09 14:39:29 -05:00
e67e446950 Merge pull request #8 from tbielawa/master
Bootstrap
2012-03-09 08:51:46 -08:00
8bd523fe36 More bootstrap tweaks 2012-03-09 11:50:07 -05:00
f25b39b7ce Switch to the 'Sphinx Bootstrap' Theme:
https://github.com/ryan-roemer/sphinx-bootstrap-theme

Fix some rst related formatting.
2012-03-09 11:44:14 -05:00
26800d5db8 Merge branch 'master' of https://github.com/ansible/ansible.github.com 2012-03-09 11:12:34 -05:00
f3a0eb4b23 Docs build 2012-03-09 07:43:06 -05:00
e8eb7ab5ed Update docs 2012-03-09 07:42:53 -05:00
fe2d1c7cc9 Docs rebuild 2012-03-08 23:06:07 -05:00
7a4df9e2fc RST reformatting a few things 2012-03-08 23:05:52 -05:00
358859d2f3 Docs rebuild 2012-03-08 22:52:16 -05:00
bc62feb583 Don't say script 2012-03-08 22:52:02 -05:00
2c6dd03229 docs rebuild 2012-03-08 22:50:12 -05:00
1952bd0aa3 add some docs 2012-03-08 22:50:00 -05:00
cdfb64ce59 Updating ref of the ansible submodule 2012-03-08 16:33:18 -05:00
d89ee675fc Oh I have to commit these too 2012-03-08 14:07:13 -05:00
2cafb8d221 Minor docs restructuring 2012-03-08 13:53:48 -05:00
12fd193450 Docs updates 2012-03-08 13:36:47 -05:00
89a00e6385 Merge pull request #2 from tbielawa/master
No more jekyll
2012-03-08 16:39:02 -08:00
6fe8e4d348 Unjekyllify these pages. 2012-03-07 13:48:56 -05:00
26d1c8c4be Merge pull request #1 from tbielawa/master
These docs are better
2012-03-07 10:11:57 -08:00
5738f8724a Polish up more. Refactor build-site.py and Makefile. 2012-03-07 13:08:31 -05:00
baf2a05708 Polish the docs up some more. Also make 'index.html' forward to the actual html output 2012-03-07 12:41:53 -05:00
5e453555e3 Let me upgrade your docs 2012-03-07 11:35:18 -05:00
7e0ff815b9 Do I have to change something here to trigger a rebuild? 2012-03-06 19:00:52 -05:00
eadd5644b0 Fix project name from where I copied it from :) 2012-03-06 18:59:33 -05:00
bd4bda95d0 Check in files. 2012-03-06 18:58:23 -05:00
2e75c21e4b first commit 2012-03-06 18:55:16 -05:00
304 changed files with 37581 additions and 3041 deletions

21
.gitignore vendored
View File

@ -1,12 +1,31 @@
# build products...
*.py[co]
build
AUTHORS.TXT
# Emacs backup files...
*~
.\#*
# (s)rpm building stuff
# RPM stuff...
MANIFEST
dist
rpm-build
# Eclipse/PyDev stuff...
.project
.pydevproject
# PyCharm stuff...
.idea
# Mac OS X stuff...
.DS_Store
# manpage build stuff...
docs/man/man3/*
# Sublime stuff
*.sublime-project
*.sublime-workspace
# docsite stuff...
docsite/rst/modules
docsite/*.html
docsite/_static/*.gif
docsite/_static/*.png
docsite/_static/websupport.js
# deb building stuff...
debian/

View File

@ -1,7 +1,402 @@
Ansible Changes By Release
==========================
0.7 "Panama" -- release pending -- I can barely see the roadmap from the heat coming off of it.
1.1 "Mean Street" -- Release pending
Core Features
* added --check option for "dry run" mode
* added --diff option to show how templates or copied files change, or might change
* --list-tasks for the playbook will list the tasks without running them
* able to set the environment by setting "environment:" as a dictionary on any task (go proxy support!)
* added ansible_ssh_user and ansible_ssh_pass for per-host/group username and password
* jinja2 extensions can now be loaded from the config file
* support for complex arguments to modules (within reason)
* can specify ansible_connection=X to define the connection type in inventory variables
* a new chroot connection type
* module common code now has basic type checking (and casting) capability
* module common now supports a 'no_log' attribute to mark a field as not to be syslogged
* inventory can now point to a directory containing multiple scripts/hosts files, if using this, put group_vars/host_vars directories inside this directory
* added configurable crypt scheme for 'vars_prompt'
* password generating lookup plugin -- $PASSWORD(path/to/save/data/in)
* added --step option to ansible-playbook, works just like Linux interactive startup!
Modules Added:
* bzr (bazaar version control)
* cloudformation
* django-manage
* gem (ruby gems)
* homebrew
* lvg (logical volume groups)
* lvol (LVM logical volumes)
* macports
* mongodb_user
* netscaler
* okg
* openbsd_pkg
* rabbit_mq_plugin
* rabbit_mq_user
* rabbit_mq_vhost
* rabbit_mq_parameter
* rhn_channel
* s3 -- allows putting file contents in buckets for sharing over s3
* uri module -- can get/put/post/etc
* vagrant -- launching VMs with vagrant, this is different from existing vagrant plugin
* zfs
Bugfixes and Misc Changes:
* stderr shown when commands fail to parse
* uses yaml.safe_dump in filter plugins
* authentication Q&A no longer happens before --syntax-check, but after
* ability to get hostvars data for nodes not in the setup cache yet
* SSH timeout now correctly passed to native SSH connection plugin
* raise an error when multiple when_ statements are provided
* --list-hosts applies host limit selections better
* (internals) template engine specifications to use template_ds everywhere
* better error message when your host file can not be found
* end of line comments now work in the inventory file
* directory destinations now work better with remote md5 code
* lookup plugin macros like $FILE and $ENV now work without returning arrays in variable definitions/playbooks
* uses yaml.safe_load everywhere
* able to add EXAMPLES to documentation via EXAMPLES docstring, rather than just in main documentation YAML
* can set ANSIBLE_COW_SELECTION to pick other cowsay types (including random)
* to_nice_yaml and to_nice_json available as Jinja2 filters that indent and sort
* cowsay able to run out of macports (very important!)
* improved logging for fireball mode
* nicer error message when talking to an older system that needs a JSON module installed
* 'magic' variable 'inventory_basedir' now gives path to inventory file
* 'magic' variable 'vars' works like 'hostvars' but gives global scope variables, useful for debugging in templates mostly
* conditionals can be used on plugins like add_host
* developers: all callbacks now have access to a ".runner" and ".playbook", ".play", and ".task" object (use getattr, they may not always be set!)
Facts:
* block device facts for the setup module
* facts for AIX
* fact detection for OS type on Amazon Linux
* device fact gathering stability improvements
* ansible_os_family fact added
* user_id (remote user name)
* a whole series of current time information under the 'datetime' hash
* more OS X facts
* support for detecting Alpine Linux
* added facts for OpenBSD
Module Changes/Fixes:
* ansible module common code (and ONLY that) which is mixed in with modules, is now BSD licensed. App remains GPLv3.
* service code works better on platforms that mix upstart, systemd, and system-v
* service enablement idempotence fixes for systemd and upstart
* service status 4 is also 'not running'
* supervisorctl restart fix
* increased error handling for ec2 module
* can recursively set permissions on directories
* ec2: change to the way AMI tags are handled
* cron module can now also manipulate cron.d files
* virtualenv module can now inherit system site packages (or not)
* lineinfile module now has an insertbefore option
* NetBSD service module support
* fixes to sysctl module where item has multiple values
* AIX support for the user and group modules
* able to specify a different hg repo to pull from than the original set
* add_host module can set ports and other inventory variables
* add_host module can add modules to multiple groups (groups=a,b,c), groups now alias for groupname
* subnet ID can be set on EC2 module
* MySQL module password handling improvements
* added new virtualenv flags to pip and easy_install modules
* various improvements to lineinfile module, now accepts common arguments from file
* force= now replaces thirsty where used before, thirsty remains an alias
* setup module can take a 'filter=<wildcard>' parameter to just return a few facts (not used by playbooks)
* cron module works even if no crontab is present (for cron.d)
* security group ID settable on EC2 module
* misc fixes to sysctl module
* fix to apt module so packages not in cache are still removable
* charset fix to mail module
* postresql db module now does not try to create the 'PUBLIC' user
* SVN module now works correctly with self signed certs
* apt module now has an upgrade parameter (values=yes, no, or 'dist')
* nagios module gets new silence/unsilence commands
* ability to disable proxy usage in get_url (use_proxy=no)
* more OS X facts
* added a 'fail_on_missing' (default no) option to fetch
* added timeout to the uri module (default 30 seconds, adjustable)
* ec2 now has a 'wait' parameter to wait for the instance to be active, eliminates need for seperate wait_for call.
* allow regex backreferences in lineinfile
* id attribute on ec2 module can be used to set idempotent-do-not-recreate launches
* icinga support for nagios module
* fix default logins when no my.conf for MySQL module
* option to create users with non-unique UIDs (user module)
* macports module can enable/disable packages
* quotes in my.cnf are stripped by the MySQL modules
* Solaris Service management added
* service module will attempt to auto-add unmanaged chkconfig services when needed
* service module supports systemd service unit files
Plugins:
* added 'with_random_choice' filter plugin
* fixed ~ expansion for fileglob
* with_nested allows for nested loops (see examples in examples/playbooks)
1.0 "Eruption" -- Feb 1 2013
New modules:
* new sysctl module
* new pacman module (Arch linux)
* new apt_key module
* hg module now in core
* new ec2_facts module
* added pkgin module for Joyent SmartOS
New config settings:
* sudo_exe parameter can be set in config to use sudo alternatives
* sudo_flags parameter can alter the flags used with sudo
New playbook/language features:
* added when_failed and when_changed
* task includes can now be of infinite depth
* when_set and when_unset can take more than one var (when_set: $a and $b and $c)
* added the with_sequence lookup plugin
* can override "connection:" on an indvidual task
* parameterized playbook includes can now define complex variables (not just all on one line)
* making inventory variables available for use in vars_files paths
* messages when skipping plays are now more clear
* --extra-vars now has maximum precedence (as intended)
Module fixes and new flags:
* ability to use raw module without python on remote system
* fix for service status checking on Ubuntu
* service module now responds to additional exit code for SERVICE_UNAVAILABLE
* fix for raw module with '-c local'
* various fixes to git module
* ec2 module now reports the public DNS name
* can pass executable= to the raw module to specify alternative shells
* fix for postgres module when user contains a "-"
* added additional template variables -- $template_fullpath and $template_run_date
* raise errors on invalid arguments used with a task include statement
* shell/command module takes a executable= parameter to specify a different shell than /bin/sh
* added return code and error output to the raw module
* added support for @reboot to the cron module
* misc fixes to the pip module
* nagios module can schedule downtime for all services on the host
* various subversion module improvements
* various mail module improvements
* SELinux fix for files created by authorized_key module
* "template override" ??
* get_url module can now send user/password authorization
* ec2 module can now deploy multiple simultaneous instances
* fix for apt_key modules stalling in some situations
* fix to enable Jinja2 {% include %} to work again in template
* ec2 module is now powered by Boto
* setup module can now detect if package manager is using pacman
* fix for yum module with enablerepo in use on EL 6
Core fixes and new behaviors:
* various fixes for variable resolution in playbooks
* fixes for handling of "~" in some paths
* various fixes to DWIM'ing of relative paths
* /bin/ansible now takes a --list-hosts just like ansible-playbook did
* various patterns can now take a regex vs a glob if they start with "~" (need docs on which!) - also /usr/bin/ansible
* allow intersecting host patterns by using "&" ("webservers:!debian:&datacenter1")
* handle tilde shell character for --private-key
* hash merging policy is now selectable in the config file, can choose to override or merge
* environment variables now available for setting all plugin paths (ANSIBLE_CALLBACK_PLUGINS, etc)
* added packaging file for macports (not upstreamed yet)
* hacking/test-module script now uses /usr/bin/env properly
* fixed error formatting for certain classes of playbook syntax errors
* fix for processing returns with large volumes of output
Inventory files/scripts:
* hostname patterns in the inventory file can now use alphabetic ranges
* whitespace is now allowed around group variables in the inventory file
* inventory scripts can now define groups of groups and group vars (need example for docs?)
0.9 "Dreams" -- Nov 30 2012
Highlighted core changes:
* various performance tweaks, ansible executes dramatically less SSH ops per unit of work
* close paramiko SFTP connections less often on copy/template operations (speed increase)
* change the way we use multiprocessing (speed/RAM usage improvements)
* able to set default for asking password & sudo password in config file
* ansible now installs nicely if running inside a virtualenv
* flag to allow SSH connection to move files by scp vs sftp (in config file)
* additional RPM subpackages for easily installing fireball mode deps (server and node)
* group_vars/host_vars now available to ansible, not just playbooks
* native ssh connection type (-c ssh) now supports passwords as well as keys
* ansible-doc program to show details
Other core changes:
* fix for template calls when last character is '$'
* if ansible_python_interpreter is set on a delegated host, it now works as intended
* --limit can now take "," as separator as well as ";" or ":"
* msg is now displaced with newlines when a task fails
* if any with_ plugin has no results in a list (empty list for with_items, etc), the task is now skipped
* various output formatting fixes/improvements
* fix for Xen dom0/domU detection in default facts
* 'ansible_domain' fact now available (ex value: example.com)
* configured remote temp file location is now always used even for root
* 'register'-ed variables are not recorded for skipped hosts (for example, using only_if/when)
* duplicate host records for the same host can no longer result when a host is listed in multiple groups
* ansible-pull now passes --limit to prevent running on multiple hosts when used with generic playbooks
* remote md5sum check fixes for Solaris 10
* ability to configure syslog facility used by remote module calls
* in templating, stray '$' characters are now handled more correctly
Playbook changes:
* relative paths now work for 'first_available_file'
* various templating engine fixes
* 'when' is an easier form of only if
* --list-hosts on the playbook command now supports multiple playbooks on the same command line
* playbook includes can now be parameterized
Module additions:
* (addhost) new module for adding a temporary host record (used for creating new guests)
* (group_by) module allows partitioning hosts based on group data
* (ec2) new module for creating ec2 hosts
* (script) added 'script' module for pushing and running self-deleting remote scripts
* (svr4pkg) solaris svr4pkg module
Module changes:
* (authorized key) module uses temp file now to prevent failure on full disk
* (fetch) now uses the 'slurp' internal code to work as you would expect under sudo'ed accounts
* (fetch) internal usage of md5 sums fixed for BSD
* (get_url) thirsty is no longer required for directory destinations
* (git) various git module improvements/tweaks
* (group) now subclassed for various platforms, includes SunOS support
* (lineinfile) create= option on lineinfile can create the file when it does not exist
* (mysql_db) module takes new grant options
* (postgresql_db) module now takes role_attr_flags
* (service) further upgrades to service module service status reporting
* (service) tweaks to get service module to play nice with BSD style service systems (rc.conf)
* (service) possible to pass additional arguments to services
* (shell) and command module now take an 'executable=' flag for specifying an alternate shell than /bin/sh
* (user) ability to create SSH keys for users when using user module to create users
* (user) atomic replacement of files preserves permissions of original file
* (user) module can create SSH keys
* (user) module now does Solaris and BSD
* (yum) module takes enablerepo= and disablerepo=
* (yum) misc yum module fixing for various corner cases
Plugin changes:
* EC2 inventory script now produces nicer failure message if AWS is down (or similar)
* plugin loading code now more streamlined
* lookup plugins for DNS text records, environment variables, and redis
* added a template lookup plugin $TEMPLATE('filename.j2')
* various tweaks to the EC2 inventory plugin
* jinja2 filters are now pluggable so it's easy to write your own (to_json/etc, are now impl. as such)
0.8 "Cathedral" -- Oct 19, 2012
Highlighted Core Changes:
* fireball mode -- ansible can bootstrap a ephemeral 0mq (zeromq) daemon that runs as a given user and expires after X period of time. It is very fast.
* playbooks with errors now return 2 on failure. 1 indicates a more fatal syntax error. Similar for /usr/bin/ansible
* server side action code (template, etc) are now fully pluggable
* ability to write lookup plugins, like the code powering "with_fileglob" (see below)
Other Core Changes:
* ansible config file can also go in '.ansible.cfg' in cwd in addition to ~/.ansible.cfg and /etc/ansible/ansible.cfg
* fix for inventory hosts at API level when hosts spec is a list and not a colon delimited string
* ansible-pull example now sets up logrotate for the ansible-pull cron job log
* negative host matching (!hosts) fixed for external inventory script usage
* internals: os.executable check replaced with utils function so it plays nice on AIX
* Debian packaging now includes ansible-pull manpage
* magic variable 'ansible_ssh_host' can override the hostname (great for usage with tunnels)
* date command usage in build scripts fixed for OS X
* don't use SSH agent with paramiko if a password is specified
* make output be cleaner on multi-line command/shell errors
* /usr/bin/ansible now prints things when tasks are skipped, like when creates= is used with -m command and /usr/bin/ansible
* when trying to async a module that is not a 'normal' asyncable module, ansible will now let you know
* ability to access inventory variables via 'hostvars' for hosts not yet included in any play, using on demand lookups
* merged ansible-plugins, ansible-resources, and ansible-docs into the main project
* you can set ANSIBLE_NOCOWS=1 if you want to disable cowsay if it is installed. Though no one should ever want to do this! Cows are great!
* you can set ANSIBLE_FORCECOLOR=1 to force color mode even when running without a TTY
* fatal errors are now properly colored red.
* skipped messages are now cyan, to differentiate them from unchanged messages.
* extensive documentation upgrades
* delegate_action to localhost (aka local_action) will always use the local connection type
Highlighted playbook changes:
* is_set is available for use inside of an only_if expression: is_set('ansible_eth0'). We intend to further upgrade this with a 'when'
keyword providing better options to 'only_if' in the next release. Also is_unset('ansible_eth0')
* playbooks can import playbooks in other directories and then be able to import tasks relative to them
* FILE($path) now allows access of contents of file in a path, very good for use with SSH keys
* similarly PIPE($command) will run a local command and return the results of executing this command
* if all hosts in a play fail, stop the playbook, rather than letting the console log spool on by
* only_if using register variables that are booleans now works in a boolean way like you'd expect
* task includes now work with with_items (such as: include: path/to/wordpress.yml user=$item)
* when using a $list variable with $var or ${var} syntax it will automatically join with commas
* setup is not run more than once when we know it is has already been run in a play that included another play, etc
* can set/override sudo and sudo_user on individual tasks in a play, defaults to what is set in the play if not present
* ability to use with_fileglob to iterate over local file patterns
* templates now use Jinja2's 'trim_blocks=True' to avoid stray newlines, small changes to templates may
be required in rare cases.
Other playbook changes:
* to_yaml and from_yaml are available as Jinja2 filters
* $group and $group_names are now accessible in with_items
* where 'stdout' is provided a new 'stdout_lines' variable (type == list) is now generated and usable with with_items
* when local_action is used the transport is automatically overridden to the local type
* output on failed playbook commands is now nicely split for stderr/stdout and syntax errors
* if local_action is not used and delegate_to was 127.0.0.1 or localhost, use local connection regardless
* when running a playbook, and the statement has changed, prints 'changed:' now versus 'ok:' so it is obvious without colored mode
* variables now usable within vars_prompt (just not host/group vars)
* setup facts are now retained across plays (dictionary just gets updated as needed)
* --sudo-user now works with --extra-vars
* fix for multi_line strings with only_if
New Modules:
* ini_file module for manipulating INI files
* new LSB facts (release, distro, etc)
* pause module -- (pause seconds=10) (pause minutes=1) (pause prompt=foo) -- it's an action plugin
* a module for adding entries to the main crontab (though you may still wish to just drop template files into cron.d)
* debug module can be used for outputing messages without using 'shell echo'
* a fail module is now available for causing errors, you might want to use it with only_if to fail in certain conditions
Other module Changes, Upgrades, and Fixes:
* removes= exists on command just like creates=
* postgresql modules now take an optional port= parameter
* /proc/cmdline info is now available in Linux facts
* public host key detection for OS X
* lineinfile module now uses 'search' not exact 'match' in regexes, making it much more intuitive and not needing regex syntax most of the time
* added force=yes|no (default no) option for file module, which allows transition between files to directories and so on
* additional facts for SunOS virtualization
* copy module is now atomic when used across volumes
* url_get module now returns 'dest' with the location of the file saved
* fix for yum module when using local RPMs vs downloading
* cleaner error messages with copy if destination directory does not exist
* setup module now still works if PATH is not set
* service module status now correct for services with 'subsys locked' status
* misc fixes/upgrades to the wait_for module
* git module now expands any "~" in provided destination paths
* ignore stop error code failure for service module with state=restarted, always try to start
* inline documentation for modules allows documentation source to built without pull requests to the ansible-docs project, among other things
* variable '$ansible_managed' is now great to include at the top of your templates and includes useful information and a warning that it will be replaced
* "~" now expanded in command module when using creates/removes
* mysql module can do dumps and imports
* selinux policy is only required if setting to not disabled
* various fixes for yum module when working with packages not in any present repo
0.7 "Panama" -- Sept 6 2012
Module changes:
@ -75,13 +470,13 @@ playbooks:
* error reporting if with_items value is unbound
* with_items no longer creates lots of tasks, creates one task that makes multiple calls
* can use host_specific facts inside with_items (see above)
* at the top level of a playbook, set 'gather_facts: False' to skip fact gathering
* at the top level of a playbook, set 'gather_facts: no' to skip fact gathering
* first_available_file and with_items used together will now raise an error
* to catch typos, like 'var' for 'vars', playbooks and tasks now yell on invalid parameters
* automatically load (directory_of_inventory_file)/group_vars/groupname and /host_vars/hostname in vars_files
* playbook is now colorized, set ANSIBLE_NOCOLOR=1 if you do not like this, does not colorize if not a TTY
* hostvars now preserved between plays (regression in 0.5 from 0.4), useful for sharing vars in multinode configs
* ignore_errors: True on a task can be used to allow a task to fail and not stop the play
* ignore_errors: yes on a task can be used to allow a task to fail and not stop the play
* with_items with the apt/yum module will install/remove/update everything in a single command
inventory:
@ -140,7 +535,7 @@ internals:
* support for older versions of python-apt in the apt module
* a new "assemble" module, for constructing files from pieces of files (inspired by Puppet "fragments" idiom)
* ability to override most default values with ANSIBLE_FOO environment variables
* --module-path parameter can support multiple directories seperated with the OS path seperator
* --module-path parameter can support multiple directories separated with the OS path separator
* with_items can take a variable of type list
* ansible_python_interpreter variable available for systems with more than one Python
* BIOS and VMware "fact" upgrades

73
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,73 @@
Contributing to Ansible
=======================
It is required that you read the following information to learn how to contribute to this project.
Branch Info
===========
Here's how to understand the branches.
* The devel branch corresponds to the latest ongoing release
* Various release-X.Y branches exist for previous releases
* All feature work happens on the development branch.
* Major bug fixes will be made to the last release branch only
* See CHANGELOG.md for release notes to track each release.
Patch Instructions
==================
Contributions to the core and modules are greatly welcome.
* Required Process:
* Submit github pull requests to the "ansible/devel" branch for features
* Fixes for bugs may also be submitted to "ansible/release-X.Y" for the last release
* Make sure "make tests" passes before submitting any requests.
* Bonus points:
* Joining the mailing list
* Fixing bugs instead of sending bug reports.
* Using squash merges
* Updating the "rst/*" files in the "docsite/" directory and "docs/" manpage content
* Adding more unit tests
* Avoid:
* Sending patches to the mailing list directly.
* Sending feature pull requests to the 'release' branch instead of the devel branch
* Sending pull requests to mpdehaan's personal ansible fork.
* Sending pull requests about more than one feature in the same pull request.
* Whitespace restructuring
* Large scale refactoring without a discussion on the list
Coding Standards
================
We're not too strict on style considerations, but we require:
* python 2.6 compliant code, unless in ansible modules, then python *2.4* compliant code (no 'with', etc)
* 4-space indents, no tabs except in Makefiles
* under_scores for method names and variables, not camelCase
* GPLv3 license headers on all files, with copyright on new files with your name on it
* no single-line if statements, deeply nested list comprehensions, or clever use of metaclasses -- keep it simple
* comments where appropriate
Testing Requirements
====================
Automation tests are run by "make tests" and contain a mixture of integration and "unit" level tests. To run the tests you need the following:
* nose must be installed - https://nose.readthedocs.org/en/latest/
* ansible tests require paramiko, PyYAML python modules, and python 2.6+.
* Some tests require additional components (facter, ohai) and will be skipped if not available.
* Your user environment should allow "ssh 127.0.0.1"
without a password - so a key held in ssh-agent and an authorized_keys entry.
If your module does not require any additional dependencies beyond ansible-core, it is a good idea to write some
tests for the module.
Contributors License Agreement
==============================
By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable
copyright license to all users and developers of the project, present and future, persusant to the license of the project.

View File

@ -9,7 +9,7 @@
# make deb ------------------ produce a DEB
# make docs ----------------- rebuild the manpages (results are checked in)
# make tests ---------------- run the tests
# make pyflakes, make pep8 -- source code checks
# make pyflakes, make pep8 -- source code checks
########################################################
# variable section
@ -20,16 +20,21 @@ OS = $(shell uname -s)
# Manpages are currently built with asciidoc -- would like to move to markdown
# This doesn't evaluate until it's called. The -D argument is the
# directory of the target file ($@), kinda like `dirname`.
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1
ifneq ($(shell which a2x 2>/dev/null),)
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1
else
ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
endif
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
PYTHON=python
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
# VERSION file provides one place to update the software version
VERSION := $(shell cat VERSION)
### Get the branch information from git
# Get the branch information from git
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ai")
endif
@ -37,7 +42,11 @@ endif
ifeq ($(OS), FreeBSD)
DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%s" "$(GIT_DATE)" +%Y%m%d%H%M)
else
DATE := $(shell date --date="$(GIT_DATE)" +%Y%m%d%H%M)
ifeq ($(OS), Darwin)
DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%S" "$(GIT_DATE)" +%Y%m%d%H%M)
else
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
endif
endif
# RPM build parameters
@ -54,11 +63,14 @@ RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
all: clean python
tests:
PYTHONPATH=./lib nosetests -v
tests:
PYTHONPATH=./lib nosetests -d -v
# To force a rebuild of the docs run 'touch VERSION && make docs'
docs: $(MANPAGES)
docs: $(MANPAGES) modulepages
authors:
sh hacking/authors.sh
# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
# recently than %.1.asciidoc.
@ -92,9 +104,10 @@ clean:
@echo "Cleaning up editor backup files"
find . -type f \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
@echo "Cleaning up asciidoc to man transformations and results"
@echo "Cleaning up manpage stuff"
find ./docs/man -type f -name "*.xml" -delete
find ./docs/man -type f -name "*.asciidoc" -delete
find ./docs/man/man3 -type f -name "*.3" -delete
@echo "Cleaning up output from test runs"
rm -rf test/test_data
@echo "Cleaning up RPM building stuff"
@ -102,15 +115,19 @@ clean:
@echo "Cleaning up Debian building stuff"
rm -rf debian
rm -rf deb-build
rm -rf docs/json
rm -rf docs/js
@echo "Cleaning up authors file"
rm -f AUTHORS.TXT
python:
python setup.py build
$(PYTHON) setup.py build
install:
python setup.py install
$(PYTHON) setup.py install
sdist: clean
python setup.py sdist -t MANIFEST.in
sdist: clean docs
$(PYTHON) setup.py sdist -t MANIFEST.in
rpmcommon: sdist
@mkdir -p rpm-build
@ -138,7 +155,8 @@ rpm: rpmcommon
--define "_srcrpmdir %{_topdir}" \
--define "_specdir $(RPMSPECDIR)" \
--define "_sourcedir %{_topdir}" \
--define "_rpmfilename $(RPMNVR).%%{ARCH}.rpm" \
--define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
--define "__python `which $(PYTHON)`" \
-ba rpm-build/$(NAME).spec
@rm -f rpm-build/$(NAME).spec
@echo "#############################################"
@ -156,3 +174,23 @@ deb: debian
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
modulepages:
PYTHONPATH=./lib $(PYTHON) hacking/module_formatter.py -A $(VERSION) -t man -o docs/man/man3/ --module-dir=library --template-dir=hacking/templates
modulejson:
mkdir -p docs/json
PYTHONPATH=./lib $(PYTHON) hacking/module_formatter.py -A $(VERSION) -t json -o docs/json --module-dir=library --template-dir=hacking/templates
modulejs:
mkdir -p docs/js
make modulejson
PYTHONPATH=./lib $(PYTHON) hacking/module_formatter.py -A $(VERSION) -t js -o docs/js --module-dir=docs/json --template-dir=hacking/templates
# because this requires Sphinx it is not run as part of every build, those building the RPM and so on can ignore this
webdocs:
(cd docsite; make docs)
# just for quick testing of all the module docs
webdocs2:
(cd docsite; make modules)

View File

@ -4,7 +4,11 @@ Ansible
Ansible is a radically simple configuration-management, deployment, task-execution, and
multinode orchestration framework.
Read the documentation at http://ansible.github.com
Read the documentation and more at http://ansible.cc
Many users run straight from the development branch (it's generally fine to do so), but you might also wish to consume a release. You can find
instructions on http://ansible.cc/docs/gettingstarted.html for a variety of platforms. If you want a tarball of the last release, go to
http://ansible.cc/releases/ and you can also install with pip (though that will bring in some optional binary dependencies you normally do not need).
Design Principles
=================
@ -28,32 +32,9 @@ Branch Info
===========
* Releases are named after Van Halen songs.
* The devel branch corresponds to release 0.7, "Panama".
* The devel branch corresponds to the release actively under development.
* Various release-X.Y branches exist for previous releases
* All feature work happens on the development branch.
* Major bug fixes will be made to the last release branch only
* See CHANGELOG.md for release notes to track each release.
Patch Instructions
==================
Contributions to the core and modules are greatly welcome.
* Required Process:
* Submit github pull requests to the "ansible/devel" branch for features
* Fixes for bugs may also be submitted to "ansible/release-X.Y" for the last release
* Make sure "make tests" passes before submitting any requests.
* Bonus points:
* Joining the mailing list
* Fixing bugs instead of sending bug reports.
* Using squash merges
* Updating the "rst/*" files in the docs project and "docs/" manpage content
* Adding more unit tests
* Avoid:
* Sending patches to the mailing list directly.
* Sending feature pull requests to the 'release' branch instead of the devel branch
* Sending pull requests to mpdehaan's personal ansible fork.
* We'd love to have your contributions, read "CONTRIBUTING.md" for process notes.
Author
======

View File

@ -1,11 +1,15 @@
Ansible Releases at a Glance
============================
0.7 "Panama" ---------- X-XX-2012
0.6 "Cabo" ------------ 8-06-2012
0.5 "Amsterdam" ------- 7-04-2012
0.4 "Unchained" ------- 5-23-2012
0.3 "Baluchitherium" -- 4-23-2012
1.1 "Mean Street" ----- pending
1.0 "Eruption" -------- 02-01-2013
0.9 "Dreams" ---------- 11-30-2012
0.8 "Cathedral" ------- 10-19-2012
0.7 "Panama" ---------- 09-06-2012
0.6 "Cabo" ------------ 08-06-2012
0.5 "Amsterdam" ------- 07-04-2012
0.4 "Unchained" ------- 05-23-2012
0.3 "Baluchitherium" -- 04-23-2012
0.0.2 Untitled
0.0.1 Untitled

View File

@ -1 +1 @@
0.7
1.1

View File

@ -45,13 +45,26 @@ class Cli(object):
def parse(self):
''' create an options parser for bin/ansible '''
parser = utils.base_parser(constants=C, runas_opts=True, subset_opts=True, async_opts=True,
output_opts=True, connect_opts=True, usage='%prog <host-pattern> [options]')
parser = utils.base_parser(
constants=C,
runas_opts=True,
subset_opts=True,
async_opts=True,
output_opts=True,
connect_opts=True,
check_opts=True,
diff_opts=False,
usage='%prog <host-pattern> [options]'
)
parser.add_option('-a', '--args', dest='module_args',
help="module arguments", default=C.DEFAULT_MODULE_ARGS)
parser.add_option('-m', '--module-name', dest='module_name',
help="module name to execute (default=%s)" % C.DEFAULT_MODULE_NAME,
default=C.DEFAULT_MODULE_NAME)
parser.add_option('--list-hosts', dest='listhosts', action='store_true',
help="dump out a list of hosts matching input pattern, does not execute any modules!")
options, args = parser.parse_args()
self.callbacks.options = options
@ -68,15 +81,28 @@ class Cli(object):
pattern = args[0]
inventory_manager = inventory.Inventory(options.inventory)
if options.subset:
inventory_manager.subset(options.subset)
hosts = inventory_manager.list_hosts(pattern)
if len(hosts) == 0:
print >>sys.stderr, "No hosts matched"
sys.exit(1)
if options.listhosts:
for host in hosts:
print ' %s' % host
sys.exit(0)
if options.module_name == 'command' and not options.module_args:
print >>sys.stderr, "No argument passed to command module"
sys.exit(1)
sshpass = None
sudopass = None
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
if options.ask_pass:
sshpass = getpass.getpass(prompt="SSH password: ")
options.ask_sudo_pass= options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
if options.ask_sudo_pass:
sudopass = getpass.getpass(prompt="sudo password: ")
options.sudo = True
@ -96,7 +122,9 @@ class Cli(object):
pattern=pattern,
callbacks=self.callbacks, sudo=options.sudo,
sudo_pass=sudopass,sudo_user=options.sudo_user,
transport=options.connection, subset=options.subset
transport=options.connection, subset=options.subset,
check=options.check,
diff=options.check
)
if options.seconds:
@ -127,6 +155,11 @@ if __name__ == '__main__':
(options, args) = cli.parse()
try:
(runner, results) = cli.run(options, args)
for result in results['contacted'].values():
if 'failed' in result or result.get('rc', 0) != 0:
sys.exit(2)
if results['dark']:
sys.exit(2)
except errors.AnsibleError, e:
# Generic handler for ansible specific errors
print "ERROR: %s" % str(e)

215
bin/ansible-doc Executable file
View File

@ -0,0 +1,215 @@
#!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
import os
import sys
import textwrap
import re
import optparse
import datetime
from ansible import utils
from ansible.utils import module_docs
import ansible.constants as C
from ansible.utils import version
import traceback
MODULEDIR = C.DEFAULT_MODULE_PATH
BLACKLIST_EXTS = ('.swp', '.bak', '~', '.rpm')
_ITALIC = re.compile(r"I\(([^)]+)\)")
_BOLD = re.compile(r"B\(([^)]+)\)")
_MODULE = re.compile(r"M\(([^)]+)\)")
_URL = re.compile(r"U\(([^)]+)\)")
_CONST = re.compile(r"C\(([^)]+)\)")
def tty_ify(text):
t = _ITALIC.sub("`" + r"\1" + "'", text) # I(word) => `word'
t = _BOLD.sub("*" + r"\1" + "*", t) # B(word) => *word*
t = _MODULE.sub("[" + r"\1" + "]", t) # M(word) => [word]
t = _URL.sub(r"\1", t) # U(word) => word
t = _CONST.sub("`" + r"\1" + "'", t) # C(word) => `word'
return t
def print_man(doc):
opt_indent=" "
print "> %s\n" % doc['module'].upper()
desc = "".join(doc['description'])
print "%s\n" % textwrap.fill(tty_ify(desc), initial_indent=" ", subsequent_indent=" ")
if 'option_keys' in doc and len(doc['option_keys']) > 0:
print "Options (= is mandatory):\n"
for o in doc['option_keys']:
opt = doc['options'][o]
if opt.get('required', False):
opt_leadin = "="
else:
opt_leadin = "-"
print "%s %s" % (opt_leadin, o)
desc = "".join(opt['description'])
if 'choices' in opt:
choices = ", ".join(str(i) for i in opt['choices'])
desc = desc + " (Choices: " + choices + ")"
print "%s\n" % textwrap.fill(tty_ify(desc), initial_indent=opt_indent,
subsequent_indent=opt_indent)
if 'notes' in doc and len(doc['notes']) > 0:
notes = "".join(doc['notes'])
print "Notes:%s\n" % textwrap.fill(tty_ify(notes), initial_indent=" ",
subsequent_indent=opt_indent)
if 'examples' in doc and len(doc['examples']) > 0:
print "Example%s:\n" % ('' if len(doc['examples']) < 2 else 's')
for ex in doc['examples']:
print "%s\n" % (ex['code'])
if 'plainexamples' in doc and doc['plainexamples'] is not None:
print doc['plainexamples']
def print_snippet(doc):
desc = tty_ify("".join(doc['short_description']))
print "- name: %s" % (desc)
print " action: %s" % (doc['module'])
for o in doc['options']:
opt = doc['options'][o]
desc = tty_ify("".join(opt['description']))
s = o + "="
print " %-20s # %s" % (s, desc)
def main():
p = optparse.OptionParser(
version=version("%prog"),
usage='usage: %prog [options] [module...]',
description='Show Ansible module documentation',
)
p.add_option("-M", "--module-path",
action="store",
dest="module_path",
default=MODULEDIR,
help="Ansible modules/ directory")
p.add_option("-l", "--list",
action="store_true",
default=False,
dest='list_dir',
help='List available modules')
p.add_option("-s", "--snippet",
action="store_true",
default=False,
dest='show_snippet',
help='Show playbook snippet for specified module(s)')
p.add_option('-v', action='version', help='Show version number and exit')
(options, args) = p.parse_args()
if options.module_path is not None:
for i in options.module_path.split(os.pathsep):
utils.plugins.module_finder.add_directory(i)
if options.list_dir:
# list all modules
paths = utils.plugins.module_finder._get_paths()
module_list = []
for path in paths:
# os.system("ls -C %s" % (path))
if os.path.isdir(path):
for module in os.listdir(path):
if any(module.endswith(x) for x in BLACKLIST_EXTS):
continue
module_list.append(module)
for module in sorted(set(module_list)):
if module in module_docs.BLACKLIST_MODULES:
continue
filename = utils.plugins.module_finder.find_plugin(module)
try:
doc, plainexamples = module_docs.get_docstring(filename)
desc = tty_ify(doc.get('short_description', '?'))
if len(desc) > 55:
desc = desc + '...'
print "%-20s %-60.60s" % (module, desc)
except:
traceback.print_exc()
sys.stderr.write("ERROR: module %s has a documentation error formatting or is missing documentation\n" % module)
pass
sys.exit()
if len(args) == 0:
p.print_help()
for module in args:
filename = utils.plugins.module_finder.find_plugin(module)
if filename is None:
sys.stderr.write("module %s not found in %s\n" % (module,
utils.plugins.module_finder.print_paths()))
continue
if any(filename.endswith(x) for x in BLACKLIST_EXTS):
continue
try:
doc, plainexamples = module_docs.get_docstring(filename)
except:
traceback.print_exc()
sys.stderr.write("ERROR: module %s has a documentation error formatting or is missing documentation\n" % module)
continue
if doc is not None:
all_keys = []
for (k,v) in doc['options'].iteritems():
all_keys.append(k)
all_keys = sorted(all_keys)
doc['option_keys'] = all_keys
doc['filename'] = filename
doc['docuri'] = doc['module'].replace('_', '-')
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
doc['plainexamples'] = plainexamples
if options.show_snippet:
print_snippet(doc)
else:
print_man(doc)
else:
# this typically means we couldn't even parse the docstring, not just that the YAML is busted,
# probably a quoting issue.
sys.stderr.write("ERROR: module %s missing documentation (or could not parse documentation)\n" % module)
if __name__ == '__main__':
main()

View File

@ -18,9 +18,9 @@
#######################################################
import os
import sys
import getpass
import os
import ansible.playbook
import ansible.constants as C
@ -52,13 +52,28 @@ def main(args):
# create parser for CLI options
usage = "%prog playbook.yml"
parser = utils.base_parser(constants=C, usage=usage, connect_opts=True, runas_opts=True, subset_opts=True)
parser = utils.base_parser(
constants=C,
usage=usage,
connect_opts=True,
runas_opts=True,
subset_opts=True,
check_opts=True,
diff_opts=True
)
parser.add_option('-e', '--extra-vars', dest="extra_vars", default=None,
help="set additional key=value variables from the CLI")
parser.add_option('-t', '--tags', dest='tags', default='all',
help="only run plays and tasks tagged with these values")
# FIXME: list hosts is a common option and can be moved to utils/__init__.py
parser.add_option('--list-hosts', dest='listhosts', action='store_true',
help="dump out a list of hosts, each play will run against, does not run playbook!")
parser.add_option('--syntax-check', dest='syntax', action='store_true',
help="do a playbook syntax check on the playbook, do not execute the playbook")
parser.add_option('--list-tasks', dest='listtasks', action='store_true',
help="do list all tasks that would be executed")
parser.add_option('--step', dest='step', action='store_true',
help="one-step-at-a-time: confirm each task before running")
options, args = parser.parse_args(args)
@ -66,11 +81,18 @@ def main(args):
parser.print_help(file=sys.stderr)
return 1
inventory = ansible.inventory.Inventory(options.inventory)
inventory.subset(options.subset)
if len(inventory.list_hosts()) == 0:
raise errors.AnsibleError("provided hosts list is empty")
sshpass = None
sudopass = None
if not options.listhosts:
if not options.listhosts and not options.syntax and not options.listtasks:
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
if options.ask_pass:
sshpass = getpass.getpass(prompt="SSH password: ")
options.ask_sudo_pass = options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
if options.ask_sudo_pass:
sudopass = getpass.getpass(prompt="sudo password: ")
options.sudo = True
@ -80,17 +102,25 @@ def main(args):
extra_vars = utils.parse_kv(options.extra_vars)
only_tags = options.tags.split(",")
for playbook in args:
if not os.path.exists(playbook):
raise errors.AnsibleError("the playbook: %s could not be found" % playbook)
if not os.path.isfile(playbook):
raise errors.AnsibleError("the playbook: %s does not appear to be a file" % playbook)
# run all playbooks specified on the command line
for playbook in args:
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
if options.step:
playbook_cb.step = options.step
runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=utils.VERBOSITY)
pb = ansible.playbook.PlayBook(
playbook=playbook,
module_path=options.module_path,
host_list=options.inventory,
inventory=inventory,
forks=options.forks,
remote_user=options.remote_user,
remote_pass=sshpass,
@ -105,26 +135,50 @@ def main(args):
extra_vars=extra_vars,
private_key_file=options.private_key_file,
only_tags=only_tags,
subset=options.subset,
check=options.check,
diff=options.diff
)
if options.listhosts:
if options.listhosts or options.listtasks:
print ''
print 'playbook: %s' % playbook
print ''
playnum = 0
for play in pb.playbook:
for (play_ds, play_basedir) in zip(pb.playbook, pb.play_basedirs):
playnum += 1
if 'hosts' in play:
label = 'unnamed'
if 'name' in play:
label = play['name']
print 'hosts in play %s: %s' % (playnum, label)
for host in pb.inventory.list_hosts(play['hosts']):
print ' %s' % host
print '\n'
play = ansible.playbook.Play(pb, play_ds, play_basedir)
label = play.name
if options.listhosts:
hosts = pb.inventory.list_hosts(play.hosts)
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
for host in hosts:
print ' %s' % host
if options.listtasks:
matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
unmatched_tags.discard('all')
unknown_tags = set(pb.only_tags) - (matched_tags | unmatched_tags)
if unknown_tags:
msg = 'tag(s) not found in playbook: %s. possible values: %s'
unknown = ','.join(sorted(unknown_tags))
unmatched = ','.join(sorted(unmatched_tags))
raise errors.AnsibleError(msg % (unknown, unmatched))
print ' play #%d (%s): task count=%d' % (playnum, label, len(play.tasks()))
for task in play.tasks():
if set(task.tags).intersection(pb.only_tags):
print ' %s' % task.name
print ''
continue
if options.syntax:
# if we've not exited by now then we are fine.
print 'Playbook Syntax is fine'
return 0
try:
pb.run()
hosts = sorted(pb.stats.processed.keys())
print callbacks.banner("PLAY RECAP")
playbook_cb.on_stats(pb.stats)
@ -138,6 +192,10 @@ def main(args):
colorize('failed', t['failures'], 'red'))
print "\n"
for h in hosts:
stats = pb.stats.summarize(h)
if stats['failures'] != 0 or stats['unreachable'] != 0:
return 2
except errors.AnsibleError, e:
print >>sys.stderr, "ERROR: %s" % e

View File

@ -1,15 +1,5 @@
#!/usr/bin/env python
# ansible-pull is a script that runs ansible in local mode
# after checking out a playbooks directory from git. There is an
# example playbook to bootstrap this script in the examples/ dir which
# installs ansible and sets it up to run on cron.
#
# usage:
# ansible-pull -d /var/ansible/local -U http://wherever/content.git -C production
#
# the git repo must contain a playbook named 'local.yml'
# (c) 2012, Stephen Fromm <sfromm@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
@ -24,47 +14,131 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# ansible-pull is a script that runs ansible in local mode
# after checking out a playbooks directory from git. There is an
# example playbook to bootstrap this script in the examples/ dir which
# installs ansible and sets it up to run on cron.
# usage:
# ansible-pull -d /var/lib/ansible \
# -U http://example.net/content.git [-C production] \
# [path/playbook.yml]
#
# the -d and -U arguments are required; the -C argument is optional.
#
# ansible-pull accepts an optional argument to specify a playbook
# location underneath the workdir and then searches the git repo
# for playbooks in the following order, stopping at the first match:
#
# 1. $workdir/path/playbook.yml, if specified
# 2. $workdir/$hostname.yml
# 3. $workdir/local.yml
#
# the git repo must contain at least one of these playbooks.
import os
import shutil
import subprocess
import sys
import datetime
import socket
from optparse import OptionParser
DEFAULT_PLAYBOOK = 'local.yml'
PLAYBOOK_ERRORS = { 1: 'File does not exist',
2: 'File is not readable' }
def _run(cmd):
print >>sys.stderr, "Running: '%s'" % cmd
cmd = subprocess.Popen(cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = cmd.communicate()
print out
if cmd.returncode != 0:
print err
print >>sys.stderr, err
return cmd.returncode
def try_playbook(path):
if not os.path.exists(path):
return 1
if not os.access(path, os.R_OK):
return 2
return 0
def select_playbook(path, args):
playbook = None
if len(args) > 0 and args[0] is not None:
playbook = "%s/%s" % (path, args[0])
rc = try_playbook(playbook)
if rc != 0:
print >>sys.stderr, "%s: %s" % (playbook, PLAYBOOK_ERRORS[rc])
return None
return playbook
else:
hostpb = "%s/%s.yml" % (path, socket.getfqdn())
localpb = "%s/%s" % (path, DEFAULT_PLAYBOOK)
errors = []
for pb in [hostpb, localpb]:
rc = try_playbook(pb)
if rc == 0:
playbook = pb
break
else:
errors.append("%s: %s" % (pb, PLAYBOOK_ERRORS[rc]))
if playbook is None:
print >>sys.stderr, "\n".join(errors)
return playbook
def main(args):
""" Set up and run a local playbook """
usage = "%prog [options]"
parser = OptionParser()
usage = "%prog [options] [playbook.yml]"
parser = OptionParser(usage=usage)
parser.add_option('--purge', default=False, action='store_true',
help='Purge git checkout after playbook run')
parser.add_option('-d', '--directory', dest='dest', default=None,
help='Directory to checkout git repository')
parser.add_option('-U', '--url', dest='url',
default=None,
help='Directory to clone git repository to')
parser.add_option('-U', '--url', dest='url', default=None,
help='URL of git repository')
parser.add_option('-C', '--checkout', dest='checkout',
default="HEAD",
help='Branch/Tag/Commit to checkout. Defaults to HEAD.')
options, args = parser.parse_args(args)
if not options.dest:
parser.error("Missing required directory argument")
return 1
if not options.url:
parser.error("URL for git repo not specified, use -h for help")
return 1
now = datetime.datetime.now()
print >>sys.stderr, now.strftime("Starting ansible-pull at %F %T")
limit_opts = 'localhost:%s:127.0.0.1' % socket.getfqdn()
git_opts = "repo=%s dest=%s version=%s" % (options.url, options.dest, options.checkout)
cmd = 'ansible all -c local -m git -a "%s"' % git_opts
print "cmd=%s" % cmd
cmd = 'ansible all -c local --limit "%s" -m git -a "%s"' % (limit_opts, git_opts)
rc = _run(cmd)
if rc != 0:
return rc
playbook = select_playbook(options.dest, args)
if playbook is None:
print >>sys.stderr, "Could not find a playbook to run."
return 1
cmd = 'ansible-playbook -c local --limit "%s" %s' % (limit_opts, playbook)
os.chdir(options.dest)
cmd = 'ansible-playbook -c local %s' % DEFAULT_PLAYBOOK
rc = _run(cmd)
if options.purge:
os.chdir('/')
try:
shutil.rmtree(options.dest)
except Exception, e:
print >>sys.stderr, "Failed to remove %s: %s" % (options.dest, str(e))
return rc
if __name__ == '__main__':

View File

@ -0,0 +1,57 @@
'\" t
.\" Title: ansible-doc
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 02/01/2013
.\" Manual: System administration commands
.\" Source: Ansible 1.1
.\" Language: English
.\"
.TH "ANSIBLE\-DOC" "1" "02/01/2013" "Ansible 1\&.1" "System administration commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ansible-doc \- show documentation on Ansible modules
.SH "SYNOPSIS"
.sp
ansible\-doc [\-M module_path] [\-l] [\-s] [module\&...]
.SH "DESCRIPTION"
.sp
\fBansible\-doc\fR displays information on modules installed in Ansible libraries\&. It displays a terse listing of modules and their short descriptions, provides a printout of their DOCUMENTATION strings, and it can create a short "snippet" which can be pasted into a playbook\&.
.SH "OPTIONS"
.PP
\fB\-M\fR \fIdirectory\fR, \fB\-\-module\-path=\fR\fIdirectory\fR
.RS 4
Add an additional directory to the default path for finding module libraries\&.
.RE
.PP
\fB\-s\fR, \fB\-\-snippet=\fR
.RS 4
Produce a snippet which can be copied into a playbook for modification, like a kind of task template\&.
.RE
.PP
\fB\-l\fR, \fB\-\-list=\fR
.RS 4
Produce a terse listing of modules and a short description of each\&.
.RE
.SH "AUTHOR"
.sp
ansible\-doc was originally written by Jan\-Piet Mens\&. See the AUTHORS file for a complete list of contributors\&.
.SH "COPYRIGHT"
.sp
Copyright \(co 2012, Jan\-Piet Mens
.sp
Ansible is released under the terms of the GPLv3 License\&.
.SH "SEE ALSO"
.sp
\fBansible\-playbook\fR(1), \fBansible\fR(1)
.sp
Extensive documentation as well as IRC and mailing list info is available on the ansible home page: https://ansible\&.github\&.com/

View File

@ -0,0 +1,65 @@
ansible-doc(1)
==============
:doctype:manpage
:man source: Ansible
:man version: %VERSION%
:man manual: System administration commands
NAME
----
ansible-doc - show documentation on Ansible modules
SYNOPSIS
--------
ansible-doc [-M module_path] [-l] [-s] [module...]
DESCRIPTION
-----------
*ansible-doc* displays information on modules installed in Ansible
libraries. It displays a terse listing of modules and their short
descriptions, provides a printout of their DOCUMENTATION strings,
and it can create a short "snippet" which can be pasted into a
playbook.
OPTIONS
-------
*-M* 'directory', *--module-path=*'directory'::
Add an additional directory to the default path for finding module libraries.
*-s*, *--snippet=*::
Produce a snippet which can be copied into a playbook for modification, like
a kind of task template.
*-l*, *--list=*::
Produce a terse listing of modules and a short description of each.
AUTHOR
------
ansible-doc was originally written by Jan-Piet Mens. See the AUTHORS file
for a complete list of contributors.
COPYRIGHT
---------
Copyright © 2012, Jan-Piet Mens
Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------
*ansible-playbook*(1), *ansible*(1), *ansible-pull*(1)
Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>

View File

@ -2,12 +2,12 @@
.\" Title: ansible-playbook
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 09/06/2012
.\" Date: 02/16/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.7
.\" Source: Ansible 1.1
.\" Language: English
.\"
.TH "ANSIBLE\-PLAYBOOK" "1" "09/06/2012" "Ansible 0\&.7" "System administration commands"
.TH "ANSIBLE\-PLAYBOOK" "1" "02/16/2013" "Ansible 1\&.1" "System administration commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -82,6 +82,26 @@ Prompt for the password to use for playbook plays that request sudo access, if a
Desired sudo user (default=root)\&.
.RE
.PP
\fB\-\-tags\fR
.RS 4
Run only these tags from the playbook
.RE
.PP
\fB\-\-syntax\-check\fR
.RS 4
Look for syntax errors in the playbook, but don\(cqt run anything
.RE
.PP
\fB\-\-check\fR
.RS 4
Do not make any changes on the remote system, but test resources to see what might have changed\&. Note this can not scan all possible resource types and is only a simulation\&.
.RE
.PP
\fB\-\-diff\fR
.RS 4
When changing any templated files, show the unified diffs of how they changed\&. When used with \-\-check, shows how the files would have changed if \-\-check were not used\&.
.RE
.PP
\fB\-T\fR \fISECONDS\fR, \fB\-\-timeout=\fR\fISECONDS\fR
.RS 4
Connection timeout to use when trying to talk to hosts, in
@ -120,6 +140,15 @@ The following environment variables may specified\&.
ANSIBLE_HOSTS \(em Override the default ansible hosts file
.sp
ANSIBLE_LIBRARY \(em Override the default ansible module library path
.SH "FILES"
.sp
/etc/ansible/hosts \(em Default inventory file
.sp
/usr/share/ansible/ \(em Default module library
.sp
/etc/ansible/ansible\&.cfg \(em Config file, used if present
.sp
~/\&.ansible\&.cfg \(em User config file, overrides the default config if present
.SH "AUTHOR"
.sp
Ansible was originally written by Michael DeHaan\&. See the AUTHORS file for a complete list of contributors\&.

View File

@ -73,6 +73,25 @@ access, if any.
Desired sudo user (default=root).
*--tags*::
Run only these tags from the playbook
*--syntax-check*::
Look for syntax errors in the playbook, but don't run anything
*--check*::
Do not make any changes on the remote system, but test resources to see what might
have changed. Note this can not scan all possible resource types and is only
a simulation.
*--diff*::
When changing any templated files, show the unified diffs of how they changed. When
used with --check, shows how the files would have changed if --check were not used.
*-T* 'SECONDS', *--timeout=*'SECONDS'::
Connection timeout to use when trying to talk to hosts, in 'SECONDS'.
@ -107,6 +126,16 @@ ANSIBLE_HOSTS -- Override the default ansible hosts file
ANSIBLE_LIBRARY -- Override the default ansible module library path
FILES
-----
/etc/ansible/hosts -- Default inventory file
/usr/share/ansible/ -- Default module library
/etc/ansible/ansible.cfg -- Config file, used if present
~/.ansible.cfg -- User config file, overrides the default config if present
AUTHOR
------
@ -126,7 +155,7 @@ Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------
*ansible*(1), *ansible-pull*(1)
*ansible*(1), *ansible-pull*(1), *ansible-doc*(1)
Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>

View File

@ -1,22 +1,13 @@
'\" t
.\" Title: ansible
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 08/14/2012
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 02/01/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.7
.\" Source: Ansible 1.1
.\" Language: English
.\"
.TH "ANSIBLE" "1" "08/14/2012" "Ansible 0\&.7" "System administration commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH "ANSIBLE" "1" "02/01/2013" "Ansible 1\&.1" "System administration commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -34,7 +25,7 @@ ansible-pull \- set up a remote copy of ansible on each managed node
ansible \-d DEST \-U URL [ \-C CHECKOUT ]
.SH "DESCRIPTION"
.sp
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq over SSH\&.
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \'remote things\' over SSH\&.
.sp
Use ansible\-pull to set up a remote copy of ansible on each managed node, each set to run via cron and update playbook source via git\&. This inverts the default \fBpush\fR architecture of ansible into a \fBpull\fR architecture, which has near\-limitless scaling potential\&.
.sp

View File

@ -70,7 +70,7 @@ Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------
*ansible*(1), *ansible-playbook*(1)
*ansible*(1), *ansible-playbook*(1), *ansible-doc*(1)
Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>

View File

@ -2,12 +2,12 @@
.\" Title: ansible
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 09/06/2012
.\" Date: 02/16/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.7
.\" Source: Ansible 1.1
.\" Language: English
.\"
.TH "ANSIBLE" "1" "09/06/2012" "Ansible 0\&.7" "System administration commands"
.TH "ANSIBLE" "1" "02/16/2013" "Ansible 1\&.1" "System administration commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -131,7 +131,7 @@ seconds\&. Requires
.RS 4
Use this remote
\fIUSERNAME\fR
instead of root\&.
instead of the current user\&.
.RE
.PP
\fB\-U\fR \fISUDO_USERNAME\fR, \fB\-\-sudo\-user=\fR\fISUDO_USERNAME\fR
@ -141,11 +141,6 @@ Sudo to
instead of root\&. Implies \-\-sudo\&.
.RE
.PP
\fB\-\-private\-key=\fR\fIPRIVATE_KEY_FILE\fR
.RS 4
Use this file to authenticate the connection\&.
.RE
.PP
\fB\-c\fR \fICONNECTION\fR, \fB\-\-connection=\fR\fICONNECTION\fR
.RS 4
Connection type to use\&. Possible options are
@ -161,6 +156,11 @@ is mostly useful for crontab or kickstarts\&.
.RS 4
Further limits the selected host/group patterns\&.
.RE
.PP
\fB\-l\fR \fI~REGEX\fR, \fB\-\-limit=\fR\fI~REGEX\fR
.RS 4
Further limits hosts with a regex pattern\&.
.RE
.SH "INVENTORY"
.sp
Ansible stores the hosts it can potentially operate on in an inventory file\&. The syntax is one host per line\&. Groups headers are allowed and are included on their own line, enclosed in square brackets that start the line\&.
@ -171,6 +171,10 @@ Ranges of hosts are also supported\&. For more information and additional option
/etc/ansible/hosts \(em Default inventory file
.sp
/usr/share/ansible/ \(em Default module library
.sp
/etc/ansible/ansible\&.cfg \(em Config file, used if present
.sp
~/\&.ansible\&.cfg \(em User config file, overrides the default config if present
.SH "ENVIRONMENT"
.sp
The following environment variables may specified\&.
@ -178,6 +182,8 @@ The following environment variables may specified\&.
ANSIBLE_HOSTS \(em Override the default ansible hosts file
.sp
ANSIBLE_LIBRARY \(em Override the default ansible module library path
.sp
ANSIBLE_CONFIG \(em Override the default ansible config file
.SH "AUTHOR"
.sp
Ansible was originally written by Michael DeHaan\&. See the AUTHORS file for a complete list of contributors\&.

View File

@ -102,15 +102,12 @@ Poll a background job every 'NUM' seconds. Requires *-B*.
*-u* 'USERNAME', *--remote-user=*'USERNAME'::
Use this remote 'USERNAME' instead of root.
Use this remote 'USERNAME' instead of the current user.
*-U* 'SUDO_USERNAME', *--sudo-user=*'SUDO_USERNAME'::
Sudo to 'SUDO_USERNAME' instead of root. Implies --sudo.
*--private-key=*'PRIVATE_KEY_FILE'::
Use this file to authenticate the connection.
*-c* 'CONNECTION', *--connection=*'CONNECTION'::
Connection type to use. Possible options are 'paramiko' (SSH), 'ssh',
@ -120,6 +117,10 @@ and 'local'. 'local' is mostly useful for crontab or kickstarts.
Further limits the selected host/group patterns.
*-l* '\~REGEX', *--limit=*'~REGEX'::
Further limits hosts with a regex pattern.
INVENTORY
---------
@ -138,6 +139,9 @@ FILES
/usr/share/ansible/ -- Default module library
/etc/ansible/ansible.cfg -- Config file, used if present
~/.ansible.cfg -- User config file, overrides the default config if present
ENVIRONMENT
-----------
@ -148,6 +152,8 @@ ANSIBLE_HOSTS -- Override the default ansible hosts file
ANSIBLE_LIBRARY -- Override the default ansible module library path
ANSIBLE_CONFIG -- Override the default ansible config file
AUTHOR
------
@ -167,7 +173,7 @@ Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------
*ansible-playbook*(1), *ansible-pull*(1)
*ansible-playbook*(1), *ansible-pull*(1), *ansible-doc*(1)
Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>

0
docs/man/man3/.gitdir Normal file
View File

13
docsite/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
# Old compiled python stuff
*.py[co]
# package building stuff
build
# Emacs backup files...
*~
.\#*
.doctrees
# Generated docs stuff
ansible*.xml
.buildinfo
objects.inv
.doctrees

0
docsite/.nojekyll Normal file
View File

31
docsite/Makefile Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/make
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
FORMATTER=../hacking/module_formatter.py
all: clean docs
docs: clean modules
./build-site.py
viewdocs: clean
./build-site.py view
htmldocs:
./build-site.py rst
clean:
-rm -f .buildinfo
-rm -f *.inv
-rm -rf *.doctrees
@echo "Cleaning up byte compiled python stuff"
find . -regex ".*\.py[co]$$" -delete
@echo "Cleaning up editor backup files"
find . -type f \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
.PHONEY: docs clean
modules: $(FORMATTER) ../hacking/templates/rst.j2
PYTHONPATH=../lib $(FORMATTER) -t rst --template-dir=../hacking/templates --module-dir=../library -o rst/modules/ --includes-file=rst/modules/_list.rst

23
docsite/README.md Normal file
View File

@ -0,0 +1,23 @@
Homepage and documentation source for the Ansible
=================================================
This project hosts the source behind [ansible.cc/docs](http://ansible.cc/docs)
Contributions to the documentation are welcome. To make changes, submit a pull request
that changes the restructured text files in the "rst/" directory only, and Michael can
do a docs build and push the static files.
If you do not want to learn RST format (ReStructured Text), you can also file issues
on the documentation project.
Note that module documentation can actually be generated from a DOCUMENTATION docstring
in the modules directory, so corrections to modules written as much need to be made
in the main project in the module source, rather than in the documentation for the module.
Author
======
Michael DeHaan -- michael.dehaan@gmail.com
[http://michaeldehaan.net](http://michaeldehaan.net/)

View File

@ -0,0 +1,8 @@
/* Local CSS tweaks for ansible */
.dropdown-menu {
overflow-y: auto;
}
h2 {
padding-top: 40px;
}

540
docsite/_static/basic.css Normal file
View File

@ -0,0 +1,540 @@
/*
* basic.css
* ~~~~~~~~~
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/* -- main layout ----------------------------------------------------------- */
div.clearer {
clear: both;
}
/* -- relbar ---------------------------------------------------------------- */
div.related {
width: 100%;
font-size: 90%;
}
div.related h3 {
display: none;
}
div.related ul {
margin: 0;
padding: 0 0 0 10px;
list-style: none;
}
div.related li {
display: inline;
}
div.related li.right {
float: right;
margin-right: 5px;
}
/* -- sidebar --------------------------------------------------------------- */
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.sphinxsidebar {
float: left;
width: 230px;
margin-left: -100%;
font-size: 90%;
}
div.sphinxsidebar ul {
list-style: none;
}
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}
div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}
div.sphinxsidebar form {
margin-top: 10px;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
div.sphinxsidebar #searchbox input[type="submit"] {
width: 30px;
}
img {
border: 0;
}
/* -- search page ----------------------------------------------------------- */
ul.search {
margin: 10px 0 0 20px;
padding: 0;
}
ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
}
ul.search li a {
font-weight: bold;
}
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
/* -- index page ------------------------------------------------------------ */
table.contentstable {
width: 90%;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
/* -- general index --------------------------------------------------------- */
table.indextable {
width: 100%;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable dl, table.indextable dd {
margin-top: 0;
margin-bottom: 0;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
/* -- general body styles --------------------------------------------------- */
a.headerlink {
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
div.body p.caption {
text-align: inherit;
}
div.body td {
text-align: left;
}
.field-list ul {
padding-left: 1em;
}
.first {
margin-top: 0 !important;
}
p.rubric {
margin-top: 30px;
font-weight: bold;
}
img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
/* -- sidebars -------------------------------------------------------------- */
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px 7px 0 7px;
background-color: #ffe;
width: 40%;
float: right;
}
p.sidebar-title {
font-weight: bold;
}
/* -- topics ---------------------------------------------------------------- */
div.topic {
border: 1px solid #ccc;
padding: 7px 7px 0 7px;
margin: 10px 0 10px 0;
}
p.topic-title {
font-size: 1.1em;
font-weight: bold;
margin-top: 10px;
}
/* -- admonitions ----------------------------------------------------------- */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
div.admonition dl {
margin-bottom: 0;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
/* -- tables ---------------------------------------------------------------- */
table.docutils {
border: 0;
border-collapse: collapse;
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
table.field-list td, table.field-list th {
border: 0 !important;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
th {
text-align: left;
padding-right: 5px;
}
table.citation {
border-left: solid 1px gray;
margin-left: 1px;
}
table.citation td {
border-bottom: none;
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
list-style: decimal;
}
ol.loweralpha {
list-style: lower-alpha;
}
ol.upperalpha {
list-style: upper-alpha;
}
ol.lowerroman {
list-style: lower-roman;
}
ol.upperroman {
list-style: upper-roman;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
dt:target, .highlighted {
background-color: #fbe54e;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
.refcount {
color: #060;
}
.optional {
font-size: 1.3em;
}
.versionmodified {
font-style: italic;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
.footnote:target {
background-color: #ffa;
}
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
.guilabel, .menuselection {
font-family: sans-serif;
}
.accelerator {
text-decoration: underline;
}
.classifier {
font-style: oblique;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
overflow-y: hidden; /* fixes display issues on Chrome browsers */
}
td.linenos pre {
padding: 5px 0px;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
tt.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
tt.descclassname {
background-color: transparent;
}
tt.xref, a tt {
background-color: transparent;
font-weight: bold;
}
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
background-color: transparent;
}
.viewcode-link {
float: right;
}
.viewcode-back {
float: right;
font-family: sans-serif;
}
div.viewcode-block:target {
margin: -1px -10px;
padding: 0 10px;
}
/* -- math display ---------------------------------------------------------- */
img.math {
vertical-align: middle;
}
div.body div.math p {
text-align: center;
}
span.eqno {
float: right;
}
/* -- printout stylesheet --------------------------------------------------- */
@media print {
div.document,
div.documentwrapper,
div.bodywrapper {
margin: 0 !important;
width: 100%;
}
div.sphinxsidebar,
div.related,
div.footer,
#top-link {
display: none;
}
}

55
docsite/_static/bootstrap-dropdown.js vendored Normal file
View File

@ -0,0 +1,55 @@
/* ============================================================
* bootstrap-dropdown.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(d).parent('li').removeClass('open')
}
$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
})
}( window.jQuery || window.ender );

107
docsite/_static/bootstrap-scrollspy.js vendored Normal file
View File

@ -0,0 +1,107 @@
/* =============================================================
* bootstrap-scrollspy.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================== */
!function ( $ ) {
"use strict"
var $window = $(window)
function ScrollSpy( topbar, selector ) {
var processScroll = $.proxy(this.processScroll, this)
this.$topbar = $(topbar)
this.selector = selector || 'li > a'
this.refresh()
this.$topbar.delegate(this.selector, 'click', processScroll)
$window.scroll(processScroll)
this.processScroll()
}
ScrollSpy.prototype = {
refresh: function () {
this.targets = this.$topbar.find(this.selector).map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.offsets = $.map(this.targets, function (id) {
return $(id).offset().top
})
}
, processScroll: function () {
var scrollTop = $window.scrollTop() + 10
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activateButton( targets[i] )
}
}
, activateButton: function (target) {
this.activeTarget = target
this.$topbar
.find(this.selector).parent('.active')
.removeClass('active')
this.$topbar
.find(this.selector + '[href="' + target + '"]')
.parent('li')
.addClass('active')
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$.fn.scrollSpy = function( options ) {
var scrollspy = this.data('scrollspy')
if (!scrollspy) {
return this.each(function () {
$(this).data('scrollspy', new ScrollSpy( this, options ))
})
}
if ( options === true ) {
return scrollspy
}
if ( typeof options == 'string' ) {
scrollspy[options]()
}
return this
}
$(document).ready(function () {
$('body').scrollSpy('[data-scrollspy] li > a')
})
}( window.jQuery || window.ender );

15
docsite/_static/bootstrap-sphinx.css vendored Normal file
View File

@ -0,0 +1,15 @@
/*
* bootstrap-sphinx.css
* ~~~~~~~~~~~~~~~~~~~~
*
* Sphinx stylesheet -- Twitter Bootstrap theme.
*/
body {
padding-top: 42px;
}
div.documentwrapper {
float: left;
width: 100%;
}

2469
docsite/_static/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

256
docsite/_static/default.css Normal file
View File

@ -0,0 +1,256 @@
/*
* default.css_t
* ~~~~~~~~~~~~~
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: sans-serif;
font-size: 100%;
background-color: #11303d;
color: #000;
margin: 0;
padding: 0;
}
div.document {
background-color: #1c4e63;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
div.body {
background-color: #ffffff;
color: #000000;
padding: 0 20px 30px 20px;
}
div.footer {
color: #ffffff;
width: 100%;
padding: 9px 0 9px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #ffffff;
text-decoration: underline;
}
div.related {
background-color: #133f52;
line-height: 30px;
color: #ffffff;
}
div.related a {
color: #ffffff;
}
div.sphinxsidebar {
}
div.sphinxsidebar h3 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.4em;
font-weight: normal;
margin: 0;
padding: 0;
}
div.sphinxsidebar h3 a {
color: #ffffff;
}
div.sphinxsidebar h4 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.3em;
font-weight: normal;
margin: 5px 0 0 0;
padding: 0;
}
div.sphinxsidebar p {
color: #ffffff;
}
div.sphinxsidebar p.topless {
margin: 5px 10px 10px 10px;
}
div.sphinxsidebar ul {
margin: 10px;
padding: 0;
color: #ffffff;
}
div.sphinxsidebar a {
color: #98dbcc;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
/* -- hyperlink styles ------------------------------------------------------ */
a {
color: #355f7c;
text-decoration: none;
}
a:visited {
color: #355f7c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* -- body styles ----------------------------------------------------------- */
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Trebuchet MS', sans-serif;
background-color: #f2f2f2;
font-weight: normal;
color: #20435c;
border-bottom: 1px solid #ccc;
margin: 20px -20px 10px -20px;
padding: 3px 0 3px 10px;
}
div.body h1 { margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li {
text-align: justify;
line-height: 130%;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.admonition p {
margin-bottom: 5px;
}
div.admonition pre {
margin-bottom: 5px;
}
div.admonition ul, div.admonition ol {
margin-bottom: 5px;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre {
padding: 5px;
background-color: #eeffcc;
color: #333333;
line-height: 120%;
border: 1px solid #ac9;
border-left: none;
border-right: none;
}
tt {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
}
th {
background-color: #ede;
}
.warning tt {
background: #efc2c2;
}
.note tt {
background: #d6d6d6;
}
.viewcode-back {
font-family: sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
}

247
docsite/_static/doctools.js Normal file
View File

@ -0,0 +1,247 @@
/*
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
}
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s == 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* small function to check if an array contains
* a given item.
*/
jQuery.contains = function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == item)
return true;
}
return false;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
};
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated == 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
},
/**
* workaround a firefox stupidity
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
}
};
// quick alias for translations
_ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});

BIN
docsite/_static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
docsite/_static/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

154
docsite/_static/jquery.js vendored Normal file
View File

@ -0,0 +1,154 @@
/*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 13 22:33:48 2010 -0500
*/
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

BIN
docsite/_static/minus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
docsite/_static/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@ -0,0 +1,62 @@
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #303030 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #208050 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #208050 } /* Literal.Number.Float */
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */

View File

@ -0,0 +1,560 @@
/*
* searchtools.js_t
* ~~~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
jQuery.makeSearchSummary = function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
/**
* Search Module
*/
var Search = {
_index : null,
_queued_query : null,
_pulse_status : -1,
init : function() {
var params = $.getQueryParameters();
if (params.q) {
var query = params.q[0];
$('input[name="q"]')[0].value = query;
this.performSearch(query);
}
},
loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null, success: null,
dataType: "script", cache: true});
},
setIndex : function(index) {
var q;
this._index = index;
if ((q = this._queued_query) !== null) {
this._queued_query = null;
Search.query(q);
}
},
hasIndex : function() {
return this._index !== null;
},
deferQuery : function(query) {
this._queued_query = query;
},
stopPulse : function() {
this._pulse_status = 0;
},
startPulse : function() {
if (this._pulse_status >= 0)
return;
function pulse() {
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (var i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
};
pulse();
},
/**
* perform a search for something
*/
performSearch : function(query) {
// create the required interface elements
this.out = $('#search-results');
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
this.dots = $('<span></span>').appendTo(this.title);
this.status = $('<p style="display: none"></p>').appendTo(this.out);
this.output = $('<ul class="search"/>').appendTo(this.out);
$('#search-progress').text(_('Preparing search...'));
this.startPulse();
// index already loaded, the browser was quick!
if (this.hasIndex())
this.query(query);
else
this.deferQuery(query);
},
query : function(query) {
var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
// Stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var objectterms = [];
for (var i = 0; i < tmp.length; i++) {
if (tmp[i] != "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
// select the correct list
if (word[0] == '-') {
var toAppend = excluded;
word = word.substr(1);
}
else {
var toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$.contains(toAppend, word))
toAppend.push(word);
};
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:');
// console.info('required: ', searchterms);
// console.info('excluded: ', excluded);
// prepare search
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var fileMap = {};
var files = null;
// different result priorities
var importantResults = [];
var objectResults = [];
var regularResults = [];
var unimportantResults = [];
$('#search-progress').empty();
// lookup as object
for (var i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i),
objectterms.slice(i+1, objectterms.length))
var results = this.performObjectSearch(objectterms[i], others);
// Assume first word is most likely to be the object,
// other words more likely to be in description.
// Therefore put matches for earlier words first.
// (Results are eventually used in reverse order).
objectResults = results[0].concat(objectResults);
importantResults = results[1].concat(importantResults);
unimportantResults = results[2].concat(unimportantResults);
}
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) == null)
break;
if (files.length == undefined) {
files = [files];
}
// create the mapping
for (var j = 0; j < files.length; j++) {
var file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
}
// now check if the files don't contain excluded terms
for (var file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the
// search result.
for (var i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
// if we have still a valid result we can add it
// to the result list
if (valid)
regularResults.push([filenames[file], titles[file], '', null]);
}
// delete unused variables in order to not waste
// memory until list is retrieved completely
delete filenames, titles, terms;
// now sort the regular results descending by title
regularResults.sort(function(a, b) {
var left = a[1].toLowerCase();
var right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
});
// combine all results
var results = unimportantResults.concat(regularResults)
.concat(objectResults).concat(importantResults);
// print the results
var resultCount = results.length;
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
dirname = dirname.substring(0, dirname.length-6);
} else if (dirname == 'index/') {
dirname = '';
}
listItem.append($('<a/>').attr('href',
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
highlightstring + item[2]).html(item[1]));
} else {
// normal html builders
listItem.append($('<a/>').attr('href',
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
highlightstring + item[2]).html(item[1]));
}
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
item[0] + '.txt', function(data) {
if (data != '') {
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
Search.output.append(listItem);
}
listItem.slideDown(5, function() {
displayNextItem();
});
}, "text");
} else {
// no source available, just display title
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
}
}
// search finished, update title and status message
else {
Search.stopPulse();
Search.title.text(_('Search Results'));
if (!resultCount)
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
else
Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
Search.status.fadeIn(500);
}
}
displayNextItem();
},
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var importantResults = [];
var objectResults = [];
var unimportantResults = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
if (otherterms.length > 0) {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (var i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
}
}
if (!allfound) {
continue;
}
}
var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
return [importantResults, objectResults, unimportantResults]
}
}
$(document).ready(function() {
Search.init();
});

148
docsite/_static/sidebar.js Normal file
View File

@ -0,0 +1,148 @@
/*
* sidebar.js
* ~~~~~~~~~~
*
* This script makes the Sphinx sidebar collapsible.
*
* .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
* in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
* used to collapse and expand the sidebar.
*
* When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
* and the width of the sidebar and the margin-left of the document
* are decreased. When the sidebar is expanded the opposite happens.
* This script saves a per-browser/per-session cookie used to
* remember the position of the sidebar among the pages.
* Once the browser is closed the cookie is deleted and the position
* reset to the default (expanded).
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
$(function() {
// global elements used by the functions.
// the 'sidebarbutton' element is defined as global after its
// creation, in the add_sidebar_button function
var bodywrapper = $('.bodywrapper');
var sidebar = $('.sphinxsidebar');
var sidebarwrapper = $('.sphinxsidebarwrapper');
// original margin-left of the bodywrapper and width of the sidebar
// with the sidebar expanded
var bw_margin_expanded = bodywrapper.css('margin-left');
var ssb_width_expanded = sidebar.width();
// margin-left of the bodywrapper and width of the sidebar
// with the sidebar collapsed
var bw_margin_collapsed = '.8em';
var ssb_width_collapsed = '.8em';
// colors used by the current theme
var dark_color = $('.related').css('background-color');
var light_color = $('.document').css('background-color');
function sidebar_is_collapsed() {
return sidebarwrapper.is(':not(:visible)');
}
function toggle_sidebar() {
if (sidebar_is_collapsed())
expand_sidebar();
else
collapse_sidebar();
}
function collapse_sidebar() {
sidebarwrapper.hide();
sidebar.css('width', ssb_width_collapsed);
bodywrapper.css('margin-left', bw_margin_collapsed);
sidebarbutton.css({
'margin-left': '0',
'height': bodywrapper.height()
});
sidebarbutton.find('span').text('»');
sidebarbutton.attr('title', _('Expand sidebar'));
document.cookie = 'sidebar=collapsed';
}
function expand_sidebar() {
bodywrapper.css('margin-left', bw_margin_expanded);
sidebar.css('width', ssb_width_expanded);
sidebarwrapper.show();
sidebarbutton.css({
'margin-left': ssb_width_expanded-12,
'height': bodywrapper.height()
});
sidebarbutton.find('span').text('«');
sidebarbutton.attr('title', _('Collapse sidebar'));
document.cookie = 'sidebar=expanded';
}
function add_sidebar_button() {
sidebarwrapper.css({
'float': 'left',
'margin-right': '0',
'width': ssb_width_expanded - 28
});
// create the button
sidebar.append(
'<div id="sidebarbutton"><span>&laquo;</span></div>'
);
var sidebarbutton = $('#sidebarbutton');
light_color = sidebarbutton.css('background-color');
// find the height of the viewport to center the '<<' in the page
var viewport_height;
if (window.innerHeight)
viewport_height = window.innerHeight;
else
viewport_height = $(window).height();
sidebarbutton.find('span').css({
'display': 'block',
'margin-top': (viewport_height - sidebar.position().top - 20) / 2
});
sidebarbutton.click(toggle_sidebar);
sidebarbutton.attr('title', _('Collapse sidebar'));
sidebarbutton.css({
'color': '#FFFFFF',
'border-left': '1px solid ' + dark_color,
'font-size': '1.2em',
'cursor': 'pointer',
'height': bodywrapper.height(),
'padding-top': '1px',
'margin-left': ssb_width_expanded - 12
});
sidebarbutton.hover(
function () {
$(this).css('background-color', dark_color);
},
function () {
$(this).css('background-color', light_color);
}
);
}
function set_position_from_cookie() {
if (!document.cookie)
return;
var items = document.cookie.split(';');
for(var k=0; k<items.length; k++) {
var key_val = items[k].split('=');
var key = key_val[0];
if (key == 'sidebar') {
var value = key_val[1];
if ((value == 'collapsed') && (!sidebar_is_collapsed()))
collapse_sidebar();
else if ((value == 'expanded') && (sidebar_is_collapsed()))
expand_sidebar();
}
}
}
add_sidebar_button();
var sidebarbutton = $('#sidebarbutton');
set_position_from_cookie();
});

View File

@ -0,0 +1,23 @@
// Underscore.js 0.5.5
// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the terms of the MIT license.
// Portions of Underscore are inspired by or borrowed from Prototype.js,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore/
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();

View File

@ -0,0 +1,5 @@
<li class="dropdown" data-dropdown="dropdown">
<a href="{{ pathto(master_doc) }}"
class="dropdown-toggle">Chapter</a>
<span class="globaltoc">{{ toctree(maxdepth=1) }}</span>
</li>

View File

@ -0,0 +1,155 @@
{% extends "basic/layout.html" %}
{% set script_files = script_files + ['_static/bootstrap-dropdown.js', '_static/bootstrap-scrollspy.js'] %}
{% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css', '_static/ansible-local.css'] + css_files %}
{# Sidebar: Rework into our Boostrap nav section. #}
{% macro navBar() %}
<div class="topbar" data-scrollspy="scrollspy" >
<div class="topbar-inner">
<div class="container">
<!-- <a class="brand" href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a> -->
<ul class="nav">
{% block sidebartoc %}
<li><a href="/">Home</A>
{% include "globaltoc.html" %}
{% include "localtoc.html" %}
{% endblock %}
</ul>
<ul class="nav secondary-nav">
{% block sidebarsearch %}
{% include "searchbox.html" %}
{% endblock %}
</ul>
</div>
</div>
</div>
{% endmacro %}
<p></p>
{%- block extrahead %}
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29861888-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type =
'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
// Set the maximum height of drop down menus to just less than the height
// of the viewport.
var set_max_menu_height = function () {
// set menu max height to 75 less than viewport height
$('.dropdown-menu').css('max-height', $(window).height() - 75);
}
// Set this when we set the page up and on each resize.
$(window).resize(set_max_menu_height);
$(window).ready(set_max_menu_height);
</script>
{% endblock %}
{% block header %}{{ navBar() }}{% endblock %}
{# Silence the sidebar's, relbar's #}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{%- block content %}
<div class="container">
{% block body %} {% endblock %}
<br/>
</div>
{%- endblock %}
{%- block footer %}
<footer class="footer">
<center>
<a href="http://ansibleworks.com"><img src="http://ansible.cc/img/AnsibleWorks.png" alt="AnsibleWorks"></a>
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}<br/>
{%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/>
{%- endif %}
</p>
</div>
</center>
</footer>
{%- endblock %}

View File

@ -0,0 +1,5 @@
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">{{ _('Section') }}</a>
<span class="localtoc">{{ toc }}</span>
</li>

View File

@ -0,0 +1,8 @@
{%- if prev %}
<li><a href="{{ prev.link|e }}"
title="{{ _('previous chapter') }}">{{ "&laquo;"|safe }} {{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li><a href="{{ next.link|e }}"
title="{{ _('next chapter') }}">{{ next.title }} {{ "&raquo;"|safe }}</a></li>
{%- endif %}

View File

@ -0,0 +1,7 @@
{%- if pagename != "search" %}
<form class="pull-left" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
{%- endif %}

View File

@ -0,0 +1,4 @@
{%- if show_source and has_source and sourcename %}
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Source') }}</a></li>
{%- endif %}

View File

@ -0,0 +1,55 @@
/* ============================================================
* bootstrap-dropdown.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(d).parent('li').removeClass('open')
}
$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
})
}( window.jQuery || window.ender );

View File

@ -0,0 +1,107 @@
/* =============================================================
* bootstrap-scrollspy.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================== */
!function ( $ ) {
"use strict"
var $window = $(window)
function ScrollSpy( topbar, selector ) {
var processScroll = $.proxy(this.processScroll, this)
this.$topbar = $(topbar)
this.selector = selector || 'li > a'
this.refresh()
this.$topbar.delegate(this.selector, 'click', processScroll)
$window.scroll(processScroll)
this.processScroll()
}
ScrollSpy.prototype = {
refresh: function () {
this.targets = this.$topbar.find(this.selector).map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.offsets = $.map(this.targets, function (id) {
return $(id).offset().top
})
}
, processScroll: function () {
var scrollTop = $window.scrollTop() + 10
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activateButton( targets[i] )
}
}
, activateButton: function (target) {
this.activeTarget = target
this.$topbar
.find(this.selector).parent('.active')
.removeClass('active')
this.$topbar
.find(this.selector + '[href="' + target + '"]')
.parent('li')
.addClass('active')
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$.fn.scrollSpy = function( options ) {
var scrollspy = this.data('scrollspy')
if (!scrollspy) {
return this.each(function () {
$(this).data('scrollspy', new ScrollSpy( this, options ))
})
}
if ( options === true ) {
return scrollspy
}
if ( typeof options == 'string' ) {
scrollspy[options]()
}
return this
}
$(document).ready(function () {
$('body').scrollSpy('[data-scrollspy] li > a')
})
}( window.jQuery || window.ender );

View File

@ -0,0 +1,24 @@
/*
* bootstrap-sphinx.css
* ~~~~~~~~~~~~~~~~~~~~
*
* Sphinx stylesheet -- Twitter Bootstrap theme.
*/
body {
padding-top: 42px;
}
div.documentwrapper {
float: left;
width: 100%;
}
{%- block sidebarlogo %}
{%- if logo %}
.topbar h3 a, .topbar .brand {
background: transparent url("{{ logo }}") no-repeat 22px 3px;
padding-left: 62px;
}
{%- endif %}
{%- endblock %}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
# Twitter Bootstrap Theme
[theme]
inherit = basic
stylesheet = basic.css
pygments_style = tango

BIN
docsite/ansible-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docsite/ansible_arch.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
docsite/ansible_arch2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

103
docsite/build-site.py Executable file
View File

@ -0,0 +1,103 @@
#!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of the Ansible Documentation
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
__docformat__ = 'restructuredtext'
import os
import sys
import traceback
try:
from sphinx.application import Sphinx
except ImportError:
print "#################################"
print "Dependency missing: Python Sphinx"
print "#################################"
sys.exit(1)
import os
class SphinxBuilder(object):
"""
Creates HTML documentation using Sphinx.
"""
def __init__(self):
"""
Run the DocCommand.
"""
print "Creating html documentation ..."
try:
buildername = 'html'
outdir = os.path.abspath(os.getcwd())
# Create the output directory if it doesn't exist
if not os.access(outdir, os.F_OK):
os.mkdir(outdir)
doctreedir = os.path.join('./', '.doctrees')
confdir = os.path.abspath('./')
srcdir = os.path.abspath('rst')
freshenv = True
# Create the builder
app = Sphinx(srcdir,
confdir,
outdir,
doctreedir,
buildername,
{},
sys.stdout,
sys.stderr,
freshenv)
app.builder.build_all()
except ImportError, ie:
traceback.print_exc()
except Exception, ex:
print >> sys.stderr, "FAIL! exiting ... (%s)" % ex
def build_docs(self):
self.app.builder.build_all()
def build_rst_docs():
docgen = SphinxBuilder()
if __name__ == '__main__':
if '-h' in sys.argv or '--help' in sys.argv:
print "This script builds the html documentation from rst/asciidoc sources.\n"
print " Run 'make docs' to build everything."
print " Run 'make viewdocs' to build and then preview in a web browser."
sys.exit(0)
# The 'htmldocs' make target will call this scrip twith the 'rst'
# parameter' We don't need to run the 'htmlman' target then.
if "rst" in sys.argv:
build_rst_docs()
else:
# By default, preform the rst->html transformation and then
# the asciidoc->html trasnformation
build_rst_docs()
if "view" in sys.argv:
import webbrowser
if not webbrowser.open('index.html'):
print >> sys.stderr, "Could not open on your webbrowser."

206
docsite/conf.py Normal file
View File

@ -0,0 +1,206 @@
# -*- coding: utf-8 -*-
#
# documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed
# automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys
import os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.append(os.path.abspath('some/directory'))
sys.path.insert(0, os.path.join('ansible', 'lib'))
sys.path.append(os.path.abspath('_themes'))
VERSION='0.01'
AUTHOR='AnsibleWorks'
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings.
# They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
# Later on, add 'sphinx.ext.viewcode' to the list if you want to have
# colorized code generated too for references.
# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General substitutions.
project = 'Ansible Documentation'
copyright = "2013 AnsibleWorks"
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
#
# The short X.Y version.
version = VERSION
# The full version, including alpha/beta/rc tags.
release = VERSION
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directories, that shouldn't be
# searched for source files.
#exclude_dirs = []
# A list of glob-style patterns that should be excluded when looking
# for source files.
exclude_patterns = ['modules']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Options for HTML output
# -----------------------
html_theme_path = ['_themes']
html_theme = 'bootstrap'
html_short_title = 'Ansible Documentation'
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_style = 'default.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = 'Ansible Documentation'
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (within the static path) to place at the top of
# the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = 'favicon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['.static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, the reST sources are included in the HTML build as _sources/<name>.
html_copy_source = False
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Poseidodoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
('index', 'ansible.tex', 'Ansible Documentation',
AUTHOR, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
autoclass_content = 'both'

BIN
docsite/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id474207"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook &lt;filename.yml&gt; … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
system. Ansible-playbook is the tool used to run them. See the
project home page (link below) for more information.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>filename.yml</strong></span>
</span></dt><dd>
The names of one or more YAML format files to run as ansible playbooks.
</dd></dl></div></div><div class="refsect1" title="OPTIONS"><a id="_options"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>-i</strong></span> <span class="emphasis"><em>PATH</em></span>, <span class="strong"><strong>--inventory=</strong></span><span class="emphasis"><em>PATH</em></span>
</span></dt><dd>
The <span class="emphasis"><em>PATH</em></span> to the inventory hosts file, which defaults to <span class="emphasis"><em>/etc/ansible/hosts</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-M</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--module-path=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
The <span class="emphasis"><em>DIRECTORY</em></span> to load modules from. The default is <span class="emphasis"><em>/usr/share/ansible</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-f</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--forks=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Level of parallelism. <span class="emphasis"><em>NUM</em></span> is specified as an integer, the default is 5.
</dd><dt><span class="term">
<span class="strong"><strong>-k</strong></span>, <span class="strong"><strong>--ask-pass</strong></span>
</span></dt><dd>
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
</dd><dt><span class="term">
<span class="strong"><strong>-T</strong></span> <span class="emphasis"><em>SECONDS</em></span>, <span class="strong"><strong>--timeout=</strong></span><span class="emphasis"><em>SECONDS</em></span>
</span></dt><dd>
Connection timeout to use when trying to talk to hosts, in <span class="emphasis"><em>SECONDS</em></span>.
</dd></dl></div></div><div class="refsect1" title="ENVIRONMENT"><a id="_environment"></a><h2>ENVIRONMENT</h2><p>The following environment variables may specified.</p><p>ANSIBLE_HOSTS  — Override the default ansible hosts file</p><p>ANSIBLE_LIBRARY — Override the default ansible module library path</p></div><div class="refsect1" title="AUTHOR"><a id="_author"></a><h2>AUTHOR</h2><p>Ansible was originally written by Michael DeHaan. See the AUTHORS file
for a complete list of contributors.</p></div><div class="refsect1" title="COPYRIGHT"><a id="_copyright"></a><h2>COPYRIGHT</h2><p>Copyright © 2012, Michael DeHaan</p><p>Ansible is released under the terms of the GPLv3 License.</p></div><div class="refsect1" title="SEE ALSO"><a id="_see_also"></a><h2>SEE ALSO</h2><p><span class="strong"><strong>ansible</strong></span>(1)</p><p>Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <a class="ulink" href="https://ansible.github.com/" target="_top">https://ansible.github.com/</a></p></div></div></body></html>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id392901"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible &lt;host-pattern&gt; [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
SSH.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>host-pattern</strong></span>
</span></dt><dd>
A name of a group in the inventory file, a shell-like glob selecting
hosts in inventory file, or any combination of the two separated by
semicolons.
</dd></dl></div></div><div class="refsect1" title="OPTIONS"><a id="_options"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>-i</strong></span> <span class="emphasis"><em>PATH</em></span>, <span class="strong"><strong>--inventory=</strong></span><span class="emphasis"><em>PATH</em></span>
</span></dt><dd>
The <span class="emphasis"><em>PATH</em></span> to the inventory hosts file, which defaults to <span class="emphasis"><em>/etc/ansible/hosts</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-f</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--forks=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Level of parallelism. <span class="emphasis"><em>NUM</em></span> is specified as an integer, the default is 5.
</dd><dt><span class="term">
<span class="strong"><strong>-m</strong></span> <span class="emphasis"><em>NAME</em></span>, <span class="strong"><strong>--module-name=</strong></span><span class="emphasis"><em>NAME</em></span>
</span></dt><dd>
Execute the module called <span class="emphasis"><em>NAME</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-M</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--module-path=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
The <span class="emphasis"><em>DIRECTORY</em></span> to load modules from. The default is <span class="emphasis"><em>/usr/share/ansible</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-a</strong></span> '<span class="emphasis"><em>ARGUMENTS</em></span>', <span class="strong"><strong>--args=</strong></span>'<span class="emphasis"><em>ARGUMENTS</em></span>'
</span></dt><dd>
The <span class="emphasis"><em>ARGUMENTS</em></span> to pass to the module.
</dd><dt><span class="term">
<span class="strong"><strong>-k</strong></span>, <span class="strong"><strong>--ask-pass</strong></span>
</span></dt><dd>
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
</dd><dt><span class="term">
<span class="strong"><strong>-o</strong></span>, <span class="strong"><strong>--one-line</strong></span>
</span></dt><dd>
Try to output everything on one line.
</dd><dt><span class="term">
<span class="strong"><strong>-t</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--tree=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
Save contents in this output <span class="emphasis"><em>DIRECTORY</em></span>, with the results saved in a
file named after each host.
</dd><dt><span class="term">
<span class="strong"><strong>-T</strong></span> <span class="emphasis"><em>SECONDS</em></span>, <span class="strong"><strong>--timeout=</strong></span><span class="emphasis"><em>SECONDS</em></span>
</span></dt><dd>
Connection timeout to use when trying to talk to hosts, in <span class="emphasis"><em>SECONDS</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-B</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--background=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Run commands in the background, killing the task after <span class="emphasis"><em>NUM</em></span> seconds.
</dd><dt><span class="term">
<span class="strong"><strong>-P</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--poll=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Poll a background job every <span class="emphasis"><em>NUM</em></span> seconds. Requires <span class="strong"><strong>-B</strong></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-u</strong></span> <span class="emphasis"><em>USERNAME</em></span>, <span class="strong"><strong>--remote-user=</strong></span><span class="emphasis"><em>USERNAME</em></span>
</span></dt><dd>
Use this remote <span class="emphasis"><em>USERNAME</em></span> instead of root.
</dd></dl></div></div><div class="refsect1" title="INVENTORY"><a id="_inventory"></a><h2>INVENTORY</h2><p>Ansible stores the hosts it can potentially operate on in an inventory
file. The syntax is one host per line. Groups headers are allowed and
are included on their own line, enclosed in square brackets.</p></div><div class="refsect1" title="FILES"><a id="_files"></a><h2>FILES</h2><p>/etc/ansible/hosts — Default inventory file</p><p>/usr/share/ansible/ — Default module library</p></div><div class="refsect1" title="ENVIRONMENT"><a id="_environment"></a><h2>ENVIRONMENT</h2><p>The following environment variables may specified.</p><p>ANSIBLE_HOSTS  — Override the default ansible hosts file</p><p>ANSIBLE_LIBRARY — Override the default ansible module library path</p></div><div class="refsect1" title="AUTHOR"><a id="_author"></a><h2>AUTHOR</h2><p>Ansible was originally written by Michael DeHaan. See the AUTHORS file
for a complete list of contributors.</p></div><div class="refsect1" title="COPYRIGHT"><a id="_copyright"></a><h2>COPYRIGHT</h2><p>Copyright © 2012, Michael DeHaan</p><p>Ansible is released under the terms of the GPLv3 License.</p></div><div class="refsect1" title="SEE ALSO"><a id="_see_also"></a><h2>SEE ALSO</h2><p><span class="strong"><strong>ansible-playbook</strong></span>(1)</p><p>Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <a class="ulink" href="https://ansible.github.com/" target="_top">https://ansible.github.com/</a></p></div></div></body></html>

114
docsite/rst/YAMLSyntax.rst Normal file
View File

@ -0,0 +1,114 @@
YAML Syntax
===========
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
This page provides a basic overview of correct YAML syntax, which is how Ansible
playbooks (our configuration management language) are expressed.
We use YAML because it is easier to read and write for humans than other common
data formats like XML or JSON. Further, there are libraries available for reading
and writing YAML in most programming languages.
You may also wish to read :doc:`playbooks` at the same time to see how this
is used in practice.
YAML Basics
-----------
For `ansible`, nearly every YAML file starts with a list.
Each item in the list is a list of key/value pairs, commonly
called a "hash" or a "dictionary". So, we need to know how
to write lists and dictionaries in YAML.
There's another small quirk to YAML. All YAML files (regardless of their association with
`ansible` or not) should start with ``---``. This is just a YAML
format thing that means "this is the start of a document".
All members of a list are lines beginning at the same indentation level starting
with a ``-`` (dash) character::
---
# A list of tasty fruits
- Apple
- Orange
- Strawberry
- Mango
A dictionary is represented in a simple ``key:`` and ``value`` form::
---
# An employee record
name: Example Developer
job: Developer
skill: Elite
Dictionaries can also be represented in an abbreviated form if you really want to::
---
# An employee record
{name: Example Developer, job: Developer, skill: Elite}
.. _truthiness:
Ansible doesn't really use these too much, but you can also specify a
boolean value (true/false) in several forms::
---
create_key: yes
needs_agent: no
knows_oop: True
likes_emacs: TRUE
uses_cvs: false
Let's combine what we learned so far in an arbitary YAML example. This really
has nothing to do with Ansible, but will give you a feel for the format::
---
# An employee record
name: Example Developer
job: Developer
skill: Elite
employed: True
foods:
- Apple
- Orange
- Strawberry
- Mango
languages:
ruby: Elite
python: Elite
dotnet: Lame
That's all you really need to know about YAML to get started writing
`Ansible` playbooks.
Gotchas
-------
While YAML is generally friendly, the following is going to be a YAML syntax error:
foo: somebody said I should put a colon here: so I did
You will want to quote any hash values using colons, like so:
foo: "somebody said I should put a colon here: so I did"
And then the colon will be preserved.
.. seealso::
:doc:`playbooks`
Learn what playbooks can do and how to write/run them.
`YAMLLint <http://yamllint.com/>`_
YAML Lint (online) helps you debug YAML syntax if you are having problems
`Github examples directory <https://github.com/ansible/ansible/tree/devel/examples/playbooks>`_
Complete playbook files from the github project source
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

371
docsite/rst/api.rst Normal file
View File

@ -0,0 +1,371 @@
API & Integrations
==================
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
There are several interesting ways to use Ansible from an API perspective. You can use
the Ansible python API to control nodes, you can extend Ansible to respond to various python events,
and you can plug in inventory data from external data sources. Ansible is written in its own
API so you have a considerable amount of power across the board.
.. contents:: `Table of contents`
:depth: 2
:backlinks: top
Python API
----------
The Python API is very powerful, and is how the ansible CLI and ansible-playbook
are implemented.
It's pretty simple::
import ansible.runner
runner = ansible.runner.Runner(
module_name='ping',
module_args='',
pattern='web*',
forks=10
)
datastructure = runner.run()
The run method returns results per host, grouped by whether they
could be contacted or not. Return types are module specific, as
expressed in the 'ansible-modules' documentation.::
{
"dark" : {
"web1.example.com" : "failure message"
}
"contacted" : {
"web2.example.com" : 1
}
}
A module can return any type of JSON data it wants, so Ansible can
be used as a framework to rapidly build powerful applications and scripts.
Detailed API Example
````````````````````
The following script prints out the uptime information for all hosts::
#!/usr/bin/python
import ansible.runner
import sys
# construct the ansible runner and execute on all hosts
results = ansible.runner.Runner(
pattern='*', forks=10,
module_name='command', module_args='/usr/bin/uptime',
).run()
if results is None:
print "No hosts found"
sys.exit(1)
print "UP ***********"
for (hostname, result) in results['contacted'].items():
if not 'failed' in result:
print "%s >>> %s" % (hostname, result['stdout'])
print "FAILED *******"
for (hostname, result) in results['contacted'].items():
if 'failed' in result:
print "%s >>> %s" % (hostname, result['msg'])
print "DOWN *********"
for (hostname, result) in results['dark'].items():
print "%s >>> %s" % (hostname, result)
Advanced programmers may also wish to read the source to ansible itself, for
it uses the Runner() API (with all available options) to implement the
command line tools ``ansible`` and ``ansible-playbook``.
Plugins Available Online
------------------------
The remainder of features in the API docs have components available in `ansible-plugins <https://github.com/ansible/ansible/blob/devel/plugins>`_. Send us a github pull request if you develop any interesting features.
External Inventory Scripts
--------------------------
Often a user of a configuration management system will want to keep inventory
in a different system. Frequent examples include LDAP, `Cobbler <http://cobbler.github.com>`_,
or a piece of expensive enterprisey CMDB software. Ansible easily supports all
of these options via an external inventory system. The plugins directory contains some of these already -- including options for EC2/Eucalyptus and OpenStack, which will be detailed below.
It's possible to write an external inventory script in any language. If you are familiar with Puppet terminology, this concept is basically the same as 'external nodes', with the slight difference that it also defines which hosts are managed.
Script Conventions
``````````````````
When the external node script is called with the single argument '--list', the script must return a JSON hash/dictionary of all the groups to be managed.
Each group's value should be either a hash/dictionary containing a list of each host/IP, potential child groups, and potential group variables, or
simply a list of host/IP addresses, like so::
{
'databases' : {
'hosts' : [ 'host1.example.com', 'host2.example.com' ],
'vars' : {
'a' : true
}
},
'webservers' : [ 'host2.example.com', 'host3.example.com' ],
'atlanta' : {
'hosts' : [ 'host1.example.com', 'host4.example.com', 'host5.example.com' ],
'vars' : {
'b' : false
},
'children': [ 'marietta', '5points' ],
},
'marietta' : [ 'host6.example.com' ],
'5points' : [ 'host7.example.com' ]
}
.. versionadded: 1.0
Before version 1.0, each group could only have a list of hostnames/IP addresses, like the webservers, marietta, and 5points groups above.
When called with the arguments '--host <hostname>' (where <hostname> is a host from above), the script must return either an empty JSON
hash/dictionary, or a hash/dictionary of variables to make available to templates and playbooks. Returning variables is optional,
if the script does not wish to do this, returning an empty hash/dictionary is the way to go::
{
'favcolor' : 'red',
'ntpserver' : 'wolf.example.com',
'monitoring' : 'pack.example.com'
}
Example: The Cobbler External Inventory Script
``````````````````````````````````````````````
It is expected that many Ansible users will also be `Cobbler <http://cobbler.github.com>`_ users. Cobbler has a generic
layer that allows it to represent data for multiple configuration management systems (even at the same time), and has
been referred to as a 'lightweight CMDB' by some admins. This particular script will communicate with Cobbler
using Cobbler's XMLRPC API.
To tie Ansible's inventory to Cobbler (optional), copy `this script <https://raw.github.com/ansible/ansible/devel/plugins/inventory/cobbler.py>`_ to /etc/ansible/hosts and `chmod +x` the file. cobblerd will now need
to be running when you are using Ansible.
Test the file by running `./etc/ansible/hosts` directly. You should see some JSON data output, but it may not have
anything in it just yet.
Let's explore what this does. In cobbler, assume a scenario somewhat like the following::
cobbler profile add --name=webserver --distro=CentOS6-x86_64
cobbler profile edit --name=webserver --mgmt-classes="webserver" --ksmeta="a=2 b=3"
cobbler system edit --name=foo --dns-name="foo.example.com" --mgmt-classes="atlanta" --ksmeta="c=4"
cobbler system edit --name=bar --dns-name="bar.example.com" --mgmt-classes="atlanta" --ksmeta="c=5"
In the example above, the system 'foo.example.com' will be addressable by ansible directly, but will also be addressable when using the group names 'webserver' or 'atlanta'. Since Ansible uses SSH, we'll try to contract system foo over 'foo.example.com', only, never just 'foo'. Similarly, if you try "ansible foo" it wouldn't find the system... but "ansible 'foo*'" would, because the system DNS name starts with 'foo'.
The script doesn't just provide host and group info. In addition, as a bonus, when the 'setup' module is run (which happens automatically when using playbooks), the variables 'a', 'b', and 'c' will all be auto-populated in the templates::
# file: /srv/motd.j2
Welcome, I am templated with a value of a={{ a }}, b={{ b }}, and c={{ c }}
Which could be executed just like this::
ansible webserver -m setup
ansible webserver -m template -a "src=/tmp/motd.j2 dest=/etc/motd"
.. note::
The name 'webserver' came from cobbler, as did the variables for
the config file. You can still pass in your own variables like
normal in Ansible, but variables from the external inventory script
will override any that have the same name.
So, with the template above (motd.j2), this would result in the following data being written to /etc/motd for system 'foo'::
Welcome, I am templated with a value of a=2, b=3, and c=4
And on system 'bar' (bar.example.com)::
Welcome, I am templated with a value of a=2, b=3, and c=5
And technically, though there is no major good reason to do it, this also works too::
ansible webserver -m shell -a "echo {{ a }}"
So in other words, you can use those variables in arguments/actions as well. You might use this to name
a conf.d file appropriately or something similar. Who knows?
So that's the Cobbler integration support -- using the cobbler script as an example, it should be trivial to adapt Ansible to pull inventory, as well as variable information, from any data source. If you create anything interesting, please share with the mailing list, and we can keep it in the source code tree for others to use.
Example: AWS EC2 External Inventory Script
``````````````````````````````````````````
If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach. For this reason, you can use the `EC2 external inventory <https://raw.github.com/ansible/ansible/devel/plugins/inventory/ec2.py>`_ script.
You can use this script in one of two ways. The easiest is to use Ansible's ``-i`` command line option and specify the path to the script.
ansible -i ec2.py -u ubuntu us-east-1d -m ping
The second option is to copy the script to `/etc/ansible/hosts` and `chmod +x` it. You will also need to copy the `ec2.ini <https://raw.github.com/ansible/ansible/devel/plugins/inventory/ec2.ini>`_ file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally.
To successfully make an API call to AWS, you will need to configure Boto (the Python interface to AWS). There are a `variety of methods <http://docs.pythonboto.org/en/latest/boto_config_tut.html>`_ available, but the simplest is just to export two environment variables:
export AWS_ACCESS_KEY_ID='AK123'
export AWS_SECRET_ACCESS_KEY='abc123'
You can test the script by itself to make sure your config is correct
cd plugins/inventory
./ec2.py --list
After a few moments, you should see your entire EC2 inventory across all regions in JSON.
Since each region requires its own API call, if you are only using a small set of regions, feel free to edit ``ec2.ini`` and list only the regions you are interested in. There are other config options in ``ec2.ini`` including cache control, and destination variables.
At their heart, inventory files are simply a mapping from some name to a destination address. The default ``ec2.ini`` settings are configured for running Ansible from outside EC2 (from your laptop for example). If you are running Ansible from within EC2, internal DNS names and IP addresses may make more sense than public DNS names. In this case, you can modify the ``destination_variable`` in ``ec2.ini`` to be the private DNS name of an instance. This is particularly important when running Ansible within a private subnet inside a VPC, where the only way to access an instance is via its private IP address. For VPC instances, `vpc_destination_variable` in ``ec2.ini`` provides a means of using which ever `boto.ec2.instance variable <http://docs.pythonboto.org/en/latest/ref/ec2.html#module-boto.ec2.instance>`_ makes the most sense for your use case.
The EC2 external inventory provides mappings to instances from several groups:
Instance ID
These are groups of one since instance IDs are unique.
e.g.
``i-00112233``
``i-a1b1c1d1``
Region
A group of all instances in an AWS region.
e.g.
``us-east-1``
``us-west-2``
Availability Zone
A group of all instances in an availability zone.
e.g.
``us-east-1a``
``us-east-1b``
Security Group
Instances belong to one or more security groups. A group is created for each security group, with all characters except alphanumerics, dashes (-) converted to underscores (_). Each group is prefixed by ``security_group_``
e.g.
``security_group_default``
``security_group_webservers``
``security_group_Pete_s_Fancy_Group``
Tags
Each instance can have a variety of key/value pairs associated with it called Tags. The most common tag key is 'Name', though anything is possible. Each key/value pair is its own group of instances, again with special characters converted to underscores, in the format ``tag_KEY_VALUE``
e.g.
``tag_Name_Web``
``tag_Name_redis-master-001``
``tag_aws_cloudformation_logical-id_WebServerGroup``
When the Ansible is interacting with a specific server, the EC2 inventory script is called again with the ``--host HOST`` option. This looks up the HOST in the index cache to get the instance ID, and then makes an API call to AWS to get information about that specific instance. It then makes information about that instance available as variables to your playbooks. Each variable is prefixed by ``ec2_``. Here are some of the variables available:
- ec2_architecture
- ec2_description
- ec2_dns_name
- ec2_id
- ec2_image_id
- ec2_instance_type
- ec2_ip_address
- ec2_kernel
- ec2_key_name
- ec2_launch_time
- ec2_monitored
- ec2_ownerId
- ec2_placement
- ec2_platform
- ec2_previous_state
- ec2_private_dns_name
- ec2_private_ip_address
- ec2_public_dns_name
- ec2_ramdisk
- ec2_region
- ec2_root_device_name
- ec2_root_device_type
- ec2_security_group_ids
- ec2_security_group_names
- ec2_spot_instance_request_id
- ec2_state
- ec2_state_code
- ec2_state_reason
- ec2_status
- ec2_subnet_id
- ec2_tag_Name
- ec2_tenancy
- ec2_virtualization_type
- ec2_vpc_id
Both ``ec2_security_group_ids`` and ``ec2_security_group_names`` are comma-separated lists of all security groups. Each EC2 tag is a variable in the format ``ec2_tag_KEY``.
To see the complete list of variables available for an instance, run the script by itself::
cd plugins/inventory
./ec2.py --host ec2-12-12-12-12.compute-1.amazonaws.com
Example: OpenStack Inventory Script
```````````````````````````````````
Though not detailed here in as much depth as the EC2 module, there's also a OpenStack Nova external inventory source in the plugins directory. See the inline comments in the module source for how to use it.
Callback Plugins
----------------
Ansible can be configured via code to respond to external events. This can include enhancing logging, signalling an external software
system, or even (yes, really) making sound effects. Some examples are contained in the plugins directory.
Connection Type Plugins
-----------------------
By default, ansible ships with a 'paramiko' SSH, native ssh (just called 'ssh'), and 'local' connection type. Release 0.8 also
added an accelerated connection type named 'fireball'. All of these can be used
in playbooks and with /usr/bin/ansible to decide how you want to talk to remote machines. The basics of these connection types
are covered in the 'getting started' section. Should you want to extend Ansible to support other transports (SNMP? Message bus?
Carrier Pigeon?) it's as simple as copying the format of one of the existing modules and dropping it into the connection plugins
directory.
Lookup Plugins
--------------
Language constructs like "with_fileglob" and "with_items" are implemented via lookup plugins. Just like other plugin types, you can write your own.
Vars Plugins
------------
Playbook constructs like 'host_vars' and 'group_vars' work via 'vars' plugins. They inject additional variable
data into ansible runs that did not come from an inventory, playbook, or command line. Note that variables
can also be returned from inventory, so in most cases, you won't need to write or understand vars_plugins.
Filter Plugins
--------------
If you want more Jinja2 filters available in a Jinja2 template (filters like to_yaml and to_json are provided by default), they can be extended by writing a filter plugin.
Distributing Plugins
--------------------
.. versionadded: 0.8
Plugins are loaded from both Python's site_packages (those that ship with ansible) and a configured plugins directory, which defaults
to /usr/share/ansible/plugins, in a subfolder for each plugin type::
* action_plugins
* lookup_plugins
* callback_plugins
* connection_plugins
* filter_plugins
* vars_plugins
To change this path, edit the ansible configuration file.
In addition, plugins can be shipped in a subdirectory relative to a top-level playbook, in folders named the same as indicated above.
.. seealso::
:doc:`modules`
List of built-in modules
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

View File

@ -0,0 +1,351 @@
Best Practices
==============
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest/
Here are some tips for making the most of Ansible.
You can find some example playbooks illustrating these best practices in our `ansible-examples repository <https://github.com/ansible/ansible-examples>`_.
.. contents::
:depth: 2
:backlinks: top
Content Organization
++++++++++++++++++++++
The following section shows one of many possible ways to organize content. Your usage of Ansible should fit your needs,
so feel free to modify this approach and organize as you see fit.
Directory Layout
````````````````
The top level of the directory would contain files and directories like so::
production # inventory file for production servers
stage # inventory file for stage environment
group_vars/
group1 # here we assign variables to particular groups
group2 # ""
host_vars/
hostname1 # if systems need specific variables, put them here
hostname2 # ""
site.yml # master playbook
webservers.yml # playbook for webserver tier
dbservers.yml # playbook for dbserver tier
common/ # this hierarchy represents a "role"
tasks/ #
main.yml # <-- tasks file can include smaller files if warranted
handlers/ #
main.yml # <-- handlers file
templates/ # <-- files for use with the template resource
ntp.conf.j2 # <------- templates end in .j2
files/ #
bar.txt # <-- files for use with the copy resource
webtier/ # same kind of structure as "common" was above, done for the webtier role
monitoring/ # ""
fooapp/ # ""
How to Arrange Inventory, Stage vs Production
`````````````````````````````````````````````
In this example, the *production* file contains the inventory of all of your production hosts. Of course you can pull inventory from an external
data source as well, but this is just a basic example. Define groups based on purpose of the host (roles) and also geography or datacenter location::
# file: production
[atlanta-webservers]
www-atl-1.example.com
www-atl-2.example.com
[boston-webservers]
www-bos-1.example.com
www-bos-2.example.com
[atlanta-dbservers]
db-atl-1.example.com
db-atl-2.example.com
[boston-dbservers]
db-bos-1.example.com
# webservers in all geos
[webservers:children]
atlanta-webservers
boston-webservers
# dbservers in all geos
[dbservers:children]
atlanta-dbservers
boston-dbservers
# everything in the atlanta geo
[atlanta:children]
atlanta-webservers
atlanta-dbservers
# everything in the boston geo
[boston:children]
boston-webservers
boston-dbservers
Group And Host Variables
````````````````````````
Now, groups are nice for organization, but that's not all groups are good for. You can also assign variables to them! For instance, atlanta
has it's own NTP servers, so when settings up ntp.conf, we should use them. Let's set those now::
---
# file: group_vars/atlanta
ntp: ntp-atlanta.example.com
backup: backup-atlanta.example.com
Variables aren't just for geographic information either! Maybe the webservers have some configuration that doesn't make sense for the database
servers::
---
# file: group_vars/webservers
apacheMaxRequestsPerChild: 3000
apacheMaxClients: 900
If we had any default values, or values that were universally true, we would put them in a file called group_vars/all::
---
# file: group_vars/all
ntp: ntp-boston.example.com
backup: backup-boston.example.com
We can define specific hardware variance in systems in a host_vars file, but avoid doing this unless you need to::
---
# file: host_vars/db-bos-1.example.com
foo_agent_port: 86
bar_agent_port: 99
Top Level Playbooks Are Seperated By Role
`````````````````````````````````````````
In site.yml, we include a playbook that defines our entire infrastructure. Note this is SUPER short, because it's just including
some other playbooks. Remember playbooks are nothing more than lists of plays::
---
# file: site.yml
- include: webservers.yml
- include: dbservers.yml
In a file like webservers.yml (also at the top level), we simply map the configuration of the webservers group to the roles performed by the webservers group. Also notice this is incredibly short. For example::
---
# file: webservers.yml
- hosts: webservers
tasks:
- include: common/tasks/main.yml tags=common
- include: webtier/tasks/main.yml tags=webtier
handlers:
- include: common/handlers/main.yml
- include: webtier/handlers/main.yml
Task And Handler Organization For A Role
````````````````````````````````````````
This file is just mapping hosts to the roles they fulfill. Now, below is an example tasks file, that explains how a role works. Our common role here just sets up NTP, but it could do more if we wanted::
---
# file: common/tasks/main.yml
- name: be sure ntp is installed
yum: pkg=ntp state=installed
tags: ntp
- name: be sure ntp is configured
template: src=common/templates/ntp.conf.j2 dest=/etc/ntp.conf
notify:
- restart ntpd
tags: ntp
- name: be sure ntpd is running and enabled
service: name=ntpd state=running enabled=yes
tags: ntp
Here is an example handlers file. As a review, handlers are only fired when certain tasks report changes, and are run at the end
of each play::
---
# file: common/handlers/main.yml
- name: restart ntpd
service: name=ntpd state=restarted
What This Organization Enables (Examples)
`````````````````````````````````````````
So that's our basic organizational structure.
Now what sort of use cases does this layout enable? Lots! If I want to reconfigure my whole infrastructure, it's just::
ansible-playbook -i production site.yml
What about just reconfiguring NTP on everything? Easy.::
ansible-playbook -i production site.yml --tags ntp
What about just reconfiguring my webservers?::
ansible-playbook -i production webservers.yml
What about just my webservers in Boston?::
ansible-playbook -i production webservers.yml --limit boston
What about just the first 10, and then the next 10?::
ansible-playbook -i production webservers.yml --limit boston[0-10]
ansible-playbook -i production webservers.yml --limit boston[10-20]
And of course just basic ad-hoc stuff is also possible.::
ansible -i production -m ping
ansible -i production -m command -a '/sbin/reboot' --limit boston
And there are some useful commands (at least in 1.1 to know)::
# confirm what task names would be run if I ran this command and said "just ntp tasks"
ansible-playbook -i production webservers.yml --tags ntp --list-tasks
# confirm what hostnames might be communicated with if I said "limit to boston"
ansible-playbook -i production webservers.yml --limit boston --list-hosts
Deployment vs Configuration Organization
````````````````````````````````````````
The above setup models a typical OS configuration topology. When doing multi-tier deployments, there are going
to be some additional playbooks that hop between tiers to roll out an application. In this case, 'site.yml'
may be augmented by playbooks like 'deploy_exampledotcom.yml' but the general concepts can still apply.
Ansible allows you to deploy and configure using the same tool, so you would likely reuse groups and just
keep the OS configuration in seperate playbooks from the app deployment.
Stage vs Production
+++++++++++++++++++
As also mentioned above, a good way to keep your stage (or testing) and production environments seperate is to use a seperate inventory file for stage
and production. This way you pick with -i what you are targetting. Keeping them all in one file can lead to surprises!
Testing things in a stage environment before trying in production is always a great idea. Your environments need not be the same
size and you can use group variables to control the differences between those environments.
Rolling Updates
+++++++++++++++
Understand the 'serial' keyword. If updating a webserver farm you really want to use it to control how many machines you are
updating at once in the batch.
Always Mention The State
++++++++++++++++++++++++
The 'state' parameter is optional to a lot of modules. Whether 'state=present' or 'state=absent', it's always best to leave that
parameter in your playbooks to make it clear, especially as some modules support additional states.
Group By Roles
++++++++++++++
A system can be in multiple groups. See :doc:`patterns`. Having groups named after things like
*webservers* and *dbservers* is repeated in the examples because it's a very powerful concept.
This allows playbooks to target machines based on role, as well as to assign role specific variables
using the group variable system.
Operating System and Distribution Variance
++++++++++++++++++++++++++++++++++++++++++
When dealing with a parameter that is different between two different operating systems, the best way to handle this is
by using the group_by module.
This makes a dynamic group of hosts matching certain criteria, even if that group is not defined in the inventory file::
---
# talk to all hosts just so we can learn about them
- hosts: all
tasks:
- group_by: key=${ansible_distribution}
# now just on the CentOS hosts...
- hosts: CentOS
gather_facts: False
tasks:
- # tasks that only happen on CentOS go here
If group specific settings are needed, this can also be done, for example::
---
# file: group_vars/all
asdf: 10
---
# file: group_vars/CentOS
asdf: 42
In the above example, CentOS machines get the value of '42' for asdf, but other machines get 10.
Bundling Ansible Modules With Playbooks
+++++++++++++++++++++++++++++++++++++++
.. versionadded:: 0.5
If a playbook has a "./library" directory relative to it's YAML file, this directory can be used to add ansible modules that will
automatically be in the ansible module path. This is a great way to keep modules that go with a playbook together.
Whitespace and Comments
+++++++++++++++++++++++
Generous use of whitespace to break things up, and use of comments (which start with '#'), is encouraged.
Always Name Tasks
+++++++++++++++++
It is possible to leave off the 'name' for a given task, though it is recommended to provide a description
about why something is being done instead. This name is shown when the playbook is run.
Keep It Simple
++++++++++++++
When you can do something simply, do something simply. Do not reach
to use every feature of Ansible together, all at once. Use what works
for you. For example, you should probably not need 'vars',
'vars_files', 'vars_prompt' and '--extra-vars' all at once,
while also using an external inventory file.
Version Control
+++++++++++++++
Use version control. Keep your playbooks and inventory file in git
(or another version control system), and commit when you make changes
to them. This way you have an audit trail describing when and why you
changed the rules automating your infrastructure.
.. seealso::
:doc:`YAMLSyntax`
Learn about YAML syntax
:doc:`playbooks`
Review the basic playbook features
:doc:`modules`
Learn about available modules
:doc:`moduledev`
Learn how to extend Ansible by writing your own modules
:doc:`patterns`
Learn about how to select hosts
`Github examples directory <https://github.com/ansible/ansible/tree/devel/examples/playbooks>`_
Complete playbook files from the github project source
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups

101
docsite/rst/contrib.rst Normal file
View File

@ -0,0 +1,101 @@
Ansible Resources
=================
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
User contributed playbooks, modules, and articles. This is a small
curated list, but growing. Everyone is encouraged to add to this
document, just send in a github pull request to docsite/rst/contrib.rst!
Ansible Modules
```````````````
Ansible modules are a way of adding new client-side logic to ansible.
They can be written in any language. Generally our goal is to include most modules in core ("batteries included!"),
though a few may remain outside of core depending on use cases and implementations.
- `Official "core" ansible modules <http://ansible.cc/docs/modules.html>`_ - various
- `Linode <https://github.com/lextoumbourou/ansible-linode>`_ - Lex Toumbourou
- `zypper (bash module example) <https://github.com/jpmens/ansible-zypp>`_ - jp\_mens
- `additional provisioning-related modules <https://github.com/ansible-provisioning>`_ - jhoekx and dagwieers
- `dynamic dns updates <https://github.com/jpmens/ansible-m-dnsupdate>`_ - jp\_mens
All python modules should use the common "AnsibleModule" class to dramatically reduce the amount of boilerplate code required.
Not all modules above may take advantage of this feature. See the official documentation for more details.
Selected Playbooks
``````````````````
`Playbooks <http://ansible.cc/docs/playbooks.html>`_ are Ansible's
configuration management language. It should be easy to write your own
from scratch for most applications, but it's always helpful to look at
what others have done for reference.
- `Hadoop <https://github.com/jkleint/ansible-hadoop>`_ - jkleint
- `LAMP <https://github.com/fourkitchens/server-playbooks>`_ - `Four Kitchens <http://fourkitchens.com>`_
- `LEMP <https://github.com/francisbesset/ansible-playbooks>`_ - francisbesset
- `Ganglia (demo) <https://github.com/mpdehaan/ansible-examples>`_ - mpdehaan
- `Nginx <http://www.capsunlock.net/2012/04/ansible-nginx-playbook.html>`_ - cocoy
- `OpenStack <http://github.com/lorin/openstack-ansible>`_ - lorin
- `Systems Configuration <https://github.com/cegeddin/ansible-contrib>`_ - cegeddin
- `Fedora Infrastructure <http://infrastructure.fedoraproject.org/cgit/ansible.git/tree/>`_ - `Fedora <http://fedoraproject.org>`_
Callbacks and Plugins
`````````````````````
The Ansible project has a whole repo devoted to extending ansible with
new connection types, logging/event callbacks, and inventory data
storage. Talk to Cobbler and EC2, tweak the way things are logged, or
even add sound effects.
- `Ansible-Plugins <https://github.com/ansible/ansible/tree/devel/plugins>`_
Scripts And Misc
````````````````
Ansible isn't just a program, it's also an API. Here's some examples of
some clever integrations with the "Runner" and also Playbook APIs, and
integrations with other interesting pieces of software.
- `Ansible Vagrant plugin <https://github.com/dsander/vagrant-ansible>`_ - dsander
- `Ansible+Vagrant Tutorial <https://github.com/mattupstate/vagrant-ansible-tutorial>`_ - mattupstate -
- `virt-install <http://fedorapeople.org/cgit/skvidal/public_git/scripts.git/tree/ansible/start-prov-boot.py>`_ - skvidal
- `rebooting hosts <http://fedorapeople.org/cgit/skvidal/public_git/scripts.git/tree/ansible/host-reboot>`_ - skvidal
- `uptime (API demo) <https://github.com/ansible/ansible/blob/devel/examples/scripts/uptime.py>`_ - mpdehaan
- `vim snippet generator <https://github.com/bleader/ansible_snippet_generator>`_ - bleader
Blogs, Videos & Articles
````````````````````````
- `HighScalability.com <http://highscalability.com/blog/2012/4/18/ansible-a-simple-model-driven-configuration-management-and-c.html>`_ - mpdehaan
- `ColoAndCloud.com interview <http://www.coloandcloud.com/editorial/an-interview-with-ansible-author-michael-dehaan/>`_ - mpdehaan
- `dzone <http://server.dzone.com/articles/ansible-cm-deployment-and-ad>`_ - Mitch Pronschinske
- `Configuration Management With Ansible <http://jpmens.net/2012/06/06/configuration-management-with-ansible/>`_ - jp\_mens
- `Shell Scripts As Ansible Modules <http://jpmens.net/2012/07/05/shell-scripts-as-ansible-modules/>`_ - jp\_mens
- `Ansible Facts <http://jpmens.net/2012/07/15/ansible-it-s-a-fact/>`_ - jp\_mens
- `Infrastructure as Data <http://www.capsunlock.net/2012/04/ansible-infrastructure-as-data-not-infrastructure-as-code.html>`_ - cocoy
- `Ansible Pull Mode <http://www.capsunlock.net/2012/05/using-ansible-pull-and-user-data-to-setup-ec2-or-openstack-servers.html>`_ - cocoy
- `Exploring Configuration Management With Ansible <http://palominodb.com/blog/2012/08/01/exploring-configuration-management-ansible>`_ - Palamino DB
- `You Should Consider Using SSH Based Configuration Management <http://www.lshift.net/blog/2012/07/30/you-should-consider-using-ssh-based-configuration-management>`_ - LShift Ltd
- `Deploying Flask/uWSGI, Nginx, and Supervisorctl <http://mattupstate.github.com/python/devops/2012/08/07/flask-wsgi-application-deployment-with-ubuntu-ansible-nginx-supervisor-and-uwsgi.html>`_ - mattupstate
- `Infracoders Presentation <http://www.danielhall.me/2012/10/ansible-talk-infra-coders/>`_ - Daniel Hall
- `Ansible - an introduction <https://speakerdeck.com/jpmens/ansible-an-introduction>`_ - jp\_mens
- `Using Ansible to setup complex networking - <http://exarv.nl/2013/02/using-ansible-to-setup-complex-networking/>`_ - Robert Verspuy
- `Video presentation to Montreal Linux <http://www.youtube.com/embed/up3ofvQNm8c>`_ - Alexandre Bourget
- `Provisioning CentOS EC2 Instances with Ansible <http://jpmens.net/2012/11/21/provisioning-centos-ec2-instances-with-ansible/>`_ - jp\_mens
Disclaimer
``````````
Modules and playbooks here may not be using the latest in Ansible
features. When in doubt to the features of a particular version of
Ansbile, always consult `ansible.cc <http://ansible.cc>`_ and in
particular see `Best Practices <http://ansible.cc/docs/bestpractices.html>`_ for some tips
and tricks that may be useful.
Ansible is (C) 2012, `Michael DeHaan <http://twitter.com/laserllama>`_
and others and is available under the GPLv3 license. Content here is as
specified by individual contributors.

269
docsite/rst/examples.rst Normal file
View File

@ -0,0 +1,269 @@
Command Line Examples And Next Steps
====================================
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
.. highlight:: bash
The following examples show how to use `/usr/bin/ansible` for running
ad hoc tasks. Start here.
For configuration management and deployments, you'll want to pick up on
using `/usr/bin/ansible-playbook` -- the concepts port over directly.
(See :doc:`playbooks` for more information about those)
.. contents::
:depth: 2
:backlinks: top
Parallelism and Shell Commands
``````````````````````````````
Let's use ansible's command line tool to reboot all web servers in Atlanta, 10 at a time. First, let's
set up SSH-agent so it can remember our credentials::
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
If you don't want to use ssh-agent and want to instead SSH with a
password instead of keys, you can with ``--ask-pass`` (``-k``), but
it's much better to just use ssh-agent.
Now to run the command on all servers in a group, in this case,
*atlanta*, in 10 parallel forks::
$ ansible atlanta -a "/sbin/reboot" -f 10
In 0.7 and later, this will default to running from your user account. If you do not like this
behavior, pass in "-u username". (In 0.6 and before, it defaulted to root. Most folks prefered
defaulting to the current user, so we changed it).
If you want to run commands as a different user, it looks like this::
$ ansible atlanta -a "/usr/bin/foo" -u username
If you want to run commands through sudo::
$ ansible atlanta -a "/usr/bin/foo" -u username --sudo [--ask-sudo-pass]
Use ``--ask-sudo-pass`` (``-K``) if you are not using passwordless
sudo. This will interactively prompt you for the password to use.
Use of passwordless sudo makes things easier to automate, but it's not
required.
It is also possible to sudo to a user other than root using
``--sudo-user`` (``-U``)::
$ ansible atlanta -a "/usr/bin/foo" -u username -U otheruser [--ask-sudo-pass]
Ok, so those are basics. If you didn't read about patterns and groups yet, go back and read :doc:`patterns`.
The ``-f 10`` in the above specifies the usage of 10 simultaneous
processes. Normally commands also take a ``-m`` for module name, but
the default module name is 'command', so we didn't need to
specify that all of the time. We'll use ``-m`` in later examples to
run some other :doc:`modules`.
.. note::
The :ref:`command` module requires absolute paths and does not
support shell variables. If we want to execute a module using a
shell, we can do those things, and also use pipe and redirection
operators. Read more about the differences on the :doc:`modules`
page.
Using the :ref:`shell` module looks like this::
$ ansible raleigh -m shell -a 'echo $TERM'
When running any command with the ansible *ad hoc* CLI (as opposed to
:doc:`playbooks`), pay particular attention to shell quoting rules, so
the shell doesn't eat a variable before it gets passed to Ansible.
For example, using double vs single quotes in the above example would
evaluate the variable on the box you were on.
So far we've been demoing simple command execution, but most Ansible modules usually do not work like
simple scripts. They make the remote system look like you state, and run the commands necessary to
get it there. This is commonly referred to as 'idempotence', and is a core design goal of ansible.
However, we also recognize that running *ad hoc* commands is equally important, so Ansible easily supports both.
File Transfer
`````````````
Here's another use case for the `/usr/bin/ansible` command line. Ansible can SCP lots of files to multiple machines in parallel.
To transfer a file directly to many different servers::
$ ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"
If you use playbooks, you can also take advantage of the ``template`` module,
which takes this another step further. (See module and playbook documentation).
The ``file`` module allows changing ownership and permissions on files. These
same options can be passed directly to the ``copy`` module as well::
$ ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600"
$ ansible webservers -m file -a "dest=/srv/foo/b.txt mode=600 owner=mdehaan group=mdehaan"
The ``file`` module can also create directories, similar to ``mkdir -p``::
$ ansible webservers -m file -a "dest=/path/to/c mode=644 owner=mdehaan group=mdehaan state=directory"
As well as delete directories (recursively) and delete files::
$ ansible webservers -m file -a "dest=/path/to/c state=absent"
Managing Packages
`````````````````
There are modules available for yum and apt. Here are some examples
with yum.
Ensure a package is installed, but don't update it::
$ ansible webservers -m yum -a "name=acme state=installed"
Ensure a package is installed to a specific version::
$ ansible webservers -m yum -a "name=acme-1.5 state=installed"
Ensure a package is at the latest version::
$ ansible webservers -m yum -a "name=acme state=latest"
Ensure a package is not installed::
$ ansible webservers -m yum -a "name=acme state=removed"
Currently Ansible only has modules for managing packages with yum and apt. You can install
for other packages for now using the command module or (better!) contribute a module
for other package managers. Stop by the mailing list for info/details.
Users and Groups
````````````````
The 'user' module allows easy creation and manipulation of
existing user accounts, as well as removal of user accounts that may
exist::
$ ansible all -m user -a "name=foo password=<crypted password here>"
$ ansible all -m user -a "name=foo state=absent"
See the :doc:`modules` section for details on all of the available options, including
how to manipulate groups and group membership.
Deploying From Source Control
`````````````````````````````
Deploy your webapp straight from git::
$ ansible webservers -m git -a "repo=git://foo.example.org/repo.git dest=/srv/myapp version=HEAD"
Since ansible modules can notify change handlers it is possible to
tell ansible to run specific tasks when the code is updated, such as
deploying Perl/Python/PHP/Ruby directly from git and then restarting
apache.
Managing Services
`````````````````
Ensure a service is started on all webservers::
$ ansible webservers -m service -a "name=httpd state=started"
Alternatively, restart a service on all webservers::
$ ansible webservers -m service -a "name=httpd state=restarted"
Ensure a service is stopped::
$ ansible webservers -m service -a "name=httpd state=stopped"
Time Limited Background Operations
``````````````````````````````````
Long running operations can be backgrounded, and their status can be
checked on later. The same job ID is given to the same task on all
hosts, so you won't lose track. If you kick hosts and don't want
to poll, it looks like this::
$ ansible all -B 3600 -a "/usr/bin/long_running_operation --do-stuff"
If you do decide you want to check on the job status later, you can::
$ ansible all -m async_status -a "jid=123456789"
Polling is built-in and looks like this::
$ ansible all -B 1800 -P 60 -a "/usr/bin/long_running_operation --do-stuff"
The above example says "run for 30 minutes max (``-B``: 30*60=1800),
poll for status (``-P``) every 60 seconds".
Poll mode is smart so all jobs will be started before polling will begin on any machine.
Be sure to use a high enough ``--forks`` value if you want to get all of your jobs started
very quickly. After the time limit (in seconds) runs out (``-B``), the process on
the remote nodes will be terminated.
Typically you'll be only be backgrounding long-running
shell commands or software upgrades only. Backgrounding the copy module does not do a background file transfer. :doc:`playbooks` also support polling, and have a simplified syntax for this.
Limiting Selected Hosts
```````````````````````
.. versionadded:: 0.7
What hosts you select to manage can be additionally constrained by using the '--limit' parameter or
by using 'batch' (or 'range') selectors.
As mentioned above, patterns can be strung together to select hosts in more than one group::
$ ansible webservers:dbservers -m command -a "/bin/foo xyz"
This is an "or" condition. If you want to further constrain the selection, use --limit, which
also works with ``ansible-playbook``::
$ ansible webservers:dbservers -m command -a "/bin/foo xyz" --limit region
Assuming version 0.9 or later, as with other host patterns, values to limit can be separated with ";", ":", or ",".
Now let's talk about range selection. Suppose you have 1000 servers in group 'datacenter', but only want to target one at a time. This is also easy::
$ ansible webservers[0-99] -m command -a "/bin/foo xyz"
$ ansible webservers[100-199] -m command -a "/bin/foo xyz"
This will select the first 100, then the second 100, host entries in the webservers group. (It does not matter
what their names or IP addresses are).
Both of these methods can be used at the same time, and ranges can also be passed to the --limit parameter.
Configuration & Defaults
````````````````````````
.. versionadded:: 0.7
Ansible has an optional configuration file that can be used to tune settings and also eliminate the need to pass various command line flags. Ansible will look for the config file in the following order, using
the first config file it finds present:
1. File specified by the ``ANSIBLE_CONFIG`` environment variable
2. ``ansible.cfg`` in the current working directory. (version 0.8 and up)
3. ``~/.ansible.cfg``
4. ``/etc/ansible/ansible.cfg``
For those running from source, a sample configuration file lives in the examples/ directory. The RPM will install configuration into /etc/ansible/ansible.cfg automatically.
.. seealso::
:doc:`modules`
A list of available modules
:doc:`playbooks`
Using ansible for configuration management & deployment
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

View File

@ -0,0 +1,320 @@
Getting Started
===============
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
.. contents::
:depth: 2
:backlinks: top
Requirements
````````````
Requirements for Ansible are extremely minimal.
Ansible is written for Python 2.6+. If you are running Python 2.5 on an "Enterprise Linux" variant, we'll show you how to add
2.6. Newer versions of Linux and OS X should already have 2.6 or higher.
In additon to Python 2.6+, you will want the following Python modules (installed via pip or perhaps via your OS package manager via slightly different names):
* ``paramiko``
* ``PyYAML``
* ``jinja2``
If you are using RHEL or CentOS 5 , python is version 2.4 by default, but you can get python 2.6 installed easily. `Use EPEL <http://fedoraproject.org/wiki/EPEL>`_ and install these dependencies as follows:
.. code-block:: bash
$ yum install python26 python26-PyYAML python26-paramiko python26-jinja2
On the managed nodes, you only need Python 2.4 or later, but if you are are running less than Python 2.6 on them, you will
also need:
* ``python-simplejson``
.. note::
Ansible's "raw" module (for executing commands in a quick and dirty
way) and the script module don't even need that. So technically, you can use
Ansible to install python-simplejson using the raw module, which
then allows you to use everything else. (That's jumping ahead
though.)
.. note::
Python 3 is a slightly different language than Python 2 and most python programs (including
Ansible) are not
switching over yet. However, some Linux distributions (Gentoo, Arch) may not have a
Python 2.X interpreter installed by default. On those systems, you should install one, and set
the 'ansible_python_interpreter' variable in inventory to point at your 2.X python. Distributions
like Red Hat Enterprise Linux, CentOS, Fedora, and Ubuntu all have a 2.X interpreter installed
by default and this does not apply to those distributions. This is also true of nearly all
Unix systems. If you need to bootstrap these remote systems by installing Python 2.X,
using the 'raw' module will be able to do it remotely.
Getting Ansible
```````````````
If you are interested in using all the latest features, you may wish to keep up to date
with the development branch of the git checkout. This also makes it easiest to contribute
back to the project.
Instructions for installing from source are below.
Ansible's release cycles are about one month long. Due to this
short release cycle, any bugs will generally be fixed in the next release versus maintaining
backports on the stable branch.
You may also wish to follow the `Github project <https://github.com/ansible/ansible>`_ if
you have a github account. This is also where we keep the issue tracker for sharing
bugs and feature ideas.
Running From Checkout
+++++++++++++++++++++
Ansible is trivially easy to run from a checkout, root permissions are not required
to use it:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ source ./hacking/env-setup
You can optionally specify an inventory file (see :doc:`patterns`) other than /etc/ansible/hosts:
.. code-block:: bash
$ echo "127.0.0.1" > ~/ansible_hosts
$ export ANSIBLE_HOSTS=~/ansible_hosts
You can read more about the inventory file in later parts of the manual.
Now let's test things:
.. code-block:: bash
$ ansible all -m ping --ask-pass
Make Install
++++++++++++
If you are not working from a distribution where Ansible is packaged yet, you can install Ansible
using "make install". This is done through `python-distutils`:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ sudo make install
Via Pip
+++++++
Are you a python developer?
Ansible can be installed via Pip, but when you do so, it will ask to install other dependencies used for
optional modes::
$ sudo easy_install pip
$ sudo pip install ansible
Readers that use virtualenv can also install Ansible under virtualenv. Do not use easy_install to install
ansible directly.
Via RPM
+++++++
RPMs for the last Ansible release are available for `EPEL
<http://fedoraproject.org/wiki/EPEL>`_ 6 and currently supported
Fedora distributions. Ansible itself can manage earlier operating
systems that contain python 2.4 or higher.
If you are using RHEL or CentOS and have not already done so, `configure EPEL <http://fedoraproject.org/wiki/EPEL>`_
.. code-block:: bash
# install the epel-release RPM if needed on CentOS, RHEL, or Scientific Linux
$ sudo yum install ansible
You can also use the ``make rpm`` command to build an RPM you can distribute and install.
Make sure you have ``rpm-build``, ``make``, and ``python2-devel`` installed.
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/ansible-*.noarch.rpm
Python 2.6 EPEL instructions for RHEL and CentOS 5
``````````````````````````````````````````````````
These distributions don't have Python 2.6 by default, but it is easily
installable.
.. code-block:: bash
Via MacPorts
++++++++++++
An OSX port is available via MacPorts, to install the stable version of
Ansible from MacPorts (this is the recommended way), run:
.. code-block:: bash
$ sudo port install ansible
If you wish to install the latest build via the MacPorts system from a
git checkout, run:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible/packaging/macports
$ sudo port install
Please refer to the documentation at <http://www.macports.org> for
further information on using Portfiles with MacPorts.
Ubuntu and Debian
+++++++++++++++++
Ubuntu builds are available `in a PPA here <https://launchpad.net/~rquillo/+archive/ansible>`_
Debian/Ubuntu package recipes can also be built from the source checkout, run:
.. code-block:: bash
$ make debian
Gentoo, Arch, Others
++++++++++++++++++++
Gentoo eBuilds are in portage, version 1.0 `coming soon <https://bugs.gentoo.org/show_bug.cgi?id=461830>`_.
.. code-block:: bash
$ emerge ansible
An Arch PKGBUILD is available on `AUR <https://aur.archlinux.org/packages.php?ID=58621>`_
If you have python3 installed on Arch, you probably want to symlink python to python2:
.. code-block:: bash
$ sudo ln -sf /usr/bin/python2 /usr/bin/python
You should also set a 'ansible_python_interpreter' inventory variable for hosts that have python
pointing to python3, so the right python can be found on the managed nodes.
Tagged Releases
+++++++++++++++
Tarballs of releases are available on the ansible.cc page.
* `Ansible/downloads <https://ansible.cc/releases>`_
These releases are also tagged in the git repository with the release version.
Choosing Between Paramiko and Native SSH
````````````````````````````````````````
By default, ansible uses paramiko to talk to managed nodes over SSH. Paramiko is fast, works
very transparently, requires no configuration, and is a good choice for most users.
However, it does not support some advanced SSH features that folks will want to use.
.. versionadded:: 0.5
If you want to leverage more advanced SSH features (such as Kerberized
SSH or jump hosts), pass the flag "--connection=ssh" to any ansible
command, or set the ANSIBLE_TRANSPORT environment variable to
'ssh'. This will cause Ansible to use openssh tools instead.
If ANSIBLE_SSH_ARGS are not set, ansible will try to use some sensible ControlMaster options
by default. You are free to override this environment variable, but should still pass ControlMaster
options to ensure performance of this transport. With ControlMaster in use, both transports
are roughly the same speed. Without CM, the binary ssh transport is signficantly slower.
If none of this makes sense to you, the default paramiko option is probably fine.
Your first commands
```````````````````
Now that you've installed Ansible, it's time to test it.
Edit (or create) /etc/ansible/hosts and put one or more remote systems in it, for
which you have your SSH key in ``authorized_keys``::
192.168.1.50
aserver.example.org
bserver.example.org
Set up SSH agent to avoid retyping passwords:
.. code-block:: bash
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
(Depending on your setup, you may wish to ansible's --private-key option to specify a pem file instead)
Now ping all your nodes:
.. code-block:: bash
$ ansible all -m ping
Ansible will attempt to remote connect to the machines using your current
user name, just like SSH would. To override the remote user name, just use the '-u' parameter.
If you would like to access sudo mode, there are also flags to do that:
.. code-block:: bash
# as bruce
$ ansible all -m ping -u bruce
# as bruce, sudoing to root
$ ansible all -m ping -u bruce --sudo
# as bruce, sudoing to batman
$ ansible all -m ping -u bruce --sudo --sudo-user batman
(The sudo implementation is changeable in ansbile's configuration file if you happen to want to use a sudo
replacement. Flags passed dot sudo can also be set.)
Now run a live command on all of your nodes:
.. code-block:: bash
$ ansible all -a "/bin/echo hello"
Congratulations. You've just contacted your nodes with Ansible. It's
now time to read some of the more real-world :doc:`examples`, and explore
what you can do with different modules, as well as the Ansible
:doc:`playbooks` language. Ansible is not just about running commands, it
also has powerful configuration management and deployment features. There's more to
explore, but you already have a fully working infrastructure!
.. seealso::
:doc:`examples`
Examples of basic commands
:doc:`playbooks`
Learning ansible's configuration management language
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

430
docsite/rst/glossary.rst Normal file
View File

@ -0,0 +1,430 @@
Glossary
========
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
The following is a list (and re-explanation) of term definitions used elsewhere in the Ansible documentation.
Consult the documentation home page for the full documentation and to see this in context, but this should be a good resource
to check you know all of components of ansible and how they fit together. It's something you might wish to read for review or
when a term comes up on the mailing list.
See the main documentation if you are looking for examples to put all of this into context.
Action
++++++
An action is a part of ref:`task` that says what ref:`module` to run and what arguments to pass to that module. Each task can
have only one action, but it may also have other parameters.
Ad Hoc
++++++
Refers to running ansible to do some quick command, using /usr/bin/ansible, rather than the orchestration language, which is
/usr/bin/ansible-playbook. An example of an ad-hoc command might be rebooting 50 machines in your infrastructure. Anything
you can do ad-hoc you can do by writing a playbook, and playbooks can also glue lots of other operations together.
Async
+++++
Refers to a task that is configured to run in the background rather than waiting for completion. If you have a long process
that would run longer than the SSH timeout, it would make sense to launch that task in async mode. Async modes can poll
for completion every so many seconds, or can be configured to "fire and forget" in which case ansible will not even
check on the task again, it will just kick it off and proceed to future steps. Async modes work with both /usr/bin/ansible
and /usr/bin/ansible-playbook.
Callback Plugin
+++++++++++++++
Refers to some user-written code that can intercept the results from Ansbile and do something with it. Some supplied examples
in the github project perform custom logging, send email, or even play sound effects.
Check Mode
++++++++++
Refers to running ansible with --check, which does not make any changes on the remote systems, but only alerts what changes
might occur if run without --check. This is analogous to so-called "dry run" mode in other systems, though the user should
be warned that this does not take into account unexpected command failures or cascade effects (nor do those modes in other
systems). Use this to get an idea what might happen, but is not a substitute for a good staging environment.
Connection Type, Connection Plugin
++++++++++++++++++++++++++++++++++
Ansible by default talks to remote machines over SSH using a library called 'paramiko'. It also supports using native OpenSSH,
which if you have a new-enough open SSH, is equally fast, but also enables some features like Kereberos and jump hosts. This is
govered in the getting started section. There are also other connection types like 'fireball' mode, which must be bootstrapped
over SSH but is very fast, and local mode, which acts on the local system. Users can also write their own connection plugins.
Conditionals
++++++++++++
A conditional is an expression that evaluates to true or false that decides whether a given task will be executed on a given
machine or not. Ansible's conditionals include 'only_if', and the syntactically superior alternatives 'when_boolean',
'when_string', and 'when_integer'. These are discussed in the playbook documentation.
Diff Mode
+++++++++
A --diff flag can be passed to ansible to show how template files change when they are overwritten, or how they might change when used
with --check mode. These diffs come out in unified diff format.
Facts
+++++
Facts are simply things that are discovered about remote nodes. While they can be used in playbooks and templates just like variables, facts
are things that are inferred, rather than set. Facts are discovered automatically by ansible when running plays by running the internal 'setup'
module on the remote nodes. You never have to call the setup module explicitly, it just runs, but it can be disabled to save time if it is
not needed. For convience of users switching from other config systems, the fact module will also pull in facts from the 'ohai' and 'facter'
tools if they are installed, which are fact libraries from Chef and Puppet, respectfully.
Filter Plugin
+++++++++++++
A filter plugin is something that most users will never need to understand to use at all. These allow creation of new Jinja2 filters, which
are more of less only of use to people who know what Jinja2 filters are. If you need them, you can learn how to write them in the API
docs section.
Fireball Mode
+++++++++++++
By default Ansible uses SSH for connections -- either Paramiko (the actual default) or a common alternative, native Open SSH. Some users
may want to execute operations even faster though, and they can if they opt in on running an ephmeral message bus. What happens is Ansible
will start talking to a node over SSH, and then set up a temporary secured message bus good only to talk from one machine, that will
self destruct after a set period of time. This means the bus does not allow management of any kind after the time interval has expired.
Forks
+++++
Ansible talks to remote nodes in parallel, the level of parallelism can be set either by passing --forks, or editing the default in a configuration
file. The default is a very conservative 5 forks, though if you have a lot of RAM, you can easily set this to a value like 50 for increased
parallelism.
Gather Facts (Boolean)
++++++++++++++++++++++
Facts are mentioned above. Sometimes in running a multi-play playbook it is deseriable to have some plays that don't bother with fact
computation as they aren't going to need any values from facts. Setting `gather_facts: False` on a playbook allows this implicit
fact gathering to be skipped.
Globbing
++++++++
Globbing is a way to select lots of hosts based on wildcard, rather than the name of the host specifically, or the name of the group
they are in. For instance, it is possible to select "www*" to match all hosts starting with "www". This concept is pulled directly
from Func, one of Michael's earlier projects. In addition to basic globbing, various set operations are also possible, such as
hosts in this group and not in another group, and so on.
Group
+++++
A group consists of several hosts assigned to a pool that can be targetted conviently together, and also given variables that they share in
common.
Group Vars
++++++++++
The "group_vars/" files are files that live in a directory alongside an inventory file, with an optional filename named after each group.
This is a convient place to put variables that will be provided to a given group, especially complex datastructures, so that these
variables do not have to be embedded in the inventory file or playbook.
Handlers
++++++++
Handlers are just like regular tasks in an ansible playbok (see Tasks), but are only run if the Task contains a "notify" directive and
also indicates that it changed something. An example is if a config file is changed, the task referencing the config file templating
operation may notify a service restart handler when it changes. This means services can be bounced only if they need to be restarted.
Handlers can be used for things other than service restarts, but service restarts are the most common usage.
Host
++++
A host is simply a remote machine that ansible manages. They can have individual variables assigned to them, and can also be organized
in groups. All hosts have a name they can be reached at (which is either an IP address or a domain name) and optionally a port number,
if they are not to be accessed on the default SSH port.
Host Specifier
++++++++++++++
Each Play in Ansbile maps a series of tasks (which define the role, purpose, or orders of a system) to a set of systems.
This "hosts:" directive in each play is often called the hosts specifier.
It may select one system, many systems, one or more groups, or even some hosts that in one group and explicitly not in another.
Host Vars
+++++++++
Just like "Group Vars", a directory alongside the inventory file named "host_vars/" can contain a file named after each hostname in
the inventory file, in YAML format. This provides a convient place to assign variables to the host without having to embed
them in the inventory file. The Host Vars file can also be used to define complex datastructures that can't be represented in the
inventory file.
Lazy Evalution
++++++++++++++
In general Ansible evaluates any variables in playbook content at the last possible second, which means that if you define a datastructure
that datastructure itself can define variable values within it, and everything "just works" as you would expect. This also means variable
strings can include other variables inside of those strings.
Lookup Plugin
+++++++++++++
A lookup plugin is a way to get data into Ansible from the outside world. These are how such things as "with_items" are implemented, which is a
basic looping plugin, but there are also things like "with_file" which loads data from a file, and even things for querying environment variables,
DNS text records, or key value stores. Lookup plugins can also be accessed in templates using an all caps form, such as the contents of a file
on the local machine can be accessed like ``$FILE(/path/to/file)``.
Multi-Tier
++++++++++
The concept that IT systems are not managed one system at a time, but by interactions between multiple systems, and groups of systems, in
well defined orders. For instance, a web server may need to be updated before a database server, and pieces on the web server may need
to be updated after *THAT* database server, and various load balancers and monitoring servers may need to be contacted. Ansible models
entire IT topologies and workflows rather than looking at configuration in a "one system at a time" perspective.
Idempotency
+++++++++++
The concept that change commands should only be applied when they need to be applied, and that it is better to describe the desired
state of a system than the process of how to get to that state. As an analogy, the path from North Carolina in the United States to
California involves driving a very long way West, but if I were instead in Anchorage, Alaska, driving a long ways west is no longer
the right way to get to California. Ansible's Resources like you to say "put me in California" and then decide how to get there. If
you were already in California, nothing needs to happen, and it will let you know it didn't need to change anything.
Includes
++++++++
The idea that playbook files (which are nothing more than list of plays) can include other lists of plays, and task lists
can externalize lists of tasks in other files, and similarly with handlers. Includes can be parameterized, which means that the
loaded file can pass variables. For instance, an included play for setting up a wordpress blog may take a parameter called "user"
and thant play could be included more than once to create a blog for both "alice" and "bob".
Inventory
+++++++++
A file (by default, Ansible uses a simple INI format) that describes Hosts and Groups in Ansible. Inventory can also be provided
via an "Inventory Script" (sometimes called an "External Inventory Script").
Inventory Script
++++++++++++++++
A very simple program (or a complicated one) that looks up hosts, group membership for hosts, and variable information from an external
resource -- whether that be a SQL database, a CMDB solution, or something like LDAP. This concept was adapted from Puppet (where it is
called an "External Nodes Classifier") and works more or less exactly the same way.
Jinja2
++++++
Jinja2 is the preferred templating language of Ansbile's template module. It is a very simple Python template language that is generally
readable and easy to write.
JSON
++++
Ansible uses JSON for return data from remote modules. This allows modules to be written in any language, not just Python.
only_if
+++++++
A conditional statement that decides if a task is going to be executed in a playbook based on whether if the following expression
given is true or false. The newer 'when_' statements provide a cleaner way to express conditionals, 'only_if' is an older
construct. Though it may be still be useful in advanced situations.
Library
+++++++
A collection of modules made availabe to /usr/bin/ansible or an ansible playbook.
Limit Groups
++++++++++++
By passing "--limit somegroup" to ansible or ansible playbook, the commands can be limited to a subset of hosts. For instance,
this can be used to run a playbook that normally targets an entire set of servers to one particular server.
Local Connection
++++++++++++++++
By using "connection: local" in a playbook, or "-c local" to /usr/bin/ansible, this indicates that we are managing the local
host and not a remote machine.
Local Action
++++++++++++
A local_action directive in a playbook targetting remote machines means that the given step will actually occur on local
machine, but that the variable '$ansible_hostname' can be passed in to reference the remote hostname being referred to in
that step. This can be used to trigger, for example, an rsync operation.
Loops
+++++
Generally Ansible is not a programming language, it prefers to be more declarative, though various constructs like "with_items"
allow a particular task to be repeated for multiple items in a list. Certain modules, like yum and apt, are actually optimized
for this, and can install all packages given in those lists within a single transaction, dramatically speaking up total
time to configuration.
Modules
+++++++
Modules are the units of work that Ansible ships out to remote machines. Modules are kicked off by either /usr/bin/ansible or
/usr/bin/ansible-playbook (where multiple tasks use lots of different modules in conjunction). Modules can be implemented in any
language including Perl, Bash, or Ruby -- but can leverage some useful communal library code if written in Python. Modules just
have to return JSON or simple key=value pairs. Once modules are executed on remote machines, they are removed, so no long running
daemons are used. Ansible refers to the collection of available modules as a 'library'.
Notify
++++++
The act of a task registering a change event and informing a handler task that another action needs to be run at the end of the play.
If a handler is notified by multiple tasks, it will still be run only once. Handlers are run in the order they are listed, not
in the order that they are notified.
Orchestration
+++++++++++++
Many software automation systems use this word to mean different things. Ansible uses it as a conductor would conduct an orchestra.
A datacenter or cloud architecture is full of many systems, playing many parts -- web servers, database servers, maybe load balancers,
monitoring systems, continuous integration systems, etc. In performing any process, it is neccessary to touch systems in particular orders,
often to simulate rolling updates or deploy software correctly. Some system may perform some steps, then others, then previous systems
already processed may need to perform more steps. Along the way, email may need to be sent or web services contacted. Ansible
orchestration is all about modelling that kind of process.
Paramiko
++++++++
Ansible by default manages machines over SSH. The library that ansible uses by default to do this is a python-powered library called
Paramiko. Paramiko is generally fast and easy to manage, though users desiring Kerberos or Jump Host support may wish to switch
to the native SSH connection type, by specifying the connection type in their playbook or using the "-c ssh" flag.
Playbooks
+++++++++
Playbooks are the language by which Ansible orchestrates, configures, administers, or deploys systems. They are called playbooks partially because it's a sports analogy, and it's supposed to be fun using them. They aren't workbooks :)
Plays
+++++
A playbook is a list of plays. A play is minimally a mapping between a set of hosts (usually chosen by groups, but sometimes my hostname
globs), selected by a host specifier -- and the tasks which run on those hosts to define the role at which those systems will perform. There
can be one or many plays in a playbook.
Pull Mode
+++++++++
Ansible by default runs in push mode, which allows it very fine grained control over when it talks to what kinds of systems. Pull mode is
provided for when you would rather have nodes check in every N minutes on a particular schedule. It uses a program called ansible-pull and can also be set up (or reconfigured) using a push-mode playbook. Most ansible users use push mode, but it is included for variety and the sake
of having choices.
ansible-pull works by checking configuration orders out of git on a crontab and then managing the machine locally, using the local
connection plugin.
Push Mode
+++++++++
Push mode is the default mode of ansible, in fact, it's not really a mode at all -- it's just how ansible works when you aren't
thinking about it. Push mode allows ansible to be fine grained and conduct nodes in complex orchestration processes without
waiting for them to check in.
Register Variable
+++++++++++++++++
The result of running any task in ansible can be stored in a variable for use in a template or a conditional statement.
The keyword used to name the variable to use is called 'register', taking it's name from the idea of registers in assembly
programming, though Ansible will never feel like assembly programming. There are an infinite number of variable names
you can use for registration.
Resource Model
++++++++++++++
Ansible modules work in terms of resources. For instance the file module will select a particular file, say, /etc/motd
and ensure that attributes of that resource match a particular model, for instance, we might wish to set the ownership
to 'root' if not already set to root, or set the mode to '0644' if not already set to '0644'. The resource models
are 'idempotent' meaning change commands are not run unless needed, and ansible will bring the system back to a desired
state regardless of the actual state -- rather than you having to tell it how to get to the state.
Rolling Update
++++++++++++++
The act of addressing a number of nodes in a group N at a time to avoid updating them all at once and bringing the system
offline. For instance, in a web topology of 500 nodes handling very large volume, it may be reasonable to update 10 or 20
machines at a time, moving on to the next 10 or 20 when done. The "serial:" keyword in an ansible playbook controls the
size of the rolling update pool. The default is to address the batch size all at once, so this is something that you must
opt-in to. OS configuration (such as making sure config files are correct) does not typically have to use the rolling update
model, but can if desired.
Runner
++++++
A core software component of ansible that is the power behind /usr/bin/ansible directly -- and corresponds to the invocation
of each task in a playbook. The Runner is something ansible developers may talk about, but it's not really userland
vocabulary.
Serial
++++++
See "Rolling Update".
Sudo
++++
Ansible does not require root logins, and since it's daemonless, definitely does not require root level daemons (which can
be a security concern in sensitive environments). Ansible can log in and perform many operations wrapped in a sudo command,
and can work with both passwordless and passworded sudo. Some operations that don't normally work with sudo (like scp
file transfer) can be achieved with Ansible's copy, template, and fetch resources while running in sudo mode.
SSH (Native)
++++++++++++
Ansible by default uses Paramiko. Native openssh is specified with "-c ssh" (or a config file, or a directive in the playbook)
and can be useful if wanting to login via Kerberized SSH or use SSH jump hosts, etc. Using a client that supports ControlMaster
and ControlPersist is recommended for maximum performance -- if you don't have that and don't need Kerberos, jump hosts, or other
features, paramiko (the default) is a fine choice. Ansible will warn you if it doesn't detect ControlMaster/ControlPersist capability.
Tags
++++
Ansbile allows tagging resources in a playbook with arbitrary keywords, and then running only the parts of the playbook that
correspond to those certain keywords. For instance, it is possible to have an entire OS configuration, and have certain steps
labelled "ntp", and then run just the "ntp" steps to reconfigure the time server information on a remote server.
Tasks
+++++
Playbooks exist to run tasks. Tasks combine an action (a module combined with what variables to pass) with a name and optionally some other keywords (like looping directives). Handlers are also Tasks, but they are a special kind of task that do not run unless they are notified by name when a task reports an underlying change on a remote system.
Templates
+++++++++
Ansible can easily transfer remote files to remote systems, but often it is desirable to substitute variables in other files. Variables
may come from the inventory file, Host Vars, Group Vars, or Facts -- templates use the Jinja2 template engine and can also include logical
constructs like loops and if statements.
Transport
+++++++++
Ansible uses "Connection Plugins" to define types of available transports. These are simply how ansible will reach out to managed systems. Transports included are paramiko (the default SSH transport), SSH (using openssh), fireball (an SSH bootstrapped accelerated connection plugin), and local.
When
++++
When statements (when_string, when_changed, when_boolean, when_integer, etc) are easier to write forms of the only_if conditional. They can be affixed to any task to make that task decide to run only when an expression involving variables or facts is actually true.
Van Halen
+++++++++
For no particular reason other than Michael really likes them, all Ansible releases are code named after Van Halen songs. There is no preference given to David Lee Roth vs Sammy Lee Hagar era songs, and instrumentals are also allowed. It is unlikely there will never be a Jump release, but it may be there is going to be a Van Halen III codenamed release. You never know.
Vars (Variables)
++++++++++++++++
As opposed to Facts, variables are names of values (they can be simple scalar values --integers, booleans, strings) or complex ones (dictionaries/hashes, lists) that can be used in templates and playbooks. They are declared things, not things that are inferred from the remote systems current state or nature (which is what Facts are).
YAML
++++
Ansible does not want to force people to write programming language code to automate infrastructure, so Ansible uses YAML to define playbook configuration languages and also variable files. YAML is nice because it has a minimum of syntax and is very clean and easy for people to skim. It is a good data format for configuration files and humans, but also machine readable. Ansible's usage of YAML stemmed from Michael's first use of it inside of Cobbler around 2006. YAML is fairly popular in the dynamic language community and the format has libraries available
for serialization in many different languages (Python, Perl, Ruby, etc).

83
docsite/rst/index.rst Normal file
View File

@ -0,0 +1,83 @@
Ansible Documentation
`````````````````````
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
This page contains documentation about how to use `Ansible <http://ansible.cc>`_. You may also be interested in taking a class:
.. image:: http://www.ansibleworks.com.s3-website-us-east-1.amazonaws.com/img/banners/training.png
:alt: ansibleworks training
:target: http://www.ansibleworks.com/training/
Before we dive into playbooks, configuration management, deployment, and orchestration, we'll learn how to get Ansible installed and some
basic information. We'll go over how to execute ad-hoc commands in parallel across your nodes using /usr/bin/ansible. We'll also see
what sort of modules are available in Ansible's core (though you can also write your own, which we'll also show later).
.. toctree::
:maxdepth: 1
gettingstarted
patterns
examples
modules
Overview
````````
.. image:: http://ansible.cc/img/ansible_arch.png
:alt: ansible architecture diagram
:width: 566px
:height: 439px
Playbooks
`````````
Playbooks are Ansible's orchestration language. At a basic level, playbooks can be used to manage configurations and deployments
of remote machines. At a more advanced level, they can sequence multi-tier rollouts involving rolling updates, and can delegate actions
to other hosts, interacting with monitoring servers and load balancers along the way. You can start small and pick up more features
over time as you need them. Playbooks are designed to be human-readable and are developed in a basic text language. There are multiple
ways to organize playbooks and the files they include, and we'll offer up some suggestions on that and making the most out of Ansible.
.. toctree::
:maxdepth: 1
playbooks
playbooks2
bestpractices
YAMLSyntax
Example Playbooks <https://github.com/ansible/ansible-examples>
Developer Information
`````````````````````
Learn how to build modules of your own in any language. Explore Ansible's Python API and write Python plugins to integrate
with other solutions in your environment.
.. toctree::
:maxdepth: 1
api
moduledev
Miscellaneous
`````````````
`Learn and share neat Ansible tricks on Coderwall <https://coderwall.com/p/t/ansible>`_ - sign-in using GitHub or Twitter to vote on top tips and add your own!
`A list of some Ansible users and quotes about Ansible <http://www.ansibleworks.com/users>`_.
More links:
.. toctree::
:maxdepth: 1
contrib
glossary

455
docsite/rst/moduledev.rst Normal file
View File

@ -0,0 +1,455 @@
Module Development
==================
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
Ansible modules are reusable units of magic that can be used by the Ansible API,
or by the `ansible` or `ansible-playbook` programs.
Modules can be written in any language and are found in the path specified
by `ANSIBLE_LIBRARY` or the ``--module-path`` command line option.
.. contents::
:depth: 2
:backlinks: top
Tutorial
````````
Let's build a module to get and set the system time. For starters, let's build
a module that just outputs the current time.
We are going to use Python here but any language is possible. Only File I/O and outputing to standard
out are required. So, bash, C++, clojure, Python, Ruby, whatever you want
is fine.
Now Python Ansible modules contain some extremely powerful shortcuts (that all the core modules use)
but first we are going to build a module the very hard way. The reason we do this is because modules
written in any language OTHER than Python are going to have to do exactly this. We'll show the easy
way later.
So, here's an example. You would never really need to build a module to set the system time,
the 'command' module could already be used to do this. Though we're going to make one.
Reading the modules that come with ansible (linked above) is a great way to learn how to write
modules. Keep in mind, though, that some modules in ansible's source tree are internalisms,
so look at `service` or `yum`, and don't stare too close into things like `async_wrapper` or
you'll turn to stone. Nobody ever executes async_wrapper directly.
Ok, let's get going with an example. We'll use Python. For starters, save this as a file named `time`::
#!/usr/bin/python
import datetime
import json
date = str(datetime.datetime.now())
print json.dumps({
"time" : date
})
Testing Modules
```````````````
There's a useful test script in the source checkout for ansible::
git clone git@github.com:ansible/ansible.git
chmod +x ansible/hacking/test-module
Let's run the script you just wrote with that::
ansible/hacking/test-module -m ./time
You should see output that looks something like this::
{u'time': u'2012-03-14 22:13:48.539183'}
If you did not, you might have a typo in your module, so recheck it and try again.
Reading Input
`````````````
Let's modify the module to allow setting the current time. We'll do this by seeing
if a key value pair in the form `time=<string>` is passed in to the module.
Ansible internally saves arguments to an arguments file. So we must read the file
and parse it. The arguments file is just a string, so any form of arguments are legal.
Here we'll do some basic parsing to treat the input as key=value.
The example usage we are trying to achieve to set the time is::
time time="March 14 22:10"
If no time parameter is set, we'll just leave the time as is and return the current time.
.. note:
This is obviously an unrealistic idea for a module. You'd most likely just
use the shell module. However, it probably makes a decent tutorial.
Let's look at the code. Read the comments as we'll explain as we go. Note that this
is highly verbose because it's intended as an educational example. You can write modules
a lot shorter than this::
#!/usr/bin/python
# import some python modules that we'll use. These are all
# available in Python's core
import datetime
import sys
import json
import os
import shlex
# read the argument string from the arguments file
args_file = sys.argv[1]
args_data = file(args_file).read()
# for this module, we're going to do key=value style arguments
# this is up to each module to decide what it wants, but all
# core modules besides 'command' and 'shell' take key=value
# so this is highly recommended
arguments = shlex.split(args_data)
for arg in arguments:
# ignore any arguments without an equals in it
if arg.find("=") != -1:
(key, value) = arg.split("=")
# if setting the time, the key 'time'
# will contain the value we want to set the time to
if key == "time":
# now we'll affect the change. Many modules
# will strive to be 'idempotent', meaning they
# will only make changes when the desired state
# expressed to the module does not match
# the current state. Look at 'service'
# or 'yum' in the main git tree for an example
# of how that might look.
rc = os.system("date -s \"%s\"" % value)
# always handle all possible errors
#
# when returning a failure, include 'failed'
# in the return data, and explain the failure
# in 'msg'. Both of these conventions are
# required however additional keys and values
# can be added.
if rc != 0:
print json.dumps({
"failed" : True,
"msg" : "failed setting the time"
})
sys.exit(1)
# when things do not fail, we do not
# have any restrictions on what kinds of
# data are returned, but it's always a
# good idea to include whether or not
# a change was made, as that will allow
# notifiers to be used in playbooks.
date = str(datetime.datetime.now())
print json.dumps({
"time" : date,
"changed" : True
})
sys.exit(0)
# if no parameters are sent, the module may or
# may not error out, this one will just
# return the time
date = str(datetime.datetime.now())
print json.dumps({
"time" : date
})
Let's test that module::
ansible/hacking/test-module -m ./time -a time=\"March 14 12:23\"
This should return something like::
{"changed": True, "time": "2012-03-14 12:23:00.000307"}
Module Provided 'Facts'
```````````````````````
The 'setup' module that ships with Ansible provides many variables about a system that can be used in playbooks
and templates. However, it's possible to also add your own facts without modifying the system module. To do
this, just have the module return a `ansible_facts` key, like so, along with other return data::
{
"changed" : True,
"rc" : 5,
"ansible_facts" : {
"leptons" : 5000
"colors" : {
"red" : "FF0000",
"white" : "FFFFFF"
}
}
}
These 'facts' will be available to all statements called after that module (but not before) in the playbook.
A good idea might be make a module called 'site_facts' and always call it at the top of each playbook, though
we're always open to improving the selection of core facts in Ansible as well.
Common Module Boilerplate
`````````````````````````
As mentioned, if you are writing a module in Python, there are some very powerful shortcuts you can use.
Modules are still transferred as one file, but an arguments file is no longer needed, so these are not
only shorter in terms of code, they are actually FASTER in terms of execution time.
Rather than mention these here, the best way to learn is to read some of the `source of the modules <https://github.com/ansible/ansible/tree/devel/library>`_ that come with Ansible.
The 'group' and 'user' modules are reasonably non-trival and showcase what this looks like.
Key parts include always ending the module file with::
# include magic from lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()
And instantiating the module class like::
module = AnsibleModule(
argument_spec = dict(
state = dict(default='present', choices=['present', 'absent']),
name = dict(required=True),
enabled = dict(required=True, choices=BOOLEANS),
something = dict(aliases=['whatever'])
)
)
The AnsibleModule provides lots of common code for handling returns, parses your arguments
for you, and allows you to check inputs.
Successful returns are made like this::
module.exit_json(changed=True, something_else=12345)
And failures are just as simple (where 'msg' is a required parameter to explain the error)::
module.fail_json(msg="Something fatal happened")
There are also other useful functions in the module class, such as module.md5(path). See
lib/ansible/module_common.py in the source checkout for implementation details.
Again, modules developed this way are best tested with the hacking/test-module script in the git
source checkout. Because of the magic involved, this is really the only way the scripts
can function outside of Ansible.
If submitting a module to ansible's core code, which we encourage, use of the AnsibleModule
class is required.
Check Mode
``````````
.. versionadded:: 1.1
Modules may optionally support check mode. If the user runs Ansible in check
mode, the module should try to predict whether changes will occur.
For your module to support check mode, you must pass ``supports_check_mode=True``
when instantiating the AnsibleModule object. The AnsibleModule.check_mode attribute
will evaluate to True when check mode is enabled. For example::
module = AnsibleModule(
argument_spec = dict(...),
supports_check_mode=True
)
if module.check_mode:
# Check if any changes would be made by don't actually make those changes
module.exit_json(changed=check_if_system_state_would_be_changed())
Remember that, as module developer, you are responsible for ensuring that no
system state is altered when the user enables check mode.
If your module does not support check mode, when the user runs Ansible in check
mode, your module will simply be skipped.
Common Pitfalls
```````````````
You should also never do this in a module::
print "some status message"
Because the output is supposed to be valid JSON. Except that's not quite true,
but we'll get to that later.
Modules must not output anything on standard error, because the system will merge
standard out with standard error and prevent the JSON from parsing. Capturing standard
error and returning it as a variable in the JSON on standard out is fine, and is, in fact,
how the command module is implemented.
If a module returns stderr or otherwise fails to produce valid JSON, the actual output
will still be shown in Ansible, but the command will not succeed.
Always use the hacking/test-module script when developing modules and it will warn
you about these kind of things.
Conventions/Recommendations
```````````````````````````
As a reminder from the example code above, here are some basic conventions
and guidelines:
* If the module is addressing an object, the parameter for that object should be called 'name' whenever possible, or accept 'name' as an alias.
* If you have a company module that returns facts specific to your installations, a good name for this module is `site_facts`.
* Modules accepting boolean status should generally accept 'yes', 'no', 'true', 'false', or anything else a user may likely throw at them. The AnsibleModule common code supports this with "choices=BOOLEANS" and a module.boolean(value) casting function.
* Include a minimum of dependencies if possible. If there are dependencies, document them at the top of the module file, and have the module raise JSON error messages when the import fails.
* Modules must be self contained in one file to be auto-transferred by ansible.
* If packaging modules in an RPM, they only need to be installed on the control machine and should be dropped into /usr/share/ansible. This is entirely optional and up to you.
* Modules should return JSON or key=value results all on one line. JSON is best if you can do JSON. All return types must be hashes (dictionaries) although they can be nested. Lists or simple scalar values are not supported, though they can be trivially contained inside a dictionary.
* In the event of failure, a key of 'failed' should be included, along with a string explanation in 'msg'. Modules that raise tracebacks (stacktraces) are generally considered 'poor' modules, though Ansible can deal with these returns and will automatically convert anything unparseable into a failed result. If you are using the AnsibleModule common Python code, the 'failed' element will be included for you automatically when you call 'fail_json'.
* Return codes from modules are not actually not signficant, but continue on with 0=success and non-zero=failure for reasons of future proofing.
* As results from many hosts will be aggregrated at once, modules should return only relevant output. Returning the entire contents of a log file is generally bad form.
Shorthand Vs JSON
`````````````````
To make it easier to write modules in bash and in cases where a JSON
module might not be available, it is acceptable for a module to return
key=value output all on one line, like this. The Ansible parser
will know what to do::
somekey=1 somevalue=2 rc=3 favcolor=red
If you're writing a module in Python or Ruby or whatever, though, returning
JSON is probably the simplest way to go.
Documenting Your Module
```````````````````````
All modules included in the CORE distribution must have a
``DOCUMENTATION`` string. This string MUST be a valid YAML document
which conforms to the schema defined below. You may find it easier to
start writing your ``DOCUMENTATION`` string in an editor with YAML
syntax highlighting before you include it in your Python file.
Example
+++++++
Here's a correctly formatted YAML document we could use for a
``DOCUMENTATION`` string:
.. literalinclude:: ../../examples/DOCUMENTATION.yaml
This is available in the 'examples/' directory of the of the Ansible
github repository, and you can have that generated with
``./hacking/module_formatter.py -G``. You can copy it into your module and use
it as a starting point when writing your own docs.
Include it in your module file like this::
#!/usr/bin/env python
# Copyright header....
DOCUMENTATION = '''
---
module: modulename
short_description: This is a sentence describing the module
# ... snip ...
examples:
- code: modulename opt1=arg1 opt2=arg2
description: Optional words describing this example
'''
The ``description``, ``notes`` and ``description`` within ``examples``
support formatting in some of the output formats (e.g. ``rst``, ``man``).
These formatting functions are ``U()``, ``M()``, ``I()``, and ``C()``
for URL, module, italic, and constant-width respectively. It is suggested
to use ``C()`` for file and option names, and ``I()`` when referencing
parameters; module names should be specifies as ``M(module)``.
Examples (which typically contain colons, quotes, etc.) are difficult
to format with YAML, so these can (alternatively, or additionally) be
written in plain text in an ``EXAMPLES`` string within the module
like this::
EXAMPLES = '''
- action: modulename opt1=arg1 opt2=arg2
'''
The ``module_formatter.py`` script and ``ansible-doc(1)`` append the
``EXAMPLES`` blob after any existing ``examples`` you may have in the
YAML ``DOCUMENTATION`` string.
Building & Testing
++++++++++++++++++
Put your completed module file into the 'library' directory and then
run the command: ``make webdocs``. The new 'modules.html' file will be
built and appear in the 'docsite/' directory.
You can also test-build your docs one-by-one using the
``module_formatter.py`` script:
.. code-block:: bash
$ ./hacking/module_formatter.py -t man -M library/ -m git > ansible-git.1
$ man ./ansible-git.1
This will build a manpage for the git module, and look in the
'library/' directory for the module source. To see all the other
output formats available:
.. code-block:: bash
$ ./hacking/module_formatter.py -t --help
.. tip::
If you're having a problem with the syntax of your YAML you can
validate it on the `YAML Lint <http://www.yamllint.com/>`_ website.
.. tip::
You can use ANSIBLE_KEEP_REMOTE_FILES=1 to prevent ansible from
deleting the remote files so you can debug your module.
Getting Your Module Into Core
`````````````````````````````
High-quality modules with minimal dependencies
can be included in the core, but core modules (just due to the programming
preferences of the developers) will need to be implemented in Python and use
the AnsibleModule common code, and should generally use consistent arguments with the rest of
the program. Stop by the mailing list to inquire about requirements.
.. seealso::
:doc:`modules`
Learn about available modules
`Ansible Resources <https://github.com/ansible/ansible/tree/devel/contrib>`_
User contributed playbooks, modules, and articles
`Github modules directory <https://github.com/ansible/ansible/tree/devel/library>`_
Browse source of core modules
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

85
docsite/rst/modules.rst Normal file
View File

@ -0,0 +1,85 @@
Ansible Modules
===============
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
.. contents::
:depth: 2
:backlinks: top
Introduction
````````````
Ansible ships with a number of modules (called the 'module library')
that can be executed directly on remote hosts or through :doc:`playbooks`.
Users can also write their own modules. These modules can control system
resources, like services, packages, or files (anything really), or
handle executing system commands.
Let's review how we execute three different modules from the command line::
ansible webservers -m service -a "name=httpd state=running"
ansible webservers -m ping
ansible webservers -m command -a "/sbin/reboot -t now"
Each module supports taking arguments. Nearly all modules take ``key=value``
arguments, space delimited. Some modules take no arguments, and the
command/shell modules simply take the string of the command you want to run.
From playbooks, Ansible modules are executed in a very similar way::
- name: reboot the servers
action: command /sbin/reboot -t now
Version 0.8 and higher support the following shorter syntax::
- name: reboot the servers
command: /sbin/reboot -t now
All modules technically return JSON format data, though if you are using the
command line or playbooks, you don't really need to know much about
that. If you're writing your own module, you care, and this means you do
not have to write modules in any particular language -- you get to choose.
Modules are `idempotent`, meaning they will seek to avoid changes to the system unless a change needs to be made. When using Ansible
playbooks, these modules can trigger 'change events' in the form of notifying 'handlers'
to run additional tasks.
Documention for each module can be accessed from the command line with the
ansible-doc as well as the man command::
ansible-doc command
man ansible.template
Let's see what's available in the Ansible module library, out of the box:
.. include:: modules/_list.rst
Writing your own modules
````````````````````````
See :doc:`moduledev`.
.. seealso::
:doc:`contrib`
User contributed playbooks, modules, and articles
:doc:`examples`
Examples of using modules in /usr/bin/ansible
:doc:`playbooks`
Examples of using modules with /usr/bin/ansible-playbook
:doc:`moduledev`
How to write your own modules
:doc:`api`
Examples of using modules with the Python API
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

View File

244
docsite/rst/patterns.rst Normal file
View File

@ -0,0 +1,244 @@
.. _patterns:
Inventory & Patterns
====================
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
Ansible works against multiple systems in your infrastructure at the
same time. It does this by selecting portions of systems listed in
Ansible's inventory file, which defaults to /etc/ansible/hosts.
.. contents:: `Table of contents`
:depth: 2
:backlinks: top
.. _inventoryformat:
Hosts and Groups
++++++++++++++++
The format for /etc/ansible/hosts is an INI format and looks like this::
mail.example.com
[webservers]
foo.example.com
bar.example.com
[dbservers]
one.example.com
two.example.com
three.example.com
The things in brackets are group names. You don't have to have them,
but they are useful.
If you have hosts that run on non-standard SSH ports you can put the port number
after the hostname with a colon. Ports listed in any SSH config file won't be read,
so it is important that you set them if things are not running on the default port::
badwolf.example.com:5309
Suppose you have just static IPs and want to set up some aliases that don't live in your host file, or you are connecting through tunnels. You can do things like this::
jumper ansible_ssh_port=5555 ansible_ssh_host=192.168.1.50
In the above example, trying to ansible against the host alias "jumper" (which may not even be a real hostname) will contact 192.168.1.50 on port 5555.
Adding a lot of hosts? In 0.6 and later, if you have a lot of hosts following similar patterns you can do this rather than listing each hostname::
[webservers]
www[01:50].example.com
In 1.0 and later, you can also do this for alphabetic ranges::
[databases]
db-[a:f].example.com
For numeric patterns, leading zeros can be included or removed, as desired. Ranges are inclusive.
In 1.1 and later, you can also select the connection type and user on a per host basis::
[targets]
localhost ansible_connection=local
other1.example.com ansible_connection=ssh ansible_ssh_user=mpdehaan
other2.example.com ansible_connection=ssh ansible_ssh_user=mdehaan
All of these variables can of course also be set outside of the inventory file, in 'host_vars' if you wish
to keep your inventory file simple.
Selecting Targets
+++++++++++++++++
We'll go over how to use the command line in :doc:`examples` section, however, basically it looks like this::
ansible <pattern_goes_here> -m <module_name> -a <arguments>
Such as::
ansible webservers -m service -a "name=httpd state=restarted"
Within :doc:`playbooks`, these patterns can be used for even greater purposes.
Anyway, to use Ansible, you'll first need to know how to tell Ansible which hosts in your inventory file to talk to.
This is done by designating particular host names or groups of hosts.
The following patterns target all hosts in the inventory file::
all
*
Basically 'all' is an alias for '*'. It is also possible to address a specific host or hosts::
one.example.com
one.example.com:two.example.com
192.168.1.50
192.168.1.*
The following patterns address one or more groups, which are denoted
with the aforementioned bracket headers in the inventory file::
webservers
webservers:dbservers
You can exclude groups as well, for instance, all webservers not in Phoenix::
webservers:!phoenix
You can also specify the intersection of two groups::
webservers:&staging
You can do combinations::
webservers:dbservers:!phoenix:&staging
You can also use variables::
webservers:!$excluded:&$required
Individual host names, IPs and groups, can also be referenced using
wildcards::
*.example.com
*.com
It's also ok to mix wildcard patterns and groups at the same time::
one*.com:dbservers
Easy enough. See :doc:`examples` and then :doc:`playbooks` for how to do things to selected hosts.
Host Variables
++++++++++++++
It is easy to assign variables to hosts that will be used later in playbooks::
[atlanta]
host1 http_port=80 maxRequestsPerChild=808
host2 http_port=303 maxRequestsPerChild=909
Group Variables
+++++++++++++++
Variables can also be applied to an entire group at once::
[atlanta]
host1
host2
[atlanta:vars]
ntp_server=ntp.atlanta.example.com
proxy=proxy.atlanta.example.com
Groups of Groups, and Group Variables
+++++++++++++++++++++++++++++++++++++
It is also possible to make groups of groups and assign
variables to groups. These variables can be used by /usr/bin/ansible-playbook, but not
/usr/bin/ansible::
[atlanta]
host1
host2
[raleigh]
host2
host3
[southeast:children]
atlanta
raleigh
[southeast:vars]
some_server=foo.southeast.example.com
halon_system_timeout=30
self_destruct_countdown=60
escape_pods=2
[usa:children]
southeast
northeast
southwest
southeast
If you need to store lists or hash data, or prefer to keep host and group specific variables
separate from the inventory file, see the next section.
Splitting Out Host and Group Specific Data
++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 0.6
In addition to the storing variables directly in the INI file, host
and group variables can be stored in individual files relative to the
inventory file. These variable files are in YAML format.
Assuming the inventory file path is::
/etc/ansible/hosts
If the host is named 'foosball', and in groups 'raleigh' and 'webservers', variables
in YAML files at the following locations will be made available to the host::
/etc/ansible/group_vars/raleigh
/etc/ansible/group_vars/webservers
/etc/ansible/host_vars/foosball
For instance, suppose you have hosts grouped by datacenter, and each datacenter
uses some different servers. The data in the groupfile '/etc/ansible/group_vars/raleigh' for
the 'raleigh' group might look like::
---
ntp_server: acme.example.org
database_server: storage.example.org
It is ok if these files do not exist, this is an optional feature.
Tip: Keeping your inventory file and variables in a git repo (or other version control)
is an excellent way to track changes to your inventory and host variables.
.. versionadded:: 0.5
If you ever have two python interpreters on a system, or your Python version 2 interpreter is not found
at /usr/bin/python, set an inventory variable called 'ansible_python_interpreter' to the Python
interpreter path you would like to use.
.. seealso::
:doc:`examples`
Examples of basic commands
:doc:`playbooks`
Learning ansible's configuration management language
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel

467
docsite/rst/playbooks.rst Normal file
View File

@ -0,0 +1,467 @@
Playbooks
=========
.. image:: http://ansible.cc/docs/_static/ansible_fest_2013.png
:alt: ansiblefest 2013
:target: http://ansibleworks.com/fest
.. contents::
:depth: 2
:backlinks: top
Introduction
````````````
Playbooks are a completely different way to use ansible than in task execution mode, and are
particularly powerful. Simply put, playbooks are the basis for a really simple
configuration management and multi-machine deployment system,
unlike any that already exist, and one that is very well suited to deploying complex applications.
Playbooks can declare configurations, but they can also orchestrate steps of
any manual ordered process, even as different steps must bounce back and forth
between sets of machines in particular orders. They can launch tasks
synchronously or asynchronously.
While you might run the main /usr/bin/ansible program for ad-hoc
tasks, playbooks are more likely to be kept in source control and used
to push out your configuration or assure the configurations of your
remote systems are in spec.
Let's dive in and see how they work. As you go, you may wish to open
the `github examples directory <https://github.com/ansible/ansible/tree/devel/examples/playbooks>`_ in
another tab, so you can apply the theory to what things look like in practice.
There are also some full sets of playbooks illustrating a lot of these techniques in the
`ansible-examples repository <https://github.com/ansible/ansible-examples>`_.
Playbook Language Example
`````````````````````````
Playbooks are expressed in YAML format and have a minimum of syntax.
Each playbook is composed of one or more 'plays' in a list.
The goal of a play is map a group of hosts to some well defined roles, represented by
things ansible called tasks. At the basic level, a task is nothing more than a call
to an ansible module, which you should have learned about in earlier chapters.
By composing a playbook of multiple 'plays', it is possible to
orchestrate multi-machine deployments, running certain steps on all
machines in the webservers group, then certain steps on the database
server group, then more commands back on the webservers group, etc.
For starters, here's a playbook that contains just one play::
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
user: root
tasks:
- name: ensure apache is at the latest version
action: yum pkg=httpd state=latest
- name: write the apache config file
action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running
action: service name=httpd state=started
handlers:
- name: restart apache
action: service name=httpd state=restarted
Below, we'll break down what the various features of the playbook language are.
Basics
``````
Hosts and Users
+++++++++++++++
For each play in a playbook, you get to choose which machines in your infrastructure
to target and what remote user to complete the steps (called tasks) as.
The `hosts` line is a list of one or more groups or host patterns,
separated by colons, as described in the :ref:`patterns`
documentation. The `user` is just the name of the user account::
---
- hosts: webservers
user: root
Support for running things from sudo is also available::
---
- hosts: webservers
user: yourname
sudo: yes
You can also login as you, and then sudo to different users than root::
---
- hosts: webservers
user: yourname
sudo: yes
sudo_user: postgres
If you need to specify a password to sudo, run `ansible-playbook` with ``--ask-sudo-pass`` (`-K`).
If you run a sudo playbook and the playbook seems to hang, it's probably stuck at the sudo prompt.
Just `Control-C` to kill it and run it again with `-K`.
.. important::
When using `sudo_user` to a user other than root, the module
arguments are briefly written into a random tempfile in /tmp.
These are deleted immediately after the command is executed. This
only occurs when sudoing from a user like 'bob' to 'timmy', not
when going from 'bob' to 'root', or logging in directly as 'bob' or
'root'. If this concerns you that this data is briefly readable
(not writeable), avoid transferring uncrypted passwords with
`sudo_user` set. In other cases, '/tmp' is not used and this does
not come into play. Ansible also takes care to not log password
parameters.
Vars section
++++++++++++
The `vars` section contains a list of variables and values that can be used in the plays, like this::
---
- hosts: webservers
user: root
vars:
http_port: 80
van_halen_port: 5150
other: 'magic'
These variables can be used later in the playbook like this::
$varname or ${varname}
The later is useful in the event you need to do something like ${other}_some_string.
Inside templates, the full power of the `Jinja2 <http://jinja.pocoo.org/docs/>`_ templating language is also available, which looks like this::
{{ varname }}
The Jinja2 documentation provides information about how to construct loops and conditionals for those
who which to use more advanced templating. This is optional and the $varname format still works in template
files.
If there are discovered variables about the system, called 'facts', these variables bubble up back into the
playbook, and can be used on each system just like explicitly set variables. Ansible provides several
of these, prefixed with 'ansible', and are documented under 'setup' in the module documentation. Additionally,
facts can be gathered by ohai and facter if they are installed. Facter variables are prefixed with ``facter_`` and Ohai
variables are prefixed with ``ohai_``.
So for instance, if I wanted
to write the hostname into the /etc/motd file, I could say::
- name: write the motd
action: template src=/srv/templates/motd.j2 dest=/etc/motd
And in /srv/templates/motd.j2::
You are logged into {{ facter_hostname }}
But we're getting ahead of ourselves. Let's talk about tasks.
Tasks list
++++++++++
Each play contains a list of tasks. Tasks are executed in order, one
at a time, against all machines matched by the host pattern,
before moving on to the next task. It is important to understand that, within a play,
all hosts are going to get the same task directives. It is the purpose of a play to map
a selection of hosts to tasks.
When running the playbook, which runs top to bottom, hosts with failed tasks are
taken out of the rotation for the entire playbook. If things fail, simply correct the playbook file and rerun.
The goal of each task is to execute a module, with very specific arguments.
Variables, as mentioned above, can be used in arguments to modules.
Modules are 'idempotent', meaning if you run them
again, they will make the changes they are told to make to bring the
system to the desired state. This makes it very safe to rerun
the same playbook multiple times. They won't change things
unless they have to change things.
The `command` and `shell` modules will typically rerun the same command again,
which is totally ok if the command is something like
'chmod' or 'setsebool', etc. Though there is a 'creates' flag available which can
be used to make these modules also idempotent.
Every task should have a `name`, which is included in the output from
running the playbook. This is output for humans, so it is
nice to have reasonably good descriptions of each task step. If the name
is not provided though, the string fed to 'action' will be used for
output.
Here is what a basic task looks like, as with most modules,
the service module takes key=value arguments::
tasks:
- name: make sure apache is running
action: service name=httpd state=running
The `command` and `shell` modules are the one modules that just takes a list
of arguments, and don't use the key=value form. This makes
them work just like you would expect. Simple::
tasks:
- name: disable selinux
action: command /sbin/setenforce 0
The command and shell module care about return codes, so if you have a command
who's successful exit code is not zero, you may wish to do this::
tasks:
- name: run this command and ignore the result
action: shell /usr/bin/somecommand || /bin/true
Or this::
tasks:
- name: run this command and ignore the result
action: shell /usr/bin/somecommand
ignore_errors: True
If the action line is getting too long for comfort you can break it on
a space and indent any continuation lines::
tasks:
- name: Copy ansible inventory file to client
action: copy src=/etc/ansible/hosts dest=/etc/ansible/hosts
owner=root group=root mode=0644
Variables can be used in action lines. Suppose you defined
a variable called 'vhost' in the 'vars' section, you could do this::
tasks:
- name: create a virtual host file for $vhost
action: template src=somefile.j2 dest=/etc/httpd/conf.d/$vhost
Those same variables are usable in templates, which we'll get to later.
Now in a very basic playbook all the tasks will be listed directly in that play, though it will usually
make more sense to break up tasks using the 'include:' directive. We'll show that a bit later.
Action Shorthand
````````````````
.. versionadded: 0.8
Rather than listing out the explicit word, "action:", like so::
action: template src=templates/foo.j2 dest=/etc/foo.conf
It is also possible to say:
template: src=templates/foo.j2 dest=/etc/foo.conf
The name of the module is simply followed by a colon and the arguments to that module. We think this is a lot more intuitive.
Our documentation has not converted over to this new format just yet as many users may still be using older versions.
You'll be able to use both formats forever.
Running Operations On Change
````````````````````````````
As we've mentioned, modules are written to be 'idempotent' and can relay when
they have made a change on the remote system. Playbooks recognize this and
have a basic event system that can be used to respond to change.
These 'notify' actions are triggered at the end of each 'play' in a playbook, and
trigger only once each. For instance, multiple resources may indicate
that apache needs to be restarted, but apache will only be bounced once.
Here's an example of restarting two services when the contents of a file
change, but only if the file changes::
- name: template configuration file
action: template src=template.j2 dest=/etc/foo.conf
notify:
- restart memcached
- restart apache
The things listed in the 'notify' section of a task are called
handlers.
Handlers are lists of tasks, not really any different from regular
tasks, that are referenced by name. Handlers are what notifiers
notify. If nothing notifies a handler, it will not run. Regardless
of how many things notify a handler, it will run only once, after all
of the tasks complete in a particular play.
Here's an example handlers section::
handlers:
- name: restart memcached
action: service name=memcached state=restarted
- name: restart apache
action: service name=apache state=restarted
Handlers are best used to restart services and trigger reboots. You probably
won't need them for much else.
.. note::
Notify handlers are always run in the order written.
Task Include Files And Encouraging Reuse
````````````````````````````````````````
Suppose you want to reuse lists of tasks between plays or playbooks. You can use
include files to do this. Use of included task lists is a great way to define a role
that system is going to fulfill. Remember, the goal of a play in a playbook is to map
a group of systems into multiple roles. Let's see what this looks like...
A task include file simply contains a flat list of tasks, like so::
---
# possibly saved as tasks/foo.yml
- name: placeholder foo
action: command /bin/foo
- name: placeholder bar
action: command /bin/bar
Include directives look like this, and can be mixed in with regular tasks in a playbook::
tasks:
- include: tasks/foo.yml
You can also pass variables into includes. We call this a 'parameterized include'.
For instance, if deploying multiple wordpress instances, I could
contain all of my wordpress tasks in a single wordpress.yml file, and use it like so::
tasks:
- include: wordpress.yml user=timmy
- include: wordpress.yml user=alice
- include: wordpress.yml user=bob
Variables passed in can then be used in the included files. You can reference them like this::
$user
(In addition to the explicitly passed in parameters, all variables from
the vars section are also available for use here as well.)
Starting in 1.0, variables can also be passed to include files using an alternative syntax,
which also supports structured variables::
tasks:
- include: wordpress.yml
vars:
user: timmy
some_list_variable:
- alpha
- beta
- gamma
Playbooks can include other playbooks too, but that's mentioned in a later section.
.. note::
As of 1.0, task include statements can be used at arbitrary depth.
They were previously limited to a single level, so task includes
could not include other files containing task includes.
Includes can also be used in the 'handlers' section, for instance, if you
want to define how to restart apache, you only have to do that once for all
of your playbooks. You might make a handlers.yml that looks like::
---
# this might be in a file like handlers/handlers.yml
- name: restart apache
action: service name=apache state=restarted
And in your main playbook file, just include it like so, at the bottom
of a play::
handlers:
- include: handlers/handlers.yml
You can mix in includes along with your regular non-included tasks and handlers.
Includes can also be used to import one playbook file into another. This allows
you to define a top-level playbook that is composed of other playbooks.
For example::
- name: this is a play at the top level of a file
hosts: all
user: root
tasks:
- name: say hi
tags: foo
action: shell echo "hi..."
- include: load_balancers.yml
- include: webservers.yml
- include: dbservers.yml
Note that you cannot do variable substitution when including one playbook
inside another.
.. note::
You can not conditionally path the location to an include file,
like you can with 'vars_files'. If you find yourself needing to do
this, consider how you can restructure your playbook to be more
class/role oriented. This is to say you cannot use a 'fact' to
decide what include file to use. All hosts contained within the
play are going to get the same tasks. ('only_if' provides some
ability for hosts to conditionally skip tasks).
Executing A Playbook
````````````````````
Now that you've learned playbook syntax, how do you run a playbook? It's simple.
Let's run a playbook using a parallelism level of 10::
ansible-playbook playbook.yml -f 10
Tips and Tricks
```````````````
Look at the bottom of the playbook execution for a summary of the nodes that were executed
and how they performed. General failures and fatal "unreachable" communication attempts are
kept separate in the counts.
If you ever want to see detailed output from successful modules as well as unsuccessful ones,
use the '--verbose' flag. This is available in Ansible 0.5 and later.
Also, in version 0.5 and later, Ansible playbook output is vastly upgraded if the cowsay
package is installed. Try it!
In version 0.7 and later, to see what hosts would be affected by a playbook before you run it, you
can do this::
ansible-playbook playbook.yml --list-hosts.
.. seealso::
:doc:`YAMLSyntax`
Learn about YAML syntax
:doc:`playbooks`
Review the basic Playbook language features
:doc:`playbooks2`
Learn about Advanced Playbook Features
:doc:`bestpractices`
Various tips about managing playbooks in the real world
:doc:`modules`
Learn about available modules
:doc:`moduledev`
Learn how to extend Ansible by writing your own modules
:doc:`patterns`
Learn about how to select hosts
`Github examples directory <https://github.com/ansible/ansible/tree/devel/examples/playbooks>`_
Complete playbook files from the github project source
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups

1107
docsite/rst/playbooks2.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
---
# If a key doesn't apply to your module (ex: choices, default, or
# aliases) you can use the word 'null', or an empty list, [], where
# appropriate.
module: modulename
short_description: This is a sentence describing the module
description:
- Longer description of the module
- You might include instructions
version_added: X.Y
author: Your AWESOME name here
notes:
- Other things consumers of your module should know
requirements:
- list of required things
- like the factor package
- or a specic platform
options:
# One or more of the following
option_name:
description:
- Words go here
- that describe
- this option
required: true or false
default: a string or the word null
choices: [list, of, choices]
aliases: [list, of, aliases]
version_added: 0.X
examples:
# One or more of the following:
- code: modulename opt1=arg1 opt2=arg2
description: Optional words describing this example

View File

@ -21,7 +21,7 @@ module_name = command
remote_tmp = $HOME/.ansible/tmp
# the default pattern for ansible-playbooks ("hosts:")
# the default pattern for ansible-playbooks ("hosts:")
pattern = *
@ -46,6 +46,16 @@ poll_interval=15
sudo_user=root
# the following forces ansible to always ask for the sudo password (instead of having
# to add -K to the commandline). Or you can use the environment variable (ANSIBLE_ASK_SUDO_PASS)
#ask_sudo_pass=True
# the following forces ansible to always ask for the ssh-password (-k)
# can also be set by the environment variable ANSIBLE_ASK_PASS
#ask_pass=True
# connection to use when -c <connection_type> is not specified
transport=paramiko
@ -61,11 +71,53 @@ remote_port=22
#remote_user=root
# the default sudo executable. If a sudo alternative with a sudo-compatible interface
# is used, specify its executable name as the default
sudo_exe=sudo
# the default flags passed to sudo
# sudo_flags=-H
# how to handle hash defined in several places
# hash can be merged, or replaced
# if you use replace, and have multiple hashes named 'x', the last defined
# will override the previously defined one
# if you use merge here, hash will cumulate their keys, but keys will still
# override each other
# replace is the default value, and is how ansible always handled hash variables
#
# hash_behaviour=replace
# if you need to use jinja2 extensions, you can list them here
# use a coma to separate extensions, e.g. :
# jinja2_extensions=jinja2.ext.do,jinja2.ext.i18n
# no extensions are loaded by default
#jinja2_extensions=
# if set, always use this private key file for authentication, same as if passing
# --private-key-file to ansible or ansible-playbook
# --private-key to ansible or ansible-playbook
#private_key_file=/path/to/file
# format of string $ansible_managed available within Jinja2 templates, replacing
# {file}, {host} and {uid} with template filename, host and owner respectively.
# The resulting string is passed through strftime(3) so it may contain any
# time-formatting specifiers.
#
# Example: ansible_managed = DONT TOUCH {file}: call {uid} at {host} for changes
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
# additional plugin paths for non-core plugins
action_plugins = /usr/share/ansible_plugins/action_plugins
callback_plugins = /usr/share/ansible_plugins/callback_plugins
connection_plugins = /usr/share/ansible_plugins/connection_plugins
lookup_plugins = /usr/share/ansible_plugins/lookup_plugins
vars_plugins = /usr/share/ansible_plugins/vars_plugins
filter_plugins = /usr/share/ansible_plugins/filter_plugins
[paramiko_connection]
# nothing to configure yet
@ -78,4 +130,8 @@ remote_port=22
ssh_args=-o PasswordAuthentication=no -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
# the following makes ansible use scp if the connection type is ssh (default is sftp)
#scp_if_ssh=True

View File

@ -1,4 +1,4 @@
# ansibple-pull setup
# ansible-pull setup
#
# on remote hosts, set up ansible to run periodically using the latest code
# from a particular checkout, in pull based fashion, inverting Ansible's
@ -20,12 +20,15 @@
vars:
# schdule is fed directly to cron
# schedule is fed directly to cron
schedule: '*/15 * * * *'
# User to run ansible-pull as from cron
cron_user: root
# File that ansible will use for logs
logfile: /var/log/ansible-pull.log
# Directory to where repository will be cloned
workdir: /var/lib/ansible/local
@ -47,5 +50,7 @@
owner=root group=root mode=0644
- name: Create crontab entry to clone/pull git repository
action: template src=templates/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
action: template src=templates/etc_cron.d_ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
- name: Create logrotate entry for ansible-pull.log
action: template src=templates/etc_logrotate.d_ansible-pull.j2 dest=/etc/logrotate.d/ansible-pull owner=root group=root mode=0644

View File

@ -0,0 +1,45 @@
---
# This playbook demonstrates how to use the ansible cloudformation module to launch an AWS CloudFormation stack.
#
# This module requires that the boto python library is installed, and that you have your AWS credentials
# in $HOME/.boto
#The thought here is to bring up a bare infrastructure with CloudFormation, but use ansible to configure it.
#I generally do this in 2 different playbook runs as to allow the ec2.py inventory to be updated.
#This module also uses "complex arguments" which were introduced in ansible 1.1 allowing you to specify the
#Cloudformation template parameters
#This example launches a 3 node AutoScale group, with a security group, and an InstanceProfile with root permissions.
#If a stack does not exist, it will be created. If it does exist and the template file has changed, the stack will be updated.
#If the parameters are different, the stack will also be updated.
#CloudFormation stacks can take awhile to provision, if you are curious about its status, use the AWS
#web console or one of the CloudFormation CLI's.
#Example update -- try first launching the stack with 3 as the ClusterSize. After it is launched, change it to 4
#and run the playbook again.
- name: provision stack
hosts: localhost
connection: local
gather_facts: false
# Launch the cloudformation-example.json template. Register the output.
tasks:
- name: launch ansible cloudformation example
cloudformation: >
stack_name="ansible-cloudformation" state=present
region=us-east-1 disable_rollback=true
template=files/cloudformation-example.json
args:
template_parameters:
KeyName: jmartin
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3
register: stack
- name: show stack outputs
debug: msg="My stack outputs are ${stack.stack_outputs}"

View File

@ -0,0 +1,55 @@
---
# this is a bit of an advanced topic.
#
# generally Ansible likes to pass simple key=value arguments to modules. It occasionally comes up though
# that you might want to write a module that takes COMPLEX arguments, like lists and dictionaries.
#
# happen, at least right now, it should be a Python module, so it can leverage some common code in Ansible that
# makes this easy. If you write a non-Python module, you can still pass data across, but only hashes that
# do not contain lists or other hashes. If you write the Python module, you can do anything.
#
# note that if you were to use BOTH the key=value form and the 'args' form for passing data in, the key=value
# parameters take a higher priority, so you can use them for defaults, which can be useful.
- hosts: all
user: root
gather_facts: no
vars:
defaults:
state: stopped
complex:
ghostbusters: [ 'egon', 'ray', 'peter', 'winston' ]
mice: [ 'pinky', 'brain', 'larry' ]
tasks:
- name: this is the basic way data passing works for any module
action: ping data='Hi Mom'
- name: of course this can also be written like so, which is shorter
ping: data='Hi Mom'
- name: but what if you have a complex module that needs complicated data?
action: ping
args:
data:
moo: cow
asdf: [1,2,3,4]
- name: can we make that cleaner? sure!
action: ping
args: { data: $complex }
- name: or if you prefer... this is equivalent
action: ping
args:
data: $complex
- name: here is an example of how it works with defaults, notice the key=value format wins
action: service name=httpd state=running
args: $defaults

View File

@ -1,47 +1,54 @@
---
# this is a demo of conditional executions using 'only_if', which can skip
# certain tasks on machines/platforms/etc where they do not apply.
# this is a demo of conditional executions using 'when' statements, which can skip
# certain tasks on machines/platforms/etc where they do not apply.
- hosts: all
user: root
vars:
favcolor: "red"
dog: "fido"
cat: "whiskers"
ssn: 8675309
# Below we're going to define some expressions.
# These are the types of when statemnets available
# when_set: $variable_name
# when_unset: $variable_name
# when_str: $x == "test"
# when_int: $y > 2
# when_float: $z => 2.3
#
# Not only can we assign variables for reuse, but we can also assign conditional
# expressions. By keeping these in 'vars', the task section remains
# extraordinarily clean, and not littered with programming language
# constructs -- so it's easily skimmed by humans.
# when using 'when', take care to make sure any variables given are surrounded by spaces
# as an example, $z>3 will not do what you want, use "$z > 3"
#
# Remember to quote any variables if they are not numbers!
#
# Interesting fact: aside from the $variables, these expressions are actually
# tiny bits of Python. They are evaluated in the context of each host, so different
# steps can be skipped on different hosts! They should evaluate to either True
# or False
is_favcolor_blue: "'$favcolor' == 'blue'"
is_centos: "'$facter_operatingsystem' == 'CentOS'"
# NOTE:
#
# facter and ohai variables can be used in only_if statements too
# ex: "'$facter_operatingsystem' == 'CentOS'", which bubble up automatically
# from the managed machines
#
# this example won't do that though, as you might not have facter or ohai,
# but you get the idea...
# note, if you are doing comparisons to variables that are stored as hashes or lists,
# you will need to use the older 'only_if', which is more free form.
# see conditionals_part_3.yml
tasks:
- name: "do this if my favcolor is blue"
- name: "do this if my favcolor is blue, and my dog is named fido"
action: shell /bin/false
only_if: '$is_favcolor_blue'
when_string: $favcolor == 'blue' and $dog == 'fido'
- name: "do this if my favcolor is not blue"
- name: "do this if my favcolor is not blue, and my dog is named fido"
action: shell /bin/true
only_if: 'not ($is_favcolor_blue)'
when_string: $favcolor != 'blue' and $dog == 'fido'
- name: "do this if my SSN is over 9000"
action: shell /bin/true
when_integer: $ssn > 9000
- name: "do this if I have one of these SSNs"
action: shell /bin/true
when_integer: $ssn in [ 8675309, 8675310, 8675311 ]
- name: "do this if a variable named hippo is NOT defined"
action: shell /bin/true
when_unset: $hippo
- name: "do this if a variable named hippo is defined"
action: shell /bin/true
when_set: $hippo

View File

@ -0,0 +1,47 @@
---
# this is a demo of conditional executions using 'only_if', which can skip
# certain tasks on machines/platforms/etc where they do not apply. This is
# the more 'raw' version of the 'when' statement, most users will be able to
# use 'when' directly. 'only_if' is an older feature, and useful for when
# you need more advanced expression control.
- hosts: all
user: root
vars:
favcolor: "red"
ssn: 8675309
# Below we're going to define some expressions.
#
# Not only can we assign variables for reuse, but we can also assign conditional
# expressions. By keeping these in 'vars', the task section remains
# extraordinarily clean, and not littered with programming language
# constructs -- so it's easily skimmed by humans.
#
# Remember to quote any variables if they are not numbers!
#
# Interesting fact: aside from the $variables, these expressions are actually
# tiny bits of Python. They are evaluated in the context of each host, so different
# steps can be skipped on different hosts! They should evaluate to either True
# or False
is_favcolor_blue: "'$favcolor' == 'blue'"
is_centos: "'$facter_operatingsystem' == 'CentOS'"
# NOTE:
#
# setup module values, facter and ohai variables can be used in only_if statements too
# ex: "'$facter_operatingsystem' == 'CentOS'", which bubble up automatically
# from the managed machines. This example doesn't do that though.
tasks:
- name: "do this if my favcolor is blue"
action: shell /bin/false
only_if: '$is_favcolor_blue'
- name: "do this if my favcolor is not blue"
action: shell /bin/true
only_if: 'not ($is_favcolor_blue)'

View File

@ -0,0 +1,6 @@
---
- name: Demonstrate custom jinja2 filters
hosts: all
tasks:
- action: template src=templates/custom-filters.j2 dest=/tmp/custom-filters.txt

View File

@ -0,0 +1,32 @@
---
# it is often useful to be able to set the environment for one command and have that environment be totally
# different for another. An example is you might use a HTTP proxy for some packages but not for others.
#
# in Ansible 1.1 and later, you can pass the environment to any module using either a dictionary variable
# or a dictionary itself.
- hosts: all
user: root
# here we make a variable named "env" that is a dictionary
vars:
env:
HI: test2
http_proxy=http://proxy.example.com:8080
tasks:
# here we just define the dictionary directly and use it
- shell: echo $HI
environment:
HI: test1
# here we are using the $env variable above
- shell: echo $HI
environment: $env

View File

@ -0,0 +1,53 @@
---
# This playbook is an example for deploying multiple instances into EC2/Euca and "doing something" with them.
# - uses the ec2 and ec2_vol module.
#
# Run this with ansible-playbook and supply the private key for your EC2/Euca user (to access the instance in the second play), e.g:
# ansible-playbook eucalyptus-ec2-deploy.yml -v --private-key=/path/to/ec2/pri/key
- name: Stage instance(s)
hosts: local
connection: local
user: root
gather_facts: false
vars:
keypair: mykeypair
instance_type: m1.small
security_group: default
image: emi-048B3A37
# Launch 5 instances with the following parameters. Register the output.
tasks:
- name: Launch instance
local_action: ec2 keypair=$keypair group=$security_group instance_type=$instance_type image=$image wait=true count=5
register: ec2
# Use with_items to add each instances public IP to a new hostgroup for use in the next play.
- name: Add new instances to host group
local_action: add_host hostname=${item.public_ip} groupname=deploy
with_items: ${ec2.instances}
# Use the ec2_vol module to create volumes for attachment to each instance. Use with_items to attach to each instance (by returned id) launched previously.
- name: Create a volume and attach
local_action: ec2_vol volume_size=20 instance=${item.id}
with_items: ${ec2.instances}
# This play targets the new host group
- name: Configure instance
hosts: deploy
user: root
gather_facts: True
# Do some stuff on each instance ....
tasks:
- name: Ensure NTP is up and running
action: service name=ntpd state=started
- name: Install Apache Web Server
action: yum pkg=httpd state=latest

View File

@ -0,0 +1,399 @@
{
"Outputs" : {
"ClusterSecGroup" : {
"Description" : "Name of RegionalManagerSecGroup",
"Value" : {
"Ref" : "InstanceSecurityGroup"
}
}
},
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Launches an example cluster",
"Mappings" : {
"ebs" : {
"ap-northeast-1" : {
"AMI" : "ami-4e6cd34f"
},
"ap-southeast-1" : {
"AMI" : "ami-a6a7e7f4"
},
"eu-west-1" : {
"AMI" : "ami-c37474b7"
},
"sa-east-1" : {
"AMI" : "ami-1e08d103"
},
"us-east-1" : {
"AMI" : "ami-1624987f"
},
"us-west-1" : {
"AMI" : "ami-1bf9de5e"
},
"us-west-2" : {
"AMI" : "ami-2a31bf1a"
}
},
"ephemeral" : {
"ap-northeast-1" : {
"AMI" : "ami-5a6cd35b"
},
"ap-southeast-1" : {
"AMI" : "ami-a8a7e7fa"
},
"eu-west-1" : {
"AMI" : "ami-b57474c1"
},
"sa-east-1" : {
"AMI" : "ami-1608d10b"
},
"us-east-1" : {
"AMI" : "ami-e8249881"
},
"us-west-1" : {
"AMI" : "ami-21f9de64"
},
"us-west-2" : {
"AMI" : "ami-2e31bf1e"
}
}
},
"Parameters" : {
"ClusterSize" : {
"Description" : "Number of nodes in the cluster",
"Type" : "String"
},
"DiskType" : {
"AllowedValues" : [
"ephemeral",
"ebs"
],
"Default" : "ephemeral",
"Description" : "Type of Disk to use ( ephemeral/ebs )",
"Type" : "String"
},
"InstanceType" : {
"AllowedValues" : [
"t1.micro",
"m1.small",
"m1.medium",
"m1.large",
"m1.xlarge",
"m2.xlarge",
"m2.2xlarge",
"m2.4xlarge",
"c1.medium",
"c1.xlarge",
"cc1.4xlarge"
],
"ConstraintDescription" : "must be valid instance type. ",
"Default" : "m1.large",
"Description" : "Type of EC2 instance for cluster",
"Type" : "String"
},
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the cluster",
"Type" : "String"
}
},
"Resources" : {
"ApplicationWaitCondition" : {
"DependsOn" : "ClusterServerGroup",
"Properties" : {
"Handle" : {
"Ref" : "ApplicationWaitHandle"
},
"Timeout" : "4500"
},
"Type" : "AWS::CloudFormation::WaitCondition"
},
"ApplicationWaitHandle" : {
"Type" : "AWS::CloudFormation::WaitConditionHandle"
},
"CFNInitUser" : {
"Properties" : {
"Path" : "/",
"Policies" : [
{
"PolicyDocument" : {
"Statement" : [
{
"Action" : [
"cloudformation:DescribeStackResource",
"s3:GetObject"
],
"Effect" : "Allow",
"Resource" : "*"
}
]
},
"PolicyName" : "AccessForCFNInit"
}
]
},
"Type" : "AWS::IAM::User"
},
"CFNKeys" : {
"Properties" : {
"UserName" : {
"Ref" : "CFNInitUser"
}
},
"Type" : "AWS::IAM::AccessKey"
},
"ClusterCommunication1" : {
"Properties" : {
"FromPort" : "-1",
"GroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"IpProtocol" : "icmp",
"SourceSecurityGroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"ToPort" : "-1"
},
"Type" : "AWS::EC2::SecurityGroupIngress"
},
"ClusterCommunication2" : {
"Properties" : {
"FromPort" : "1",
"GroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"IpProtocol" : "tcp",
"SourceSecurityGroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"ToPort" : "65356"
},
"Type" : "AWS::EC2::SecurityGroupIngress"
},
"ClusterCommunication3" : {
"Properties" : {
"FromPort" : "1",
"GroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"IpProtocol" : "udp",
"SourceSecurityGroupName" : {
"Ref" : "InstanceSecurityGroup"
},
"ToPort" : "65356"
},
"Type" : "AWS::EC2::SecurityGroupIngress"
},
"InstanceSecurityGroup" : {
"Properties" : {
"GroupDescription" : "Enable SSH access via port 22",
"SecurityGroupIngress" : [
{
"CidrIp" : "0.0.0.0/0",
"FromPort" : "22",
"IpProtocol" : "tcp",
"ToPort" : "22"
}
]
},
"Type" : "AWS::EC2::SecurityGroup"
},
"LaunchConfig" : {
"Properties" : {
"IamInstanceProfile" : {
"Ref" : "RootInstanceProfile"
},
"ImageId" : {
"Fn::FindInMap" : [
{
"Ref" : "DiskType"
},
{
"Ref" : "AWS::Region"
},
"AMI"
]
},
"InstanceType" : {
"Ref" : "InstanceType"
},
"KeyName" : {
"Ref" : "KeyName"
},
"SecurityGroups" : [
{
"Ref" : "InstanceSecurityGroup"
}
],
"UserData" : {
"Fn::Base64" : {
"Fn::Join" : [
"\n",
[
"#!/bin/bash -v",
"exec > >(tee /var/log/cfn-data.log|logger -t user-data -s 2>/dev/console) 2>&1",
"",
"sleep 10",
"",
"function retry {",
" nTrys=0",
" maxTrys=5",
" status=256",
" until [ $status == 0 ] ; do",
" $1",
" status=$?",
" nTrys=$(($nTrys + 1))",
" if [ $nTrys -gt $maxTrys ] ; then",
" echo \"Number of re-trys exceeded. Exit code: $status\"",
" exit $status",
" fi",
" if [ $status != 0 ] ; then",
" echo \"Failed (exit code $status)... retry $nTrys\"",
" sleep 10",
" fi",
" done",
"}",
"",
"yum update -y aws-cfn-bootstrap",
"",
"#for all the stuff that complains about sudo and tty",
"sed -i 's,Defaults requiretty,#Defaults requiretty,g' /etc/sudoers",
"",
"function error_exit",
"{",
{
"Fn::Join" : [
"",
[
" /opt/aws/bin/cfn-signal -e 1 -r \"$1\" '",
{
"Ref" : "ApplicationWaitHandle"
},
"'"
]
]
},
"}",
"yum update -y aws-cfn-bootstrap",
"#this runs the first stage of cfinit",
{
"Fn::Join" : [
"",
[
"#/opt/aws/bin/cfn-init -c ascending -v --region ",
{
"Ref" : "AWS::Region"
},
" -s ",
{
"Ref" : "AWS::StackName"
},
" -r ",
"LaunchConfig",
" --access-key ",
{
"Ref" : "CFNKeys"
},
" --secret-key ",
{
"Fn::GetAtt" : [
"CFNKeys",
"SecretAccessKey"
]
},
" || error_exit 'Failed to initialize client using cfn-init'"
]
]
},
"",
"",
"",
"result_code=$?",
{
"Fn::Join" : [
"",
[
"/opt/aws/bin/cfn-signal -e $result_code '",
{
"Ref" : "ApplicationWaitHandle"
},
"'"
]
]
}
]
]
}
}
},
"Type" : "AWS::AutoScaling::LaunchConfiguration"
},
"ClusterServerGroup" : {
"Properties" : {
"AvailabilityZones" : {
"Fn::GetAZs" : ""
},
"LaunchConfigurationName" : {
"Ref" : "LaunchConfig"
},
"MaxSize" : {
"Ref" : "ClusterSize"
},
"MinSize" : {
"Ref" : "ClusterSize"
}
},
"Type" : "AWS::AutoScaling::AutoScalingGroup"
},
"RolePolicies" : {
"Properties" : {
"PolicyDocument" : {
"Statement" : [
{
"Action" : "*",
"Effect" : "Allow",
"Resource" : "*"
}
]
},
"PolicyName" : "root",
"Roles" : [
{
"Ref" : "RootRole"
}
]
},
"Type" : "AWS::IAM::Policy"
},
"RootInstanceProfile" : {
"Properties" : {
"Path" : "/",
"Roles" : [
{
"Ref" : "RootRole"
}
]
},
"Type" : "AWS::IAM::InstanceProfile"
},
"RootRole" : {
"Properties" : {
"AssumeRolePolicyDocument" : {
"Statement" : [
{
"Action" : [
"sts:AssumeRole"
],
"Effect" : "Allow",
"Principal" : {
"Service" : [
"ec2.amazonaws.com"
]
}
}
]
},
"Path" : "/"
},
"Type" : "AWS::IAM::Role"
}
}
}

View File

@ -0,0 +1,29 @@
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
class FilterModule(object):
''' Custom filters are loaded by FilterModule objects '''
def filters(self):
''' FilterModule objects return a dict mapping filter names to
filter functions. '''
return {
'generate_answer': self.generate_answer,
}
def generate_answer(self, value):
return '42'

View File

@ -0,0 +1,35 @@
---
# Example playbook to demonstrate the group_by action plugin.
#
# as we know, the setup module will automatically run in each play, and sets up various
# facts. We can then create temporary (in memory only) groups based on those facts, which
# are useful ways of selecting similar sets of hosts.
#
# Additionally, we can use the 'register' keyword in Ansible to set similar variables
# and use those for grouping. This is not shown in this example.
- hosts: all
tasks:
- name: Create a group of all hosts by operating system
action: group_by key=${ansible_distribution}-${ansible_distribution_version}
# the following host group does not exist in inventory and was created by the group_by
# module.
- hosts: CentOS-6.2
tasks:
- name: ping all CentOS 6.2 hosts
action: ping
- hosts: CentOS-6.3
tasks:
- name: ping all CentOS 6.3 hosts
action: ping

View File

@ -3,7 +3,7 @@
- hosts: all
user: root
sudo: True
sudo: yes
tasks:

View File

@ -1,5 +1,5 @@
---
# see examples.yml first!
# see intro_example.yml first!
# This file explains some more advanced features of playbooks.
# because of the comments it's less concise than it normally is. But feel
# free to comment your playbooks if you like.
@ -42,7 +42,9 @@
# handlers can also be included from files, to promote reuse
# and simpler recipes, you may wish to only have one
# handler file for all your plays and playbooks
# handler file for all your plays and playbooks. This example really
# doesn't notify any handlers, it is just showing you how they would
# be included (see intro_example for usage).
- include: handlers/handlers.yml

View File

@ -13,7 +13,7 @@
# could have also have done:
# user: mdehaan
# sudo: True
# sudo: yes
# make these variables available inside of templates
# for when we use the 'template' action/module later on...

View File

@ -0,0 +1,10 @@
---
# this is a trivial example of how to do a nested loop.
- hosts: all
tasks:
- shell: echo "nested test a=${item[0]} b=${item[1]} c=${item[2]}"
with_nested:
- [ 'red', 'blue', 'green' ]
- [ 1, 2, 3 ]
- [ 'up', 'down', 'strange']

View File

@ -0,0 +1,20 @@
---
# in addition to loop_with_items, the loop that works over a variable, ansible can do more sophisticated looping.
# developer types: these are powered by 'lookup_plugins' should you ever decide to write your own
# see lib/ansible/runner/lookup_plugins/fileglob.py -- they can do basically anything!
- hosts: all
gather_facts: no
tasks:
# this will copy a bunch of config files over -- dir must be created first
- file: dest=/etc/fooapp state=directory
- copy: src=$item dest=/etc/fooapp/ owner=root mode=600
with_fileglob: /playbooks/files/fooapp/*

View File

@ -0,0 +1,25 @@
---
#
# NetScaler module example
#
- hosts: web-pool
serial: 3
vars:
nsc_host: nsc.example.com
nsc_user: admin
nsc_pass: nimda
# type of the netscaler object you want to manipulate
type: service
# netscaler object name
name: ${facter_fqdn}:8080
tasks:
- name: disable service in the lb
action: netscaler nsc_host=${nsc_host} user=${nsc_user} password=${nsc_pass} name=${name} type=${type} action=disable
- name: deploy new code
action: shell yum upgrade -y
- name: enable in the lb
action: netscaler nsc_host=${nsc_host} user=${nsc_user} password=${nsc_pass} name=${name} type=${type} action=enable

View File

@ -7,8 +7,8 @@
#
---
- hosts: webservers
sudo: True
gather_facts: False
sudo: yes
gather_facts: no
tasks:
- name: ensure apt cache is up to date
@ -21,9 +21,9 @@
- python-psycopg2
- hosts: webservers
sudo: True
sudo: yes
sudo_user: postgres
gather_facts: False
gather_facts: no
vars:
dbname: myapp
@ -36,3 +36,6 @@
- name: ensure user has access to database
action: postgresql_user db=$dbname user=$dbuser password=$dbpassword priv=ALL
- name: ensure user does not have unnecessary privilege
action: postgresql_user user=$dbuser role_attr_flags=NOSUPERUSER,NOCREATEDB

View File

@ -28,16 +28,18 @@
vars_prompt:
- name: "some_password"
prompt: "Enter password"
private: True
private: yes
- name: "release_version"
prompt: "Product release version"
private: False
default: "my_default_version"
private: no
- name: "my_password2"
prompt: "Enter password2"
private: True
private: yes
encrypt: "md5_crypt"
confirm: True
confirm: yes
salt_size: 7
salt: "foo"
@ -48,7 +50,7 @@
tasks:
- name: imagine this did something interesting with $release_version
action: shell echo foo >> /tmp/$release_version-$alpha
action: shell echo foo >> /tmp/$release_version-alpha
- name: look we crypted a password
action: shell echo my password is $my_password2

View File

@ -0,0 +1,39 @@
---
- hosts: rabbitmq
sudo: true
vars:
rabbitmq_version: 3.0.2-1
tasks:
- name: ensure python-software-properties is installed
apt: pkg=python-software-properties state=installed
- name: add rabbitmq official apt repository
apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main' state=present
- name: install rabbitmq
apt: pkg=rabbitmq-server=$rabbitmq_version state=installed force=yes
- name: enable rabbitmq plugins
rabbitmq_plugin: names=rabbitmq_management,rabbitmq_tracing,rabbitmq_federation state=enabled
notify:
- restart rabbitmq
- name: add users
rabbitmq_user: user=$item password=changeme tags=administrator,$item vhost=/ configure_priv=.* write_priv=.* read_priv=.* state=present
with_items:
- user1
- user2
- name: remove default guest user
rabbitmq_user: user=guest state=absent
- name: ensure vhost /test is present
rabbitmq_vhost: name=/test state=present
- name: set federation local-username
rabbitmq_parameter: component=federation name=local-username value='"user1"' state=present
handlers:
- name: restart rabbitmq
service: name=rabbitmq-server state=restarted

View File

@ -10,20 +10,19 @@
tasks:
# it is possible to save the result of any command in a named register. This variable will be made
# available to tasks and templates made further down in the execution flow. Here we save the result
# of a simple 'cat' command in a variable called 'motd_contents'
# available to tasks and templates made further down in the execution flow.
- action: shell cat /etc/motd
register: motd_contents
- action: shell grep hi /etc/motd
ignore_errors: yes
register: motd_result
# and here we access the register. Note that motd_contents as a variable is structured data because
# and here we access the register. Note that variable is structured data because
# it is a return from the command module. The shell module makes available variables such as
# as 'stdout', 'stderr', and 'rc'. Here's a rather trivial example that runs an arbitrary step
# if and only if the motd file contained the word 'hi'. Remember that only_if statements are
# Python expressions. This is as complicated as Ansible syntax is going to get, and the only
# time python really seeps into ansible's language.
# as 'stdout', 'stderr', and 'rc'.
# here we run the next action only if the previous grep returned true
- action: shell echo "motd contains the word hi"
only_if: "'${motd_contents.stdout}'.find('hi') != -1"
only_if: "${motd_result.rc} == 0"

View File

@ -19,4 +19,3 @@
- name: made up task just to show variables work here
action: command /bin/echo release is $release

View File

@ -0,0 +1 @@
1 + 1 = {{ '1+1' | generate_answer }}

View File

@ -1,2 +1,2 @@
# Cron job to git clone/pull a repo and then run locally
{{ schedule }} {{ cron_user }} ansible-pull -d {{ workdir }} -U {{ repo_url }} >/var/log/ansible-pull.log 2>&1
{{ schedule }} {{ cron_user }} ansible-pull -d {{ workdir }} -U {{ repo_url }} >>{{ logfile }} 2>&1

Some files were not shown because too many files have changed in this diff Show More