Compare commits

...

3715 Commits
0.8 ... v1.3.2

Author SHA1 Message Date
9d5d88b59f CHANGELOG update for the PTY patch inclusion 2013-09-19 11:08:45 -05:00
835bed906a fixes for PTY handling 2013-09-19 11:07:43 -05:00
a5c9d0b185 Version bump for 1.3.2 2013-09-19 11:01:32 -05:00
96bd107179 Minor change to -vvvv mode to only show debugging info for ssh conns
Also added this feature to the CHANGELOG

Conflicts:
	CHANGELOG.md
2013-09-19 10:50:11 -05:00
1541d309e1 Added support for -vvvv to enable ssh connection debugging
This patch also checks specifically for a return code of 255, which
indicates an unknown SSH error of some kind. When that happens, ansible
will now recommend running with -vvvv (if not enabled) or show the
output from 'ssh -vvv' (when it is enabled)
2013-09-19 10:43:41 -05:00
0d3596df9a Adding example section to ansible.cfg for the control_path setting 2013-09-19 10:43:36 -05:00
7ddc3db816 Make ssh's ControlPath configurable via ansible.cfg
This shouldn't generally be needed unless you're working in an environment
that uses rediculously long FQDNs; if the name is too long, you wind up
hitting unix domain socket filepath limits enforced by ssh.
2013-09-19 10:43:27 -05:00
962a316584 apt_repository: added option update_cache.
The default behavior is to update_cache if changed.

If you add more then one repo, you may not want to update cache for every repo separately.
So you can now disable update_cache with this new option e.g. update_cache=no

Updating cache can also be handled using the apt module.
2013-09-19 10:43:18 -05:00
936f45d160 apt_repository: fix update cache after state=changed. Closes GH-4136 2013-09-19 10:43:11 -05:00
cac9e02aea Version bump for 1.3.1 release 2013-09-16 05:27:23 -05:00
f0039f61e0 Set sudo in accelerate commands correctly
Fixes #4111
2013-09-16 05:20:22 -05:00
272bdebd25 Adding sshpass as a packaging requirement 2013-09-13 17:40:49 -05:00
507b78f379 Update specfile -- no need for node fireball package, release dates 2013-09-13 16:44:45 -05:00
8a2d2c239e Update releases.txt 2013-09-13 16:39:43 -05:00
554c55b85d Version bump for the new release 2013-09-13 15:07:41 -05:00
35d138a0d6 When checking conditionals, don't dereference when the variable contains dashes
Fixes #4104
2013-09-13 13:52:58 -05:00
d2bf244eb8 Merge branch 'fix_changed_for_yum_group' of https://github.com/hnakamur/ansible into hnakamur-fix_changed_for_yum_group 2013-09-11 16:47:58 -05:00
5110b2d440 Slight refactorization of the sysctl module
* Added in support for freebsd-style sysctl commands
* Replaced some functionality that was provided by module_common
* Simplified some logic in a couple of places (ie, not checking
  a split with len() but instead limiting the split to 1)

Fixes #3380
2013-09-11 13:15:17 -05:00
c6067edae6 Remove YAML inventory example. 2013-09-11 08:40:51 -04:00
3e9b63febd Compare exploded values in the sysctl module to avoid whitespace errors
Fixes #3931
2013-09-10 23:24:24 -05:00
b2741f451e Fixes to the service module for Ubuntu 12.04 (LTS)
Fixes #3615
Fixes #3572
2013-09-10 22:19:15 -05:00
9a3a3e648b Check for systemd ownership of a service even if an init.d script exists
Also slight modification to the error message in the earlier commit that
modified the update-rc.d detection portion of the code

Fixes #3474
2013-09-10 19:37:51 -05:00
4d2c2a262a Add an example for installing a group with the yum module. 2013-09-11 02:14:16 +09:00
caa68746ae Fix to getchanged correctly for yum groupinstall. 2013-09-11 02:10:53 +09:00
7c8aa669cf Minor fix to account for template service names in systemctl 2013-09-10 11:31:13 -05:00
6c3af4df81 Fix for update-rc.d based systems that also have systemd installed
By default, the service module had assumed that if the system had the
update-rc.d binary, the service was either managed via upstart or standard
sysV init-style scripts. This patch adds a check for systemctl ahead
of the other methods when update-rc.d is detected, and also simplifies
the logic around the detection of systemctl-managed services
2013-09-10 11:15:30 -05:00
808d9596b2 Fixing typos in is_keyid function definition and usage
Fixes #4068
2013-09-09 17:26:44 -05:00
b3c0e3e45e Revert "Styling: deprecation"
This reverts commit ecc2b6e742.

Fixes #4069
2013-09-09 15:17:43 -05:00
8d0487c31e Removing broken tests for now 2013-09-09 15:16:17 -05:00
75a9357e5e Fixing role variable precedence for top-level roles
Fixes #4026
Fixes #3989
2013-09-09 15:14:03 -05:00
294451d002 Correctly handle variable issues when evaluating jinja2 when statements
Fixes #4025
2013-09-09 14:50:21 -05:00
af139cd56a Merge branch 'file_fixes' of https://github.com/bcoca/ansible into bcoca-file_fixes 2013-09-09 10:29:11 -05:00
150dd230cc Merge branch 'kavink-devel' into devel 2013-09-09 10:22:03 -05:00
bcc2a4b513 Minor fix so the any_errors_fatal value is checked properly 2013-09-09 10:20:41 -05:00
4025695c00 Merge branch 'devel' of https://github.com/kavink/ansible into kavink-devel 2013-09-09 10:00:29 -05:00
59099b7607 Merge pull request #4065 from CharlesBlonde/nova_wait_for_bug
Nova_compute wait_for fixes
2013-09-09 07:48:21 -07:00
02171711fa Fix wait_for default value to follow the documentation (documentation = 180, default value = 120) 2013-09-08 23:52:40 +02:00
9a993992be Fix wait_for conversion between String to int 2013-09-08 23:49:33 +02:00
ddb09f11be Merge pull request #4059 from dekked/devel
Fixed -e "" on ansible-playbook.
2013-09-07 05:56:59 -07:00
c24f6f438b Avoid ugly formatting due to a long if statement 2013-09-06 22:37:17 -07:00
ebd8e262d3 Fixed -e "" on ansible-playbook. 2013-09-07 00:28:39 -03:00
6e9fa5019f Reverting HostVars change from a mapping back to a dictionary 2013-09-06 20:24:16 -05:00
f1eb5b45d9 Merge pull request #4056 from jlaska/libselinux-doc
The required package for selinux is libselinux-python
2013-09-06 18:08:40 -07:00
546788a1b6 The required package for selinux is libselinux-python 2013-09-06 16:26:48 -04:00
2c27aa63e0 Updating docs for max_fail_percentage plus CHANGELOG updates 2013-09-06 15:19:34 -05:00
7752a56091 Merge branch 'devel' of https://github.com/abompard/ansible into abompard-devel 2013-09-06 13:51:45 -05:00
71bf9495ef Merge branch 'fix_postgresql_db' of https://github.com/yteraoka/ansible into yteraoka-fix_postgresql_db 2013-09-06 13:26:01 -05:00
b65cefe893 Cleaning up pep8 whitepsace issues in the mysql_replication module 2013-09-06 12:50:50 -05:00
03e124d91f Merge branch 'bugfix' of https://github.com/jsmartin/ansible into jsmartin-bugfix 2013-09-06 12:47:27 -05:00
8c1ed028d3 Fixes for python 2.4 support, better collection of riak version. 2013-09-06 13:42:27 -04:00
3adb91a4b4 Added version_added to the mysql_variables module doc section 2013-09-06 12:32:08 -05:00
a57ced4b66 Merge branch 'mysql_variables' of https://github.com/banyek/ansible into banyek-mysql_variables 2013-09-06 12:25:52 -05:00
a56c695bc8 Added version_added to the mysql_replication module doc section 2013-09-06 12:23:41 -05:00
ff19cdae39 Merge branch 'mysql_replication' of https://github.com/banyek/ansible into banyek-mysql_replication 2013-09-06 12:10:31 -05:00
441062f061 Cleaning up whitspace issues in the mysql_user module 2013-09-06 10:51:53 -05:00
892c594319 Fixed #3767 - mysql_user command fails with dots (and underscores) in
database names.
2013-09-06 10:51:53 -05:00
19ac4e6da0 Merge pull request #3999 from sergevanginderachter/debversion
fix debian release version
2013-09-06 08:17:19 -07:00
4e9dee6093 Use StringIO to feed md5 calculation to prevent unicode issues
Fixes #4014
2013-09-06 09:11:47 -05:00
2a47f72139 Merge pull request #4049 from mscherer/fix_no_kerberos
Fix no kerberos
2013-09-06 07:10:10 -07:00
f489702973 Also add back gssapi-keyex
While this is not currently implemented in openssh as far as I know,
there is patch floating around on the web and this may land one day
upstream.
2013-09-06 10:40:34 +02:00
17c39b94a3 support GSSAPIAuth back
GSSAPIAuthentication has not been supported
due to PreferredAuthentications trick ( 2bdba17a85 )
2013-09-06 10:40:25 +02:00
aa0a31c0fc Merge pull request #3966 from sergevanginderachter/uribug
Fix bug in uri where redirect check fails.
2013-09-05 22:03:42 -07:00
82e1722fff Merge branch 'aix_wpar_facts' of https://github.com/mplonka/ansible into mplonka-aix_wpar_facts 2013-09-05 23:49:29 -05:00
84c977258f Merge branch 'rdsfixes' of https://github.com/jamespharaoh/ansible into jamespharaoh-rdsfixes 2013-09-05 23:47:32 -05:00
ae9e38daf8 Change hostvars to a mutable mapping to more closely resemble a dict
Fixes #4030
2013-09-05 23:04:16 -05:00
06090b5cb6 Merge pull request #4040 from ngrilly/devel
Update documentation about Jinja2 expressions in playbooks
2013-09-05 18:46:16 -07:00
4a30bac78b Corrected example for lineinfile due to ': ' on line
Closes #3992
2013-09-05 20:37:54 -05:00
c093bd4f4f Merge pull request #3975 from jimi1283/role_defaults_docs
Adding documentation for role default variables
2013-09-05 18:33:22 -07:00
2cbf28385a Move check for accelerate mode deeper to account for ansible_connection
Fixes #4045
2013-09-05 20:20:25 -05:00
5a949dcafc Module postgresql_privs: fix default arguments
Defaults arguments must not be added to the connection keywords, as
the other postgresql modules already do.

Closes #4043
2013-09-06 00:17:49 +02:00
20b0dc4abd Check for an empty executable passed into the accelerate plugin
This was breaking at least the script module, so it would seem best
to check for it and set it to the default executable value
2013-09-05 15:11:26 -05:00
aaafd9b608 Update documentation about Jinja2 expressions in playbooks 2013-09-05 21:38:34 +02:00
4bf506f683 Always run the accelerate module as the user specified in the play
Currently, the accelerate daemon will be run as the sudo_user if
specified, which is incorrect.
2013-09-05 12:04:48 -05:00
f04af9118e When putting a file in accelerated mode, make sure it's chowned correctly 2013-09-05 12:04:08 -05:00
68bffb1233 Don't force accelerate connection for local actions. 2013-09-05 09:37:47 -06:00
f6e1bdabea Ensure ports are set correctly in accelerate module 2013-09-05 09:52:10 -05:00
eae0cb5d81 Merge pull request #4029 from guersam/patch-1
Fix: raise correct error in accelerate mode
2013-09-05 06:44:52 -07:00
64db327411 Fix: raise correct error in accelerate mode 2013-09-05 15:10:45 +09:00
43464b6243 fix get_db_info
using pg_roles instead of pg_user
if database owner is a role (not user) then it can not select form pg_user table.
2013-09-05 12:40:16 +09:00
7e849ac7e0 Merge pull request #4015 from sergevanginderachter/changeflatlog
fix flattened plugin name in changelog
2013-09-04 18:47:07 -07:00
a075ec9831 Bug fix for a crash, when any_errors_fatal is true
Reported by Rumen:

TASK: [fail FAIL] *************************************************************
skipping: [hostname.com]
failed: [hostname.com] => {"failed": true}
msg: Failed as requested from task
Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 268, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/bin/ansible-playbook", line 208, in main
    pb.run()
  File "/Library/Python/2.7/site-packages/ansible/playbook/__init__.py", line 262, in run
    if not self._run_play(play):
  File "/Library/Python/2.7/site-packages/ansible/playbook/__init__.py", line 580, in _run_play
    if (hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count):
TypeError: object of type 'NoneType' has no len()
2013-09-04 18:30:33 -07:00
fff497a1ae Make sure the accelerated port is set to a sane value 2013-09-04 15:52:39 -05:00
cc21e5c90c Adding hostvars to injected variables in accelerate ssh runner
Also some minor cleanup of some fb* variables and functions, which
were remnants of the old fireball2 name

Fixes #4021
2013-09-04 15:29:46 -05:00
7b13b1e03e Minor fix to dependency dupe patch 2013-09-04 11:26:49 -05:00
16258edd7a Merge branch 'devel-duplicates2' of https://github.com/smoothify/ansible into smoothify-devel-duplicates2 2013-09-04 10:13:06 -05:00
a202adcae1 Merge branch 'doublecallback' of https://github.com/sergevanginderachter/ansible into sergevanginderachter-doublecallback 2013-09-04 09:58:06 -05:00
5337397abd Second Attempt: Ensure duplicate roles are not loaded in the case of a missing meta/main.yml file. 2013-09-04 15:50:39 +01:00
c0fecf87d1 Increase default socket timeout to 5 minutes 2013-09-04 09:47:40 -05:00
2c6baf6845 Merge branch 'devel-duplicates' of https://github.com/smoothify/ansible into smoothify-devel-duplicates 2013-09-04 08:54:56 -05:00
0411ea2867 Ensure duplicate roles are not loaded in the case of a missing meta/main.yml file. 2013-09-04 12:38:42 +01:00
82ed1b8d97 Updated CHANGELOG with accelerated mode/role defaults updates 2013-09-04 04:49:46 -05:00
1de6094d22 fix flattened plugin name in changelog 2013-09-04 09:10:23 +02:00
d27372ff08 Modified ec2_elb doc per issue #3849 2013-09-03 16:13:25 -05:00
4eedfa46a2 Merge branch 'devel' of https://github.com/mhite/ansible into mhite-devel 2013-09-03 15:05:13 -05:00
2e49d2003d Fix bug where accelerate keyword was not checked for boolean value
The play was just checking for the presence of the keyword in the
YAML datastructure, and not the value of the field, so doing something
like variable substitution was always causing the play to be accelerated
2013-09-03 14:20:56 -05:00
2696135b3b Display error during launch of accelerated daemon
* also minor tweak to the # of retries in the connection attempt

Fixes #4012
2013-09-03 12:28:32 -05:00
8a016bb374 Adding the facility to the accelerate daemon syslog calls 2013-09-03 11:30:29 -05:00
7c1c9b3d10 Fix message in utils related to python-keyczar and fireball/acc mode 2013-09-03 11:16:50 -05:00
53c2f4c1bb Fix race condition on creating the temp directory for ControlPersist
Fixes #3943
2013-09-03 11:00:33 -05:00
26a8d4ce9f Added 'reloaded' state to list of states checked for bounced services
Fixes #3556
2013-09-03 09:49:19 -05:00
ff203dda45 Adding docs for the new accelerated mode 2013-09-02 23:08:00 -05:00
d05c61d1f0 Merge branch 'devel' into fireball2
Conflicts:
	lib/ansible/playbook/__init__.py
	lib/ansible/playbook/play.py
2013-09-02 21:54:02 -05:00
50f54f6bda Making variable names more descriptive for the default variables work 2013-09-02 21:37:50 -05:00
02b7b79d7e Re-adding capability of tasks to see a unique view of their own defaults 2013-09-02 21:37:50 -05:00
8abb49bd78 fix debian release version 2013-09-02 21:32:16 +02:00
137a32ca36 make rds handle vpc security groups properly 2013-09-02 20:40:41 +02:00
dc5ffb688c fix for rds region variable 2013-09-02 20:40:32 +02:00
6dd3505c9e Merge pull request #3987 from succhiello/feature/fix_extra_vars_json_docs
fix JSON extra vars quotation.
2013-09-02 09:59:06 -07:00
266d2008d8 Reverting the role default variables change
Loading the default variables in _build_role_dependencies() lead to
a side-effect where those variables were over-riding inventory variables.
2013-09-01 08:53:59 -05:00
47a89a57fa Fixing bug in playbook use of default variables in roles 2013-09-01 08:49:41 -05:00
633eda957d fix JSON extra vars quotation. 2013-09-01 22:36:30 +09:00
e0df5b5888 A couple more tweaks to role default variables/dependencies
* Default variables are now fed directly into roles, just like the
  other variables, so that roles see their unique values rather
  than those set at the global level.

* Role dependency duplicates are now determined by checking the params used
  when specifying them as dependencies rather than just on the name of the
  role. For example, the following would be included twice without having
  to specify "allow_duplicates: true":

  dependencies:
  - { role: foo, x: 1 }
  - { role: foo, x: 2 }
2013-09-01 00:43:16 -05:00
6f76ccf10e Merge pull request #3981 from jerm/devel
Adding regions_exclude parameter to be able to do subtractive region exc...
2013-08-31 17:00:38 -07:00
ad75350919 adding regions_exclude parameter to be able to do subtractive region exclusion. Defaults to us-gov-west-1 so as to not cause errors for people who don't have govcloud credentials but get it in their regions list 2013-08-31 17:58:37 -04:00
d69d5c294f Renaming fireball2 as 'accelerate' and removing old references 2013-08-30 13:26:27 -05:00
736c8b19d3 Added ability to limit role dependencies to just one inclusion 2013-08-30 12:42:27 -05:00
8bfba5c0b4 Adding documentation for role default variables 2013-08-30 10:13:22 -05:00
6f6efa268b Merge branch 'smoothify-defaults' into devel 2013-08-30 08:40:47 -05:00
25e3eed519 Fixing a bug in variable precedence for roles and dependencies 2013-08-30 01:20:45 -05:00
637d3070dc Allow default variables to be overridden by inventory variables 2013-08-29 17:21:28 -05:00
9806f89a04 Revert "Construct the multiprocessing manager only once."
This reverts commit 1d13ec2da3.
2013-08-29 11:00:25 -05:00
a311ee35b3 Fix bug in uri where redirect check fails.
When the redirect check fails, the 'status' key is not set in
resp_redir, so we need to check this.
2013-08-29 15:58:01 +02:00
7d3ae9fc75 Fixing a few bugs related to fireball2
* ssh port not being picked up, always uses default of 22
* forgot to 'import time' in the fireball2 connection plugin
2013-08-28 19:27:18 -05:00
f66683863e Merge branch 'defaults' of https://github.com/smoothify/ansible into smoothify-defaults 2013-08-28 16:24:37 -05:00
39fe40bb60 Merge pull request #3953 from melodous/issue-3908
Fix issue 3908. There was some ilegal operations over the sets
2013-08-28 14:01:38 -07:00
1772b1b203 Merge pull request #3963 from djoreilly/quantum-net-doc
quantum_network: fix some doc mistakes
2013-08-28 13:53:03 -07:00
993413e706 quantum_network: fix some doc mistakes
- tenant_name was missing.
- comments were on wrong tasks.
- error message had a reference to glance.
2013-08-28 21:19:24 +01:00
faf82bf841 Fix bug with fetch when using sudo: true
Fixes #3111
2013-08-28 13:24:16 -05:00
af1dd7075f Adding chunked file transfers to fireball2 2013-08-28 11:14:58 -05:00
959138d00d Added accelerate_port to plays, and made it configurable 2013-08-28 11:14:58 -05:00
167f185092 Initial support for running gather_facts through fireball2 2013-08-28 11:14:58 -05:00
b45342923c Initial support for sudoable commands over fireball2
Caveats:
* requiretty must be disabled in the sudoers config
* asking for a password doesn't work yet, so any sudoers users must
  be configured with NOPASSWD
* if not starting the daemon as root, the user running the daemon
  must have sudoers entries to allow them to run the command as the
  target sudo_user
2013-08-28 11:14:58 -05:00
4b552457e7 Bail out correctly if socket.recv gets nothing (indicating a closed socket) 2013-08-28 11:14:58 -05:00
86f01965cd Fireball2 module will now launch in a proper tmp path 2013-08-28 11:14:58 -05:00
521e14a3ad Fireball2 mode working! 2013-08-28 11:14:58 -05:00
acc5d09351 Initial commit for the "fireball2" connection plugin
Still needs:
* chunked file transfer/receive
* should probably move all send/recv operations to separate
  functions to reduce code duplication
* initial connection setup over ssh? or do we handle that in runner?
2013-08-28 11:14:58 -05:00
fd2aabaa27 Initial work for the AES cipher class
This is based somewhat loosely on how Keyczar does things. Their
implementation does things in a much more generic way to allow for more
variance in how the cipher is created, but since we're only using one
key type most of our values are hard-coded. They also add a header to
their messages, which I am not doing (don't see the need for it
currently).
2013-08-28 11:14:58 -05:00
ffb4d480cf Merge pull request #3956 from jlafon/cloudformation
The cloudformation module argument spec should match the documentation.
2013-08-28 07:29:35 -07:00
be57d7cc99 The cloudformation module argument spec should match the documentation, so that template_parameters is a required argument. 2013-08-27 15:09:30 -06:00
461858e476 Fix issue 3908. There was some ilegal operations over the sets 2013-08-27 17:07:42 +02:00
8ec806905d Merge pull request #3942 from jocelynj/gem
Correctly handle option user_install in gem module
2013-08-27 06:00:06 -07:00
4ca5db0a57 Merge pull request #3861 from djoreilly/quantum_net_types
quantum_network should not default network provider type to local
2013-08-27 05:57:21 -07:00
cce7f485b8 Merge pull request #3946 from wincent/spelling-fix
Fix minor typo in playbook error message
2013-08-25 17:23:30 -07:00
fc4307a9c4 Fix minor typo in playbook error message 2013-08-25 11:29:07 -07:00
88966e6558 Use AnsibleError instead of exit for errors in utils 2013-08-25 11:46:45 -05:00
a8984a6b2b Minor text corrections in the yum module documentation 2013-08-24 21:46:41 -05:00
7625f40f99 Merge pull request #3941 from hnakamur/update_yum_doc_for_name_accepts_url_and_path
Add description and examples for the name parameter accepts a url or a l...
2013-08-24 19:43:33 -07:00
ceddc37f07 Fix for the cron module on FreeBSD
Apparently crontab on freebsd does not like the file path coming before
the "-u username" portion of the command to install the crontab
2013-08-24 21:37:10 -05:00
f958a5ac81 Correctly handle option user_install in gem module 2013-08-24 22:49:18 +02:00
aa9e05baa2 Add description and examples for the name parameter accepts a url or a local path to a rpm file. 2013-08-25 02:30:41 +09:00
4a3b762afe Update URLs and email address in setup.py 2013-08-24 11:25:02 -04:00
61298e4703 Skipping facts not available on AIX WPARs 2013-08-24 07:24:05 +02:00
a0447a5243 Merge branch 'bpennypacker-rb2' into devel 2013-08-23 20:19:40 -05:00
2f6dcfe36f Fixed small typo from the merge conflict in the route53 module 2013-08-23 13:40:57 -05:00
7d69d1e289 Merge branch 'rb2' of https://github.com/bpennypacker/ansible into bpennypacker-rb2 2013-08-23 13:07:48 -05:00
80ddb1aee6 Added wait parameter 2013-08-23 13:56:59 -04:00
bb75050912 Merge branch 'rb2' of https://github.com/bpennypacker/ansible into bpennypacker-rb2
Conflicts:
	library/cloud/route53
2013-08-23 11:36:45 -05:00
deb5f027f0 Fixed up a few other pages that had the same versionadded error 2013-08-23 11:33:57 -05:00
f8a54d162d Fixing versionadded fields in the playbook doc 2013-08-23 11:04:06 -05:00
4dc209f731 Merge branch 'add_tests_inventory' of https://github.com/mscherer/ansible into mscherer-add_tests_inventory 2013-08-23 08:52:02 -05:00
a0b73b18c3 add one last test, for combined range, which make ansible.inventory.expand_hosts
covered to 100%
2013-08-23 13:06:31 +02:00
64d35cb3b6 test that using non ordered range of char send a exception 2013-08-23 12:58:10 +02:00
4f69b63fec add test for incorrect format in range host 2013-08-23 12:51:17 +02:00
835fdd1ec2 add test for missing end in host range 2013-08-23 12:42:26 +02:00
2aea8a6368 add a test to verify ansible detect invalid range 2013-08-23 12:29:38 +02:00
7fec9c3eba add a test to cover bound stepping in inventory 2013-08-23 12:00:39 +02:00
f40d39bc92 Minor formatting change 2013-08-22 23:35:23 -05:00
e1b1d09210 Remove references to old-style variables
Fixes #3842
2013-08-22 23:33:18 -05:00
1f42fd9964 Remove references to old-style variables
Fixes #3842
2013-08-22 23:29:13 -05:00
8262f7bfac Merge branch 'with_items_and_complex_args' of https://github.com/lberruti/ansible into lberruti-with_items_and_complex_args 2013-08-22 23:01:11 -05:00
c4a7b1d2d2 Another CHANGELOG update 2013-08-22 22:08:05 -05:00
d9be910e6e Merge branch 'exit-3-on-dark' of https://github.com/j2sol/ansible into j2sol-exit-3-on-dark 2013-08-22 22:03:34 -05:00
c32467b5ab CHANGELOG updates for the 1.3 release 2013-08-22 21:26:03 -05:00
1d98e7bc05 Cleaning up some pep8 issues in the pkgutil module 2013-08-22 20:21:02 -05:00
b33cd0c44f Added a note in the advanced playbooks section regarding YAML extra vars 2013-08-22 20:18:15 -05:00
8c9f84f6f8 Parse --extra-vars as YAML (which includes JSON) 2013-08-22 16:43:15 -07:00
dfbe1132d2 Merge branch 'allow_wildcard_yum' of https://github.com/mscherer/ansible into mscherer-allow_wildcard_yum 2013-08-22 16:20:10 -05:00
268f171ee4 Merge branch 'feature/zabbix-inventory' of https://github.com/resmo/ansible into devel 2013-08-22 16:03:17 -05:00
308026f234 improved zabbix inventory. added sys.exit(1) where needed, added some exception handling. 2013-08-22 23:02:32 +02:00
7bd8c18fa7 Merge branch 'gitfix' of https://github.com/johanwiren/ansible into johanwiren-gitfix 2013-08-22 15:30:58 -05:00
c2f8215c06 ec2 inventory: Verify that a security group exists before trying to use its name as a key in inventory. 2013-08-22 15:29:15 -05:00
20a57dcdcb Merge pull request #3917 from resmo/fix/openshift-inventory-shebang
fixed shebang in openshift inventory
2013-08-22 13:12:14 -07:00
dcd556b92f Fixed so that we no longer check with the remote if a checkout already is at the desired sha version. 2013-08-22 22:05:37 +02:00
791a2d5757 fixed shebang in openshift inventory 2013-08-22 22:02:02 +02:00
12f2caeed6 Merge branch 'pacman_local_plus_check' of https://github.com/mivok/ansible into mivok-pacman_support_check_mode 2013-08-22 14:45:54 -05:00
de4ed11fa6 Merge branch 'pacman_support_check_mode' of https://github.com/mivok/ansible into mivok-pacman_support_check_mode 2013-08-22 14:29:56 -05:00
e11bb0cad4 Merge branch 'plugins-work' of https://github.com/ferringb/ansible into ferringb-plugins-work 2013-08-22 14:23:25 -05:00
462cd4f728 Merge branch 'pulls/fix-hostvars-inconsistancy' of https://github.com/ferringb/ansible into ferringb-pulls/fix-hostvars-inconsistancy 2013-08-22 13:56:34 -05:00
7f37f8fddd Merge branch 'feature/zabbix-inventory' of https://github.com/resmo/ansible into resmo-feature/zabbix-inventory 2013-08-22 13:05:45 -05:00
1dd3ff3879 Added Overwrite option for Route53 record creation 2013-08-22 12:46:20 -05:00
e6ad3b7792 Merge pull request #3895 from mscherer/fix_option_new_ssh
make sure ssh do not ask password
2013-08-22 10:26:54 -07:00
157b697a83 Merge branch 'always_run-6' of https://github.com/stoned/ansible into stoned-always_run-6 2013-08-22 12:10:28 -05:00
abac720255 Merge branch 'command-relpath' of https://github.com/j2sol/ansible into j2sol-command-relpath 2013-08-22 11:16:51 -05:00
d9d49cf182 Merge branch 'add_tests' of https://github.com/mscherer/ansible into mscherer-add_tests 2013-08-22 10:41:19 -05:00
10de5c8fe3 Merge pull request #3913 from jlund/ec2-typos
Fixing typo in EC2 modules
2013-08-21 22:04:57 -07:00
21d2069a74 Support multiple --extra-vars flags 2013-08-22 00:01:52 -05:00
af4f0bd008 Fix for "argument must be an int, or have a fileno() method" error
The issue was that, when forks == 1, the _executor() function was
being called with None for the value of new_stdin.

Fixes #3841, #3902
2013-08-21 22:45:34 -05:00
12a0a01cb0 Update releases 2013-08-21 22:51:12 -04:00
d9152eb583 Update changelog 2013-08-21 22:50:52 -04:00
8eadd1c7ba Merge pull request #3915 from jlund/changelog-cleanup
Minor cleanup of CHANGELOG for 1.3
2013-08-21 18:42:29 -07:00
73fd9d9687 Minor cleanup of CHANGELOG for 1.3 2013-08-21 19:09:23 -06:00
654b37f212 Fixing typo in EC2 modules 2013-08-21 18:13:05 -06:00
978af89175 Disallow running async tasks with lookup plugins
Fixes #2897
2013-08-21 16:44:10 -05:00
e09ce0a3a7 Commenting out default ssh arguments line in ansible.cfg
Also removing the ControlPath option, as it will now be auto-generated
if the ControlPersist option is set in the arguments.
2013-08-21 11:40:46 -05:00
ed3e4aff84 Place retry file in the user's home dir instead of /var/lib/tmp
Addresses CVE-2013-4260: predictable filename used for failed results
in world writable directory.
2013-08-21 11:40:46 -05:00
6bf5d19506 SSH connection plugin creates ControlPersist socket files in a secure directory
Files were being created in /tmp, but will now be created in $HOME/.ansible/cp/
Addresses CVE-2013-4259: ansible uses a socket with predictable filename in /tmp
2013-08-21 11:40:46 -05:00
ddd582269c increase test coverage of inventory by around 5% according to nose 2013-08-21 08:03:41 +02:00
36ca709849 Allow for relative paths by using abspath
relative pathing comes in handy on occasion, particularly when
delegating to localhost and running some command out of your playbook
repo. Making use of os.path.abspath will allow for the full path to
chdir and executable to be discovered if not provided.
2013-08-20 22:48:42 -07:00
ae98a025bb Minor doc fixes for the pkgutil module 2013-08-20 21:08:56 -05:00
59c7ef2afa Added module pkgutil 2013-08-20 21:08:56 -05:00
f0743fc32a Introduce the 'always_run' task clause.
The 'always_run' task clause allows one to execute a task even in
check mode.

While here implement Runner.noop_on_check() to check if a runner
really should execute its task, with respect to check mode option
and 'always_run' clause.

Also add the optional 'jinja2' argument to check_conditional() :
it allows to give this function a jinja2 expression without exposing
the 'jinja2_compare' implementation mechanism.
2013-08-20 23:09:44 +02:00
2bdba17a85 make sure ssh do not ask password
For some reason, ssh seems to ask for password even when
PasswordAuthentication is set to no, adding PreferredAuthentications
with the 2 options removed do the trick.
2013-08-20 22:02:37 +02:00
2e20387671 yet another rebase attempt 2013-08-20 15:15:58 -04:00
0f458210bc Rebase attempt
No idea if I'm rebasing properly or not.  This is my first attempt.
2013-08-20 15:14:16 -04:00
7ac3bbc198 resolved #3609 Change max_fail_pct to max_fail_percentage as recommended 2013-08-20 13:55:34 -05:00
3f247fcbe3 fixes ansible/ansible#3609 Add max_fail_pct to playbook parameter, to complement serial option, So if total number of failures execeed max_fail_pct * total number of hosts, do not go to the next serial batch 2013-08-20 13:55:22 -05:00
2dd3f01513 Merge pull request #3893 from jonw/devel
docsite typos
2013-08-20 11:45:30 -07:00
77b8ee1f84 Update ansible-pull man page doc (issue #3372) 2013-08-20 13:43:26 -05:00
cc3651592b Extend ansible-pull to support other source repositories
This extends ansible-pull so that it can support using other
source_control modules for checking out a playbook repository
(issue #3372).  This will check to see if the module exists before
it attempts to do the checkout and will exit if the module is not found.
It requires that the module used to check out the repository support the
parameters 'name' and 'version'.  The option -C, --checkout is now
optional and defaults to the module's default behavior for selecting a
branch, tag, or commit value.  For git, this continues to be HEAD.

Other changes include:
* Remove git from help and use generic term(s) where needed.
* Use SortedOptParser from ansible.utils
* More abstraction of common options used between ansible and
  ansible-playbook.
2013-08-20 13:43:26 -05:00
cc58403e48 Apply consistent parameter alises to hg and subversion
For issue #3372, apply consistent parameter aliases to source_control
modules.  For hg, add name and version and add to documentation string.
For subversion, add version and document version and name aliases in
documentation string.
2013-08-20 13:43:26 -05:00
d000f23344 typo
just darting a mistyped "ansible"
2013-08-20 12:11:51 -05:00
c4ab7009b2 minor corr pip-install
perhaps there may be pip distribution using "pip-install" but "pip install" is universal afaik
2013-08-20 11:39:04 -05:00
494043947d Add support for role defaults. These are variables on a per role basis with lowest precedence. 2013-08-20 10:11:39 +01:00
49b0ff18a7 Missed some typos in macros for the xattr doc 2013-08-20 00:50:56 -05:00
230077fda9 Fixing docs in xattr module 2013-08-20 00:47:07 -05:00
e3adfbf5f8 Add tests for undefined variable detection
Tests `test_playbook_undefined_varsX_fail` check if ansible detects
undefined variables when `error_on_undefined_vars` is enabled. These
tests fail without "Improve behavior with error_on_undefined_vars
enabled" patch.

Tests `test_playbook_undefined_varsX_ignore` check if ansible ignores
undefined variables when `error_on_undefined_vars` is disabled.

Also modify PlayBook._run_task_internal() so error_on_undefined_vars is
testable.
2013-08-20 00:40:49 -05:00
fff4f1da33 Improve behavior with error_on_undefined_vars enabled
Pass fail_on_undefined flag to recursive calls to `template` function,
so more undefined variables are detected.

Works only for Jinja style variables. Undefined legacy variables are
never detected.
2013-08-20 00:40:49 -05:00
31061213fa Fix inconsistency in hostvars access.
Previously, hostvars would only expose a keys() list of hosts that had
been seen yet- however you could explicitly access the host if you knew
the name, and get the content that way.  This precludes template code
from being able to safely access information about other hosts if any
limiters/tags were in use.

Additionally, the object was inconsistent for hostvars['myhost'] access
and [x[1] for x in hostvars.items() if x[0] == 'myhost'] access; this is
due to the original derivation from the dict object.  .items() would be
handled by dict.items(), using the passed in setup_cache values without
using the actual lookup content.

This patch rebases the class implementation to a py2.6 dictmixin, fixing
those issues and restoring behaviour to match what the docs claim.
2013-08-19 23:57:08 -04:00
902183ac0e Enforce alphanumeric ordering for plugins grabbed via glob.
If this isn't done, it's left to directory ordering which can result
in indeterminent behaviour.
2013-08-19 19:48:17 -04:00
0747d41e76 Cleaning up some typos in the xattr module 2013-08-19 16:08:32 -05:00
5e4f9657ca Merge branch 'xattr2' of https://github.com/bcoca/ansible into bcoca-xattr2 2013-08-19 15:42:51 -05:00
39628d012d Minor fix to ipv6 detection for inventory with -i
For link-local addresses, it is sometimes necessary to append the
interface to use for the ipv6 address. This patch extends the ipv6
regex to allow for '%ifnameX' at the end.

See https://bugzilla.redhat.com/show_bug.cgi?id=136852 for more info
2013-08-19 15:27:21 -05:00
b655d5798b add tests for the -i option when used with raw string for ipv4
and ipv6 addresses.
2013-08-19 15:27:21 -05:00
3aac187387 fix ssh connection plugin to work with ipv6 address
Due to various inconsistencies of ssh and sftp regarding ipv6 and
ipv4 handling, some special arguments must be passed, and the
ipv6 must be passed in a specific format.
2013-08-19 15:27:20 -05:00
c9d28e10ad add support for using a ipv6 in -i
testing with a ipv6 :
  ansible -u misc -i  '[2002::c23e]:22,' '*' -m ping

fail due to parsing of ':' as a separator of port/ip with ipv4.
This commit add support for properly parsing 2002::c23 and the
bracket notation [2002::ce]:2222
2013-08-19 15:27:20 -05:00
1509e995df Merge pull request #3874 from mscherer/relax_nova_compute_argument
image_id is not required to delete a vm from openstack
2013-08-19 12:16:04 -07:00
8e23d509d3 Merge pull request #3885 from tidzo/devel
Fixed tiny bug with _meta handling in external inventory scripts
2013-08-19 12:08:48 -07:00
a39aa57c5c Fixing small typo in redis module documentation 2013-08-19 14:04:58 -05:00
17aa738872 Merge branch 'redis-config' of https://github.com/slok/ansible into slok-redis-config 2013-08-19 13:35:31 -05:00
9fd1b174f5 Fixed tiny bug with _meta handling in external inventory scripts 2013-08-19 18:54:30 +01:00
77b98df63b Minor fix, vpc_id is not required for the ec2_group 2013-08-19 11:38:06 -05:00
58e85855e4 Add module to control EC2 security groups 2013-08-19 11:38:06 -05:00
500e6fa374 Added Zabbix inventory plugin 2013-08-19 16:40:40 +02:00
00256af5bd Merge pull request #3878 from sjahl/apt_repository-perms-fix
setting 0644 permissions on mkstemp file handles. Fixes issue #3857
2013-08-18 13:17:14 -07:00
4dd68c07a0 setting 0644 permissions on mkstemp file handles. Fixes issue #3857 2013-08-18 11:03:43 -04:00
a347bfa2bb Merge branch 'pacman_local' into pacman_local_plus_check
Conflicts:
	library/packaging/pacman
2013-08-17 17:56:33 -04:00
0419fb74bb Support check mode with pacman module 2013-08-17 17:44:41 -04:00
f52a1c8f46 Allow installation of local packages with pacman 2013-08-17 14:46:16 -04:00
472654447c Allow to use '*test*' in enablerepo for yum action
Yum commandline permit to use a wildcard to enable and disable
repositories in the --enablerepo switch, permitting to enable
a complete set of repository at once ( like all rpmfusion, all
update-testing, etc ).

However, this doesn't work in yum due to more stringent checks
that verify that a exact match is given for the name of the
repository , see commit 5c26805.

This commit enhance the check by permitting to test more than
1 repository at a time, thus permitting to use wildcards.
2013-08-17 18:43:53 +02:00
3f158a4688 image_id is not required to delete a vm from openstack
Since deletion do not check the type of image or anything,
and since that's tedious to keep track of the image_id and
just adding noise to add image_id for nothing, this commit
just relax the requirement.
2013-08-17 17:56:19 +02:00
5847720746 Fixing a small bug with the new role dependency feature
The block that added the original list of roles was indented too far,
and was only being reached if a role had dependencies. This resulted
in roles without dependencies from being added to the list of roles.

Credit goes to looped for reporting and diagnosing the issue.
2013-08-17 00:06:24 -05:00
5452f0062b Updated changelog 2013-08-16 22:14:15 -04:00
15e2ccd2d9 Moving some role deps stuff around a small amount. 2013-08-16 22:05:26 -04:00
42648e2f0a Merge branch 'role_dependencies' of git://github.com/jimi1283/ansible into jimi1283-role_dependencies 2013-08-16 21:42:57 -04:00
0eb1827936 Some install guide tweaks. 2013-08-16 17:02:35 -04:00
f2ec0d5ff2 Update changelog 2013-08-16 15:24:33 -04:00
dacd311474 Removing synchronize momentarily as it looks like this won't make 1.3 dates 2013-08-16 15:22:39 -04:00
5429586985 Adding documentation on role dependencies and variable scope/inheritance 2013-08-16 10:34:45 -05:00
33810c60cd Merge pull request #3867 from bcoca/pingdom_nicer_import_error
now missing dep gives nicer error and docs disambiguate lib
2013-08-16 04:45:48 -07:00
49d7f22db8 now correctly detects hard links
simplified check_mode
simplified other file attribute handling in link mode
made conditionals clearer

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-08-15 23:39:02 -04:00
d8a7a2d1b2 Adding evaluation of role vars as the dep tree is built
This allows variables to be inserted into the role scope specifically
while also being inserted into the global scope.
2013-08-15 20:53:23 -05:00
52dd1dd4c5 now missing dep gives nicer error and docs disambiguate as several libs
out there have same name.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-08-15 21:26:35 -04:00
fb42efc355 quantum_network should not default network provider type to local
It should allow the Quantum service to decide based on its configuration.
2013-08-15 19:51:22 +01:00
e12b99dba6 Small cleanup, no need to call _get_role_path a second time 2013-08-15 09:29:51 -05:00
9a401e73a6 Adding support for role dependencies.
Fixes #3686

Dependencies are enabled by adding a new directory/file named
meta/main.yml to the role. The format of the dependencies are:

dependencies:
- { role: foo, x: 1, y: 2 }
- { role: bar, x: 3, y: 4 }
...

Dependencies inherit variables as they are seen at the time of the
dependency inclusion. For example, if foo(x=1, y=2) has a dependency
on bar(x=3,z=4), then bar will have variables (x=3,y=2,z=4).

Different roles can have dependencies on the same role, and this
variable inheritence allows for the reuse of generic roles quite easily.
For example:

Role 'car' has the following dependencies:
dependencies:
  - { role: wheel, n: 1 }
  - { role: wheel, n: 2 }
  - { role: wheel, n: 3 }
  - { role: wheel, n: 4 }

Role 'wheel' has the following dependencies:
dependencies:
- { role: tire }
- { role: brake }

The role 'car' is then used as follows:
- { role: car, type: honda }

And tasks/main.yml in each role simply contains the following:
- name: {{ type }} whatever {{ n }}
  command: echo ''

TASK: [honda tire 1]
TASK: [honda brake 1]
TASK: [honda wheel 1]
TASK: [honda tire 2]
TASK: [honda brake 2]
TASK: [honda wheel 2]
TASK: [honda tire 3]
TASK: [honda brake 3]
TASK: [honda wheel 3]
TASK: [honda tire 4]
TASK: [honda brake 4]
TASK: [honda wheel 4]
TASK: [I'm a honda]  <- (this is in roles/car/tasks/main.yml)
2013-08-15 09:29:51 -05:00
ad595eadea Enable error_on_undefined_vars by default 2013-08-15 09:28:34 -05:00
2b96c347dc Exit with status 3 if no failures but unreachable.
Provide hints to playbook callers that a playbook execution had
unreachable vs failures. 2 == failures, 3 == no failures, but
unreachable hosts. 0 continues to be all good.
2013-08-14 13:37:26 -07:00
eee278e02b fix 2013-08-14 13:26:14 +02:00
5048218ab5 Fix: with_items and complex_args 2013-08-14 11:49:46 +02:00
e2278fd9e8 Automatically prepend partition if non-fully qualified monitors are passed 2013-08-13 22:00:49 -07:00
b26a88095f Documentation fixes and enhancements 2013-08-13 20:59:49 -07:00
10a0f03cdc Cleaning up of apt_repository module and removing wget parts 2013-08-13 16:11:03 -05:00
de404eac06 use either pycurl or wget to download from launchpad, also improve error message if neither is installed 2013-08-13 14:39:47 -05:00
5e56d42ed1 use pycurl instead of urllib2 when talking to launchpad to actually get SSL cert verification, see https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/915210 or CVE-2011-4407 for a previous similar issue in software-properties 2013-08-13 14:39:47 -05:00
c4852f6954 Cleaning up some pep8 whitespace issues in mongodb_user 2013-08-13 13:00:37 -05:00
eaac295fb2 Basic module to tag resources in EC2. 2013-08-13 12:55:06 -05:00
0958673574 Reverting version_added field in the apt_repository module 2013-08-13 09:53:49 -05:00
ded947008a Replacement for apt_repository.
1. Debian Squeeze is supported out of box now.
2. Repository type "deb" or "deb-src" should be explicitly specified.
3. If a source had beed added it must be possible to remove it.
4. PPA can be only used against Ubuntu hosts.
2013-08-13 09:53:49 -05:00
8f45b77d30 Comparison data type mismatch corrected 2013-08-13 09:28:53 -05:00
0c98c764e3 Fixing up a small issue with the mongodb_user docs 2013-08-13 09:05:19 -05:00
94e60563b4 adding fixes to support older versions of mongo (and pymongo) as well as new versions 2013-08-13 00:23:58 -05:00
bcef62cd39 adding comment about required version of mongodb to use the roles param 2013-08-12 21:25:21 -05:00
173586b871 Ensure plugin_loader.all() only loads one instance
by ensuring all basedirs, plugin paths and extra
paths are handled as absolute paths and are checked
to not add any doubles.

This fixes the corner case where e.g. the user has
an additional plugin path configured to a dir
relative to his playbooks or inventory location,
which also matches the  _plugin subdir relative to
one of the basedirs in the play.

For most plugins this doesn't show as an obvious issue
except for callback_plugins, which might fire more
than once. Other plugins (inventory and template
plugins) might unnecessarily be ran twice.

e.g. ansible.cfg has
callback_plugins   = ./plays/callback_plugins
and plays/ contains a playbook file:
.
├── ansible.cfg
├── inventory
└── plays
    ├── callback_plugins
    │   └── timestamp.py
    └── site.yml

modified:   lib/ansible/utils/plugins.py
2013-08-12 22:17:53 +02:00
d330228d11 adding the ability to specify roles when adding/modifying a mongo user 2013-08-12 15:03:31 -05:00
3e32654f9d fixing problem causing docs not to build 2013-08-12 12:17:34 -05:00
13bef3579f adding a little more info to the 'path' param so it's clear there are aliases (which are used in other examples) to avoid confusion 2013-08-12 11:45:32 -05:00
6feb4e3837 Fail apt package install when nothing is matched by the fnmatch pattern
Related to PR #3823
2013-08-12 11:26:31 -05:00
5c39c659e5 add support for fnmatch() style apt filenames
You can write a apt action like "- apt: pkg=apt*" with this package.
2013-08-12 16:11:15 +02:00
11fe4566f8 Document facts.d 2013-08-12 09:49:54 -04:00
6e3ec9ccc0 expand user home path in stat. 2013-08-12 17:34:54 +10:00
9b09ff4a65 Merge pull request #3821 from danxshap/django_venv_expand_user
Use home path expansion for virtualenv param in django_manage module
2013-08-11 17:53:01 -07:00
4db4607ee5 use home path expansion for virtualenv param in django_manage module 2013-08-11 14:02:13 -07:00
4e5feb6322 Merge pull request #3763 from j2sol/rax-updates
Update rax to sync with rax_clb_nodes
2013-08-11 13:37:25 -07:00
eb54c222de update changelog 2013-08-11 16:26:12 -04:00
06cb24940d Merge pull request #3797 from mscherer/openshift_github
Add openshift inventory plugin
2013-08-11 13:25:07 -07:00
bc02e20503 Merge branch 'rsynctake2' into devel
Conflicts:
	CHANGELOG.md
2013-08-11 16:22:36 -04:00
cde87f2f55 Add missing version_added to docs. 2013-08-11 16:21:00 -04:00
70c42eeb64 Merge pull request #3784 from drewblas/devel
Added git disclaimer about dealing with ssh host checking
2013-08-11 12:50:48 -07:00
6af77226fa Merge pull request #3818 from resmo/feature/docsite-update
update docsite about new variable inventory_file
2013-08-11 12:50:20 -07:00
17aa0d12de Merge pull request #3814 from ftao/inventory_dir_abs
fix inventory.basedir is not absolute path when hostfile is startswith "./"
2013-08-11 08:46:08 -07:00
1336bbd2f2 Merge pull request #3815 from amenonsen/typos
Fix some typos discovered during casual reading
2013-08-11 08:45:00 -07:00
5a063fd55a Merge pull request #3816 from DanLovesProofs/fix-docs
Brings postgresql_db examples in line with documentation.
2013-08-11 08:43:23 -07:00
1a90d01ba9 Fix some typos discovered during casual reading 2013-08-11 18:41:23 +05:30
28267de3fe update docsite about new variable inventory_file 2013-08-11 11:08:57 +02:00
bda2ce6ffd Brings postgresql_db examples in line with documentation.
As of now, the documentation lists a parameter as "name",
whereas the examples use a parameter called "db". This brings
them in line.
2013-08-11 00:41:23 -07:00
51a180b150 fix inventory.basedir is not absolute path when hostfile is startswith "./" 2013-08-11 10:50:47 +08:00
db8d9a6ea7 Update changelog 2013-08-10 19:03:00 -04:00
f8c97d6e79 Style/docs cleanup, and also improve an error message. 2013-08-10 18:58:45 -04:00
aeb8649da5 Merge branch 'ansible-rsync-take2' of git://github.com/tima/ansible into rsynctake2 2013-08-10 18:31:45 -04:00
4d1f447908 Merge pull request #3650 from bcoca/forking_optimizations
forking least possible
2013-08-10 15:29:19 -07:00
baffa8df72 These fields are booleans. 2013-08-10 18:16:01 -04:00
633abca916 Merge branch 'nocolor' of git://github.com/amenonsen/ansible into devel 2013-08-10 18:11:27 -04:00
5e049a5df7 Merge branch 'fix_service_with_initscript' of git://github.com/psvo/ansible into devel 2013-08-10 18:05:35 -04:00
ee11d69697 Merge branch 'better_ini_errors2' of git://github.com/bcoca/ansible into devel 2013-08-10 18:01:17 -04:00
0988a86653 Misc style fixes. 2013-08-10 17:59:05 -04:00
146bbfecc5 Smite tabs in whitespace. 2013-08-10 17:58:03 -04:00
587ea03097 Merge branch 'devel' of git://github.com/hura/ansible into devel 2013-08-10 17:57:41 -04:00
89bc43cab0 support i18n on sudo failure 2013-08-10 17:56:39 -04:00
0905683c1f Merge pull request #3806 from neomantra/issue_3438_x
digital_ocean #3438: use get instead of [] to prevent KeyError
2013-08-10 14:40:18 -07:00
4bdbe4dc4f Remove some test prints 2013-08-10 17:37:04 -04:00
9991a530ab fix an encoding bug in copy content = lookup plugin
closes #3518
2013-08-10 17:37:04 -04:00
220cc75cd9 Merge pull request #3805 from lwade/docs
Modified playbooks2.rst to include conditional boolean example.
2013-08-10 14:24:31 -07:00
cd7971e0d4 Merge pull request #3809 from mscherer/fix_openstack_folsom
Fix traceback when openstack do not have OS-EXT-IPS:type attached to add...
2013-08-10 14:20:45 -07:00
66b29b6813 Merge branch 'feature/gh-3789-inventory-file' of https://github.com/resmo/ansible into devel 2013-08-10 17:11:48 -04:00
1d13ec2da3 Construct the multiprocessing manager only once. 2013-08-10 09:32:46 -04:00
e8272e365d implemented 'inventory_file' variable. Closes GH-3789. 2013-08-10 13:04:56 +02:00
2288a11b6a Implemented setup method in rsync action module. 2013-08-09 21:24:50 -04:00
4a9635e04e Straighten out local-remote-delegate logic in rsync action module. Force set delegate to local if one is not defined. 2013-08-09 21:24:49 -04:00
adbca9d251 Fixed identity key logic. 2013-08-09 21:24:47 -04:00
9f170f579a Introduced ansible-rsync to core. 2013-08-09 21:24:46 -04:00
c556e673c7 Fix to better handle concurrent runs of module against same pool 2013-08-09 15:50:44 -07:00
6da44ef002 Fix traceback when openstack do not have OS-EXT-IPS:type attached to address
failed: [127.0.0.1] => {"failed": true, "parsed": false}
    invalid output was: Traceback (most recent call last):
      File "/tmp/ansible-1376083321.99-111209413777779/nova_compute", line 1176, in <module>
        main()
      File "/tmp/ansible-1376083321.99-111209413777779/nova_compute", line 239, in main
        _get_server_state(module, nova)
      File "/tmp/ansible-1376083321.99-111209413777779/nova_compute", line 198, in _get_server_state
        private = [ x['addr'] for x in getattr(server, 'addresses').itervalues().next() if x['OS-EXT-IPS:type'] == 'fixed']
    KeyError: 'OS-EXT-IPS:type'

This extension was added less than 6 month ago, and so cannot be used on a release
older than Grizzly ( like Folsom ).

Commit of the extension : https://review.openstack.org/#/c/21453/

See https://wiki.openstack.org/wiki/ReleaseNotes/Grizzly#Key_New_Features_2
2013-08-09 23:26:12 +02:00
0c9c4ae401 digital_ocean #3438: use get instead of [] to prevent KeyError
The existing code was using:
  a[b][c[d]]
where a[b] would always exist and c[d] would always exist.
But the nested index would not alway exist, particularly when a DigitalOcean item disapeared.

This changes that nested index to a `get` and properly handles None results.

This bug was present in two spots in this file.
2013-08-09 11:57:37 -04:00
ceff3b6ba3 Minor modification to set_fact with_items patch
Previous patch was reverted due to the fact that there was an issue
with the results not always being a dictionary (they're sometimes
a unicode string, ie. when the with_items is used with yum). This
minor change corrects that by checking for a dict object.
2013-08-09 07:52:14 -05:00
a46e0f9788 Modified playbooks2.rst to include conditional boolean example. 2013-08-09 13:24:48 +01:00
8be2fc745b Revert "Check for ansible_facts in results for with_ tasks"
This reverts commit 1a4e6e415e.
2013-08-08 20:32:30 -05:00
8026b091b1 Add openshift inventory plugin
This plugin will list all your git repositories from a openshift
provider, and allow you to manage them using ansible.

The inventory either use a environement variable or reuse the
existing rhc configuration file if it exist.
2013-08-08 23:37:14 +02:00
1c361a9968 Merge pull request #3795 from wilsaj/patch-1
docfix: grammar in docstring for sysctl module
2013-08-08 10:43:08 -07:00
1a4e6e415e Check for ansible_facts in results for with_ tasks
that loop over a lookup plugin. Fixes #3704 and #3735
2013-08-08 12:30:32 -05:00
bc30203abe docfix: grammar in docstring for sysctl module 2013-08-08 12:23:30 -05:00
40e60c947d Host specifiers should be sorted
to ensure consistent behavior, hosts should look like this:

    hosts: webservers:&boston:!rack42

So when applying the host selectors, run those without the "&" first,
then the &s, then the !s.

Closes #3500
2013-08-08 18:32:24 +02:00
0c96d8af6e Add a nocolor setting to ansible.cfg 2013-08-08 21:37:33 +05:30
067cc9274d Add note about python-selinux. 2013-08-08 09:15:24 -04:00
e2f20db534 Fix traceback in service module when svc_cmd is None
When service module is used on unsupported Linux system where init
script is used directly, LinuxService.svc_cmd is None so .endswith()
fails.

Fixes issue #3533
2013-08-08 14:24:20 +02:00
19bb81a7df EXAMPLES section added 2013-08-08 11:28:26 +02:00
1a6cb15ee6 Changes made in documentation (EXAMPLES section added)
Minor identation fixes
2013-08-08 00:10:06 +02:00
9ede377380 Added git disclaimer about dealing with ssh host checking
This disclaimer already exists in library/source_control/hg but not here.  It affects both and was discussed awhile back on: https://groups.google.com/forum/#!msg/ansible-project/q9G9xIdsRxo/XJhQzuS-qSoJ  However no PR was ever sent to fix the doc.
2013-08-07 15:33:29 -05:00
c4a06d32a5 Enhancements to provide pool creation and attributes 2013-08-07 10:39:54 -07:00
a937a6a66d now bad ini entries will throw friendlier error
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-08-07 12:49:12 -04:00
5a47953e7d Never ask for SSH password when using local connection.
With the command line option "-c local", ansible and ansible-playbook
should never ask for a SSH password even if this is set in the config.

Fixes #3720
2013-08-07 08:05:59 -04:00
0089ecfa7e Minor changelog updates. 2013-08-06 17:30:09 -04:00
18be6dcb62 Use blockquote in docs. 2013-08-06 16:45:24 -04:00
cb9c3a8bd7 Merge pull request #3762 from grosskur/fix-apt-noninteractive
apt: Run remove commands noninteractively
2013-08-06 13:41:07 -07:00
4cbfe3be57 Merge pull request #3773 from cchurch/devel
Update callbacks used for async tasks
2013-08-06 13:32:53 -07:00
0b4e145709 Merge pull request #3772 from lorin/s3-docpatch
Minor doc update to s3 & ec2 modules
2013-08-06 13:30:20 -07:00
ff44c981e9 Merge pull request #3770 from rishid/devel
Add support for INI comments that begin with '#' or ';'
2013-08-06 13:29:39 -07:00
99775176ff Merge pull request #3623 from ralph-tice/fix_3567_2
changed role path template to read all vars instead of just extra_vars
2013-08-06 13:26:59 -07:00
531e193865 Merge pull request #3643 from iliv/devel
Proper packaging support for RHEL/CentOS 5
2013-08-06 13:23:18 -07:00
0edcbdca05 Merge pull request #3709 from lwade/devel
S3folder
2013-08-06 13:01:43 -07:00
4401557455 add version_added attribute to module docs. 2013-08-06 15:54:20 -04:00
14e6bba001 Merge pull request #3741 from podollb/feature_ec2_vol
adding param to the ec2_vol module allowing custom iops setting when creating EBS volume
2013-08-06 12:53:35 -07:00
6ba4331161 Correctly check for failed status from an async task. Use runner_on_async_failed callback (instead of runner_on_failed) when an async task times out. Add runner_on_async_ok callback when a task is started in fire and forget mode. 2013-08-06 12:42:44 -04:00
729c03ed88 Minor doc update to s3 & ec2 modules
Adds some additional docs about the module parameters for s3
and ec2 modules.
2013-08-06 12:23:25 -04:00
d18c90ed8f Add support for INI comments that begin with '#' or ';'
Ini file format does not have a standard but ';' is used more often than '#' for comments
2013-08-06 11:41:07 -04:00
5f18a53530 Fixup docs formatting. 2013-08-06 10:53:56 -04:00
bc76d5adbe Merge pull request #3768 from didiercrunch/patch-1
Update supervisorctl
2013-08-06 07:49:00 -07:00
15160f2d93 Update supervisorctl
Fixed the example.
2013-08-06 09:06:28 -04:00
8706886597 Update rax to sync with rax_clb_nodes
Both modules dealing with rax resources should use the same arguments
and environmental variables. The author of rax_clb_nodes did some things
better so sync rax with that effort.
2013-08-05 15:53:02 -07:00
b950f9456a apt: Run remove commands noninteractively
I'm seeing ansible hang when trying to remove a package, and the hung
process is `whiptail` like in #2763. It looks like we only use
`APT_ENVVARS` and `DPKG_OPTIONS` for the `apt` commands in install()
and upgrade(). This change uses them in remove() as well, which fixes
the hang.
2013-08-05 15:20:45 -07:00
56a00e0667 Remove dead code. 2013-08-05 16:13:50 -04:00
2a0d67e6fc Doc formatting/tweaking. 2013-08-05 16:13:50 -04:00
2ff5a615df Update CHANGELOG 2013-08-04 11:46:07 -04:00
bcaa983c2f Document inventory script upgrades 2013-08-04 11:45:31 -04:00
8955ac1eda If the result of a dynamic inventory script contains a "_meta" hash at top level
and the _meta hash contains a "hostvars", don't call --host hostname for any elements
and just serve them directly for performance enhancements with the external inventory
script and a large number of hosts.
2013-08-04 11:34:42 -04:00
f715719c4f Merge pull request #3751 from mscherer/urpmi_autodetection
Add urpmi as a package manager for mandriva-based distribution
2013-08-03 16:43:50 -07:00
cfa5a0f94d Add urpmi as a package manager for mandriva-based distribution 2013-08-04 00:03:50 +02:00
1c6b81233c Merge pull request #3692 from tima/action-init
Added support of an optional init method for action modules like rsync that need to alter the connection and other inject data before it's established.
2013-08-03 12:00:04 -07:00
de14995b8c PEP8: fix spacing 2013-08-03 14:55:38 -04:00
4400bbdc55 Newline at end of file. 2013-08-03 14:55:22 -04:00
841fd11f41 Fix PEP8 commenting, but comment seems obvious so just remove it. 2013-08-03 14:55:01 -04:00
dec43f7a2b PEP8 indent fix. 2013-08-03 14:54:37 -04:00
3dbe65def2 PEP8 indent fix 2013-08-03 14:54:24 -04:00
a9121fecda Discussed datadog module at OSCON with DD folks, does not make sense to send
event types for anything other than myapps here.
2013-08-03 14:52:06 -04:00
e9747af8b7 Update changelog 2013-08-03 14:50:58 -04:00
40e447fbd4 Merge pull request #3718 from hacosta/rpm_key
Add rpm_key module
2013-08-03 11:39:10 -07:00
76fd769704 Merge pull request #3685 from mspaulding06/indexed_items
Indexed items lookup plugin
2013-08-03 11:36:51 -07:00
d039fbe200 Merge pull request #3649 from dekked/extra-vars-from-file
Extra vars from file
2013-08-03 11:31:58 -07:00
fa647e43ee Merge pull request #3670 from briceburg/devel
NEW MODULE: dnsmadeeasy
2013-08-03 11:31:07 -07:00
4f82b2a114 Merge pull request #3667 from exosite/devel
Made Linode inventory module much faster.
2013-08-03 11:29:23 -07:00
cd8d742a89 Merge pull request #3659 from neuroid/jabber-chat-fix
Set default XMPP message type to 'chat'.
2013-08-03 11:28:39 -07:00
caa825b618 Rename option to 'recurse' to make it consistent. Add version_added to docs. 2013-08-03 14:27:11 -04:00
74cde56b60 Merge pull request #3636 from uggedal/pacman-remove-recursive
Pacman module: recursive remove support
2013-08-03 11:26:15 -07:00
dab48fa3ed Slight docs tweak and remove redundant sys.exit call 2013-08-03 14:25:27 -04:00
7e6729e821 Merge branch 'devel' of git://github.com/peterkh/ansible into devel 2013-08-03 14:24:47 -04:00
4f9d330242 Add version_added to new parameter. 2013-08-03 14:22:38 -04:00
c0ab417ef9 Don't iterate across strings in with_nested. 2013-08-03 14:22:18 -04:00
996dbb72eb Merge pull request #3662 from grosskur/apt-key-keyring-param
apt_key: Add 'keyring' parameter
2013-08-03 11:21:52 -07:00
7f0cac45a5 Merge pull request #3272 from curtisgithub/devel
A module to create and delete boundary.com meters
2013-08-03 11:20:51 -07:00
5579691b9f Merge pull request #3745 from jimi1283/issue_3714
Set result to skipped when vol group is missing and lv state=absent
2013-08-03 10:52:48 -07:00
31ccf1dfda Merge pull request #3748 from lorin/ec2-idempotency
Add description to id parameter of ec2 module
2013-08-03 10:31:07 -07:00
bb122c3410 Merge pull request #3747 from lorin/ec2-check
ec2: check for changes
2013-08-03 10:30:24 -07:00
b31cef48e9 Merge pull request #3744 from jimi1283/issue_3360
Allow destination paths in the hg module to include a tilde (~)
2013-08-03 10:29:03 -07:00
82c806979b Only use LOG_LOCK in log_flock if a runner is not specified
Fixes issue #3466 - When ansible can't authenticate against a host,
and your answer is no, ansible crash.
2013-08-03 13:28:19 -04:00
f7723651d3 Merge pull request #3740 from jimi1283/issue_3716
Adding support for hashed known_hosts entries
2013-08-03 10:24:03 -07:00
e32a6110af Removing skipped=True so the task is just marked as not-changed 2013-08-03 12:15:09 -05:00
3fba6e9cff Merge branch 'git_undefined_branch_variable' of git://github.com/psvo/ansible into devel 2013-08-03 13:12:48 -04:00
631dc8b7b1 Add description to id parameter of ec2 module
Add some details in the docs about how the id parameter of the ec2
module behaves.
2013-08-02 23:01:17 -04:00
3647d112f8 ec2: Removed unused line
Remove the reference to the unused "termination_list" parameter
in the ec2 module. The instance_ids parameter is the one that contains
the list of instance ids to be terminated.
2013-08-02 22:35:24 -04:00
0c1f6b4f51 ec2: check for changes
In the ec2 module, if an id is specified, check if there have been
any changes. If not, return changed=False

Fixes #3746
2013-08-02 22:23:41 -04:00
d98ad7b374 Set result to skipped when vol group is missing and lv state=absent
Fixes issue #3714 - lvol module state=absent fails (with error) if
the volume group doesn't exist
2013-08-02 20:32:56 -05:00
7d521ee22c Allow destination paths in the hg module to include a tilde (~)
Fixes issue #3360 - Inconsistent behavior of the hg module w.r.t. dest path
2013-08-02 18:03:20 -05:00
1410df43de adding param to allow for specifying custom iops setting when creating an EBS volume 2013-08-02 11:31:31 -05:00
ba38d6bc16 Adding support for hashed known_hosts entries
Fixes Issue #3716 - SSH known host checking needs to understand
hashed known hosts
2013-08-02 11:08:02 -05:00
d9576b3529 Tidy up fix of git module traceback 2013-08-02 12:54:06 +02:00
d485abe2e7 Merge pull request #3732 from rishid/devel
User: when creating new user, ignore empty groups value
2013-08-01 18:55:23 -07:00
cb028b94a4 Merge pull request #3731 from bcoca/jinja_override_typed
now correctly 'types' value pairs that are passed to jinja overrides
2013-08-01 18:54:22 -07:00
07ef8c4d84 Verify groups string is not empty before trying add user to groups 2013-08-01 21:19:11 -04:00
581a0c9f59 now correctly 'types' value pairs that are passed as options to jinja
override
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-08-01 21:08:23 -04:00
0335d05f43 Check against None around playbook basedir 2013-08-01 20:44:19 -04:00
16d25f4115 Merge pull request #3651 from nicholaskuechler/rax-update-files-docs
Update docs and example for injecting files.
2013-08-01 17:32:15 -07:00
74e6bc284e Merge pull request #3660 from tedyoung/patch-1
Wrong target for link?
2013-08-01 17:29:49 -07:00
82d6323845 Update docs on action shorthand. 2013-08-01 20:28:37 -04:00
20f7e2ef71 Merge pull request #3691 from stoned/mysql_user-doc-fix
module mysql_user: fix 'state' parameter description
2013-08-01 17:25:21 -07:00
be7e29b2c2 Merge pull request #3728 from bpennypacker/ec2_elb_updates
Added optional region parameter.  Fail if you specify an ELB that doesn'...
2013-08-01 17:20:45 -07:00
7f77b6c72e Merge pull request #3722 from bcoca/lvg_gets_bin_path
now uses get_bin_path for lvg executables
2013-08-01 17:17:21 -07:00
bdef7f1774 Merge pull request #3711 from ashorin/devel
Allow --diff on UTF-8 encoded files and templates
2013-08-01 17:16:32 -07:00
44d060628e Merge pull request #3706 from lorin/sudo_user_breakage
Fix sudo_user copy error
2013-08-01 17:15:26 -07:00
daf5ecc7c9 Merge pull request #3684 from stoned/fix-3668
Add extra module path early during playbook parsing.
2013-08-01 17:14:35 -07:00
83481b32cc Merge pull request #3657 from zqad/devel
Fix playbook-local host_vars when running from .
2013-08-01 17:13:04 -07:00
4db413db6a Merge pull request #3655 from disko/pkgin_search_fix
Fix pkgin search
2013-08-01 17:12:16 -07:00
3ebbb56479 Merge pull request #3654 from MaxIV-KitsControls/devel
Fix nested loop for more than 3 elements
2013-08-01 17:11:26 -07:00
422233bc91 Merge pull request #3648 from echohead/glance-image-timeout
Fix 'timeout' parameter of glance-image module.
2013-08-01 17:09:44 -07:00
7813290969 Merge pull request #3645 from stoned/stringify-conditional-2
stringify conditional before handing it to Jinja2 for evaluation.
2013-08-01 17:08:34 -07:00
b2d2c40538 Merge pull request #3638 from shirou/devel
fix: if a path is symlink and trying to chmod, OSError Exception will be raised
2013-08-01 17:07:22 -07:00
3584aecc2b Merge pull request #3676 from bcoca/debug_doc_update
updated debug module docs to remove outdated -v requirement
2013-08-01 17:05:23 -07:00
d5d81813a6 Merge pull request #3634 from stintel/mysql-revoke-grant-option
Only revoke GRANT OPTION when user actually has it
2013-08-01 17:04:54 -07:00
8171b7ba48 Added optional region parameter. Fail if you specify an ELB that doesn't exist.
Boto blindly assumes the us-east-1 region if you don't hardcode a
region in it's config, so you could end up attempting to modify ELB's
in one region from a totally different region.  If a region isn't
specified then default to the region that the module is being run
within rather than the default us-east-1 region since it's a pretty
safe assumption that you intend to work on the ELB's within your
current region.

Also throw an error if a specified ELB instance doesn't exist.  The old
behavior would be to silently succeed with changed=false, so if you had
so much as a typo in the name of your ELB (or were in the wrong region
like my initial testing) you wouldn't get a clear indication that a
problem had occurred.
2013-08-01 16:50:01 -04:00
2d5b942ffe Fix traceback in git module when version checkout fails
"UnboundLocalError: local variable 'branch' referenced before assignment" is
raised in git, line 282, in switch_version.

Exception is raised when version is not branch and version checkout fails.
E.g. when version is nonexistant commit.
2013-08-01 12:10:43 +02:00
0ae7bcf3e2 fixed bug from prev update
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-08-01 00:24:34 -04:00
1e1f117886 whitespace updates on new lines
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-31 23:26:28 -04:00
d8e8aa714e now uses get_bin_path for lvg executables
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-31 22:32:41 -04:00
c62210ce37 Add rpm_key module
This module can be used to import public keys into your rpm database.

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
2013-07-31 15:55:38 -05:00
664215eb02 Allow --diff on UTF-8 encoded files and templates 2013-07-31 15:58:32 +04:00
f6cb9bce15 Added ability to create virtual directories. 2013-07-31 11:51:57 +01:00
fcb2295847 Change equals to colon 2013-07-30 20:08:22 -05:00
2167be8fe9 Fixed a problem on my side. Was doing weird things. 2013-07-30 20:07:20 -05:00
cac79faf35 Remove tailing bracket 2013-07-30 18:01:34 -05:00
a303fca193 Fix sudo_user copy regression
Treat errno 13 (permission denied) as one of the special cases in
atomic_move.

This type of error can occur because of sudo'ing to non-root user.

Fixes #3705
2013-07-30 16:14:29 -04:00
d752919637 mysql_replication module added 2013-07-30 17:02:07 +02:00
85f2a90322 MySQL variables module 2013-07-30 16:59:32 +02:00
11beb38c66 Added support of an optional setup method for action modules like rsync that need to alter the connection and other inject data before it's established. 2013-07-29 19:10:43 -04:00
3d97c11509 module mysql_user: fix 'state' parameter description 2013-07-29 23:50:17 +02:00
8cc13590b4 Make exceptions handling python 2.4 compatible. 2013-07-29 13:27:16 -04:00
6854857533 update CHANGELOG 2013-07-29 13:26:33 -04:00
b7154cf2cf Add tests for indexed_items lookup plugin 2013-07-28 14:16:25 -07:00
5d15515bbf Add indexed_items lookup plugin 2013-07-28 13:54:17 -07:00
841093921b Add extra module path early during playbook parsing.
This should fix issue #3668

Also prevent an extra module path to be added multiple times.
2013-07-28 18:47:26 +02:00
ed55ac1a15 Merge pull request #3666 from bpennypacker/statdoc
doc update for stat module
2013-07-28 06:23:14 -07:00
eceaa551d6 correct misnamed variable in changelog. 2013-07-28 09:15:08 -04:00
ec25147fc1 Merge pull request #3629 from ralph-tice/fix-3626
fixed vpc provisioning / clarified group_id usage
2013-07-28 06:14:56 -07:00
e4d0c7b0ce Update example to be more yaml friendly 2013-07-27 13:33:30 -05:00
38d606367a Set default XMPP message type to 'chat'.
This enables sending messages to partychat-like services (e.g. im.partych.at).
This commit also fixes handling of 'to' argument for non-chatroom recipients.
2013-07-26 21:30:10 +01:00
5ca1630b71 updated debug module docs to remove outdated -v requirement (and
only_if reference)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-26 10:06:57 -04:00
edbac1f14e Fix 'timeout' parameter of glance-image module.
The timeout parameter of glance-image was not being parsed into a
numeric type, causing the following error when specifying timeout:

    msg: Error in creating image: unsupported operand type(s) for +: 'float' and 'str'
2013-07-25 14:54:21 -07:00
91eed0c80b initial import of dnsmadeeasy module 2013-07-25 15:14:05 -05:00
09a2f23e8f Made Linode inventory module much faster.
Listing no longer makes an API request for every node.
2013-07-25 16:58:15 +00:00
0bbbefeb3f doc update 2013-07-25 09:59:23 -04:00
5ccc7e7277 apt_key: Add 'keyring' parameter
The apt-key command takes an optional --keyring parameter representing
the path to a specific GPG keyring to operate on. If it's not given,
the command operates on all keyring files, i.e., /etc/apt/trusted.gpg
and /etc/apt/trusted.gpg.d/*.gpg.

This change adds a 'keyring' parameter to the apt_key module and
propagates it down to the apt-key command line. The main use case this
supports is organizing keys for third-party repos into individual
keyrings in /etc/apt/trusted.gpg.d, rather than putting them all in
the default keyring.
2013-07-24 18:10:17 -07:00
28e7a25143 Wrong target for link?
Came to here from http://www.ansibleworks.com/docs/bestpractices.html, but I think the link here meant to go to https://github.com/ansible/ansible-examples and not https://github.com/ansible/ansible-examples/tree/master/language_features?
2013-07-24 15:36:21 -07:00
16efb45735 Fix playbook-local host_vars when running from .
Since ansible 1.2, it became possible to place a host_vars
directory in the same directory as a playbook, making it possible
to keep host_vars local to that playbook there. However, due to
python's os.path.dirname, a action such as:

 $ ansible-playbook pb.yml

..would not pick up the host_vars as os.path.dirname("pb.yml")
returns "", unlike the unix command dirname that would return
".". Substituting "pb.yml" on the command line with "./pb.yml"
would do the trick, but is not always intuitive. This patch
solves the problem until python solves issue18547 [1].

[1] http://bugs.python.org/issue18547
2013-07-24 18:33:06 +02:00
f2e3fa9508 Fix pkgin search (yielding wrong results under certain conditions, see inline comments). 2013-07-24 16:18:14 +02:00
09ef7751e1 Fix nested loop for more than 3 elements
- combine flatten list for each nested level instead once at the end
2013-07-24 14:19:13 +02:00
b8edbd0c0e Add example with multiple files. 2013-07-23 23:09:02 -05:00
72238889c3 Update docs and example for injecting files. 2013-07-23 22:49:17 -05:00
576962d335 now if you set fork to 0 or a number higher than the number of hosts, it
will be readjusted to the number of hosts runner is going to deal with.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-23 20:44:06 -04:00
d505474832 Updated documentation. 2013-07-23 19:49:27 -03:00
c19c2c7295 ansible-playbook can load extra vars from a file, with "@" syntax 2013-07-23 19:39:39 -03:00
a1503c4d59 stringify conditional before handing it to Jinja2 for evaluation.
This should fix simple conditionals like:

    when: ansible_selinux

While here add tests for ansible.utils.check_conditional() in
"jinja2_compare mode".
2013-07-23 22:24:53 +02:00
d4f75bc12c Proper support for RHEL/CentOS 5 (the only thing it needs now is to call python26) 2013-07-23 10:45:08 -07:00
c1c1b128f8 changed apikey and apiid to api_key and api_id and noted that it is boundary tags not ansible tags as per mpdehaan 2013-07-23 11:16:30 -06:00
0ce99e391f fix: if a path is symlink and trying to chmod, OSError Exception will be raised. 2013-07-23 22:14:48 +09:00
35b918359b Pacman module: recursive remove support 2013-07-23 15:01:13 +02:00
9d0fc0fd67 Only revoke GRANT OPTION when user actually has it
When revoking privileges from a user, the GRANT OPTION is always
revoked, even if the user doesn't have it. If the user exists, this
doesn't give an error, but if the user doesn't exist, it does:

mysql> GRANT ALL ON test.* TO 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE ALL ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
ERROR 1141 (42000): There is no such grant defined for user 'test' on
host 'localhost'

Additionally, in MySQL 5.6 this breaks replication because of
http://bugs.mysql.com/bug.php?id=68892.

Rather than revoking the GRANT OPTION and catching the error, check if
the user actually has it and only revoke it when he does.
2013-07-23 13:00:29 +02:00
d1369f3d95 Adding getstr mode to download an object into a variable 2013-07-23 11:03:00 +10:00
d1effecb2e Merge pull request #3628 from jlund/yaml-syntax
Minor cleanup of YAML Syntax documentation
2013-07-22 15:20:53 -07:00
be6feee058 Minor cleanup of YAML Syntax documentation 2013-07-22 16:09:18 -06:00
1529a974e1 fixed vpc provisioning / clarified group_id usage 2013-07-22 17:00:13 -05:00
86f05f11e7 Merge branch 'devel' of github.com:ansible/ansible into devel 2013-07-22 15:16:47 -04:00
a35370a766 Fix prev feature commit, Do not require aptitude to use apt commands in the apt module, only needed when upgrading. 2013-07-22 15:15:55 -04:00
fc9aa5f014 Continue on mount errors, don't fail the setup module. 2013-07-22 13:57:35 -04:00
f0eafff1b4 Merge pull request #3621 from sergevanginderachter/rename2flattened
also rename plugin name in error message
2013-07-22 10:32:38 -07:00
2383a8205c changed role path template to read all vars instead of just extra_vars 2013-07-22 09:59:26 -05:00
9c9bc09ce6 Merge pull request #3622 from bcoca/fix_the_stat_fix
use global to fail as its not in self
2013-07-22 07:56:49 -07:00
3f85a82ae9 use global to fail as its not in self
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-22 10:54:20 -04:00
b40295910d also rename plugin name in error message 2013-07-22 16:47:36 +02:00
2fe25f19dc Fix to group_by module as a result of previous conditional upgrades. 2013-07-22 10:11:19 -04:00
e3f213e030 Fixup error reporting. 2013-07-22 08:35:31 -04:00
c07dd07767 Add raw copy support (raw=yes), tweak tempfile error message string. 2013-07-22 08:25:55 -04:00
2e38d92262 Merge pull request #3619 from ches/doc-fixes
Enhance meta-docs on... contributing to docs.
2013-07-22 04:43:50 -07:00
5e02759570 Merge pull request #3617 from dermute/devel
svr4pkg doesn't work on Sol10
2013-07-22 04:37:10 -07:00
b35fc42d36 Enhance meta-docs on... contributing to docs.
- Update FAQ entry to refer to docsite README and reduce redundancy.

- Add additional info to docsite README: Sphinx building, link to module
  documentation reference.
2013-07-22 17:20:38 +07:00
a7a82c79c0 Merge pull request #3611 from tgerla/docsfix
very minor fix to playbooks2 to fix a formatting error
2013-07-21 12:47:03 -07:00
7e07bca6bf very minor fix to playbooks2 to fix a formatting error 2013-07-21 11:50:12 -07:00
524c7bd791 Remove end of line semicolons. 2013-07-21 11:55:38 -04:00
19d78d6e18 Remove reference to 'context' since it's not implemented. 2013-07-21 11:52:22 -04:00
0cf5e5cec3 Merge branch 'devel' of git://github.com/bradleyy/ansible into together 2013-07-21 11:47:05 -04:00
c5cbb1dc62 Fix route53 module docs version/module name 2013-07-21 11:20:37 -04:00
77a4dcca85 Sphinx/docs syntax fixes 2013-07-21 11:18:07 -04:00
10f99938b9 Fix YAML doc errors. 2013-07-21 11:15:06 -04:00
af94fb8eea Update changelog 2013-07-21 11:12:30 -04:00
7961a81b3f Update docs to add version_added attribute. 2013-07-21 11:12:04 -04:00
32b3c59bad Merge pull request #3400 from diko4096/patch-1
Update gem
2013-07-21 08:10:27 -07:00
fc70fbcab0 update changelog 2013-07-21 10:54:57 -04:00
5fe1f03885 Merge pull request #3413 from evan82/devel
Added module for baking EC2 AMIs
2013-07-21 07:53:54 -07:00
e2af927c3f Take notes on features that need to be documented in CHANGELOG 2013-07-21 10:49:08 -04:00
feb4a8847d Slight edit to when_changed docs 2013-07-21 10:48:22 -04:00
b603bb0f73 Merge branch 'changed_when-doc' of git://github.com/stoned/ansible into devel 2013-07-21 10:41:35 -04:00
8be17cd7f8 Add note about changed_when to changelog. 2013-07-21 10:39:00 -04:00
f3c69040b4 Merge branch 'changed_when' into devel 2013-07-21 10:37:56 -04:00
0756aa406a Change conditional operation workflow.
Conflicts:

	lib/ansible/utils/__init__.py
2013-07-21 10:37:02 -04:00
7f462a346a Work in progress on merging changed_when. 2013-07-21 10:34:47 -04:00
3f1f0e7bc2 Change conditional operation workflow. 2013-07-21 10:33:49 -04:00
88720516a1 Merge branch 'changed_when' of git://github.com/stoned/ansible into changed_when 2013-07-21 10:14:03 -04:00
1acd9b6325 Update CHANGELOG 2013-07-21 10:12:28 -04:00
e589365279 Merge branch 'iss_cron' of git://github.com/dirtyharrycallahan/ansible into dh_cron 2013-07-21 10:00:11 -04:00
ad086cdd1d Update changelog 2013-07-21 09:55:12 -04:00
44f55d72b6 Merge pull request #3574 from bpennypacker/route53
AWS route53 module
2013-07-21 06:54:14 -07:00
d8e5fc9d1b Remove task count information from task list. 2013-07-21 09:50:14 -04:00
f592340f7f Merge branch 'playbook-skip-tags' of git://github.com/dekked/ansible into skip_tags 2013-07-21 09:43:23 -04:00
20a9e35831 update CHANGELOG 2013-07-21 09:34:34 -04:00
3baa55a314 Merge branch 'devel' of git://github.com/sjmudd/ansible into sjmudd_ranges 2013-07-21 09:31:46 -04:00
62b39d3de5 Fix for saving conditionals in variable expressions. 2013-07-21 08:52:00 -04:00
ca512c7d2f Update CHANGELOG 2013-07-20 18:48:04 -04:00
bf70dfc1a0 When a role/include has a conditional, add that conditional ahead of any on the task, not behind, so it can short circuit. 2013-07-20 18:34:24 -04:00
419661542b Added some pipes.quote ops to make sure paths with spaces in them are ok. 2013-07-20 18:28:11 -04:00
508c1d8256 Update htpasswd module for various API incompatibilities 2013-07-20 18:22:58 -04:00
e003f1e1cc Revert "Fix inconsistent json output"
Breaks recursion parameter on file.

This reverts commit e7226e104e.
2013-07-20 18:08:42 -04:00
192d9f8b89 Merge pull request #3607 from stoned/use-AnsibleFilterError
Use AnsibleFilterError exception
2013-07-20 14:58:48 -07:00
1c21fc48b9 Merge pull request #3606 from stoned/fix-3521-2
Quote pathnames of roles' tasks and handlers files so that _load_tasks()...
2013-07-20 14:58:12 -07:00
667ad2480e Use AnsibleFilterError exception 2013-07-20 23:39:25 +02:00
e7a733a6be Quote pathnames of roles' tasks and handlers files so that _load_tasks() can tokenize them properly
With the help of AlejandroTrev's eagle eyes. Thanks !
2013-07-20 23:25:46 +02:00
0f26439234 Remove variable per pyflakes 2013-07-20 12:52:17 -04:00
e1167d6977 tweak indentation for 'make pep8' 2013-07-20 12:48:11 -04:00
588b20c012 Merge pull request #3602 from bcoca/fine_tune_stat_exception
narrowed down exception
2013-07-20 09:45:31 -07:00
23ff2f2992 Merging docs 2013-07-20 12:44:37 -04:00
8c25f98c43 Changed action keyword to command 2013-07-20 18:39:18 +02:00
10b967374d Add version_added information to module parameter. 2013-07-20 12:33:42 -04:00
34315c63ca Merge pull request #3396 from adq/mysql
Check if mysql allows login as root/nopassword before trying supplied credentials.
2013-07-20 09:32:00 -07:00
5bb0189296 Merge pull request #3440 from lwade/s3mode
Rewritten s3 module to allow for additional modes of operation.
2013-07-20 09:26:03 -07:00
85731a374e Document when options were added on this module. 2013-07-20 12:25:13 -04:00
16314b2ec9 Merge pull request #3442 from neomantra/supervisorctl
supervisorctl: add command-line options as module parameters
2013-07-20 09:23:46 -07:00
37e3cbab53 Merge pull request #3603 from eest/openbsd_pkg-run_command
openbsd_pkg: Use ansible run_command().
2013-07-20 09:14:29 -07:00
0f4229f6c4 Merge pull request #3462 from stoned/filtererror
Introduce exception AnsibleFilterError and use it in Jinja filters.  Ign...
2013-07-20 09:12:26 -07:00
3b3b600a98 Merge pull request #3470 from langemeijer/devel
Only append non_unique parameter if a uid is provided as well to user module
2013-07-20 09:11:52 -07:00
35183f7af3 Add missing version_added description in docs. 2013-07-20 12:08:47 -04:00
dafbcf87d3 changed atomic_move to be more 'optimistic' which helps deal with corner
cases and avoid usless work.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-20 12:07:00 -04:00
8df6b48e6b Merge pull request #3485 from frankshearar/let-rabbitmq-plugin-module-use-nonstandard-path
Let rabbitmq plugin module use nonstandard path
2013-07-20 09:05:54 -07:00
18d4b66b26 Merge pull request #3487 from djoreilly/ks-auth-error
Keystone_user module: fix authentication needs tenant_name too
2013-07-20 09:05:03 -07:00
d4dcf18751 Merge pull request #3502 from bryanlarsen/digital_ocean_no_ip
digital_ocean: don't run update_attr if wait=no
2013-07-20 09:04:31 -07:00
cac5e7d168 Merge pull request #3516 from dagwieers/file-dest
Fix inconsistent json output in file module
2013-07-20 09:01:19 -07:00
2c965476ed Merge pull request #3550 from lwade/ec2role
Added IAM role support
2013-07-20 08:55:45 -07:00
b7b1c714f9 narrowed down exception we ignore and fail if any other unexpected one
crops up.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-20 11:51:52 -04:00
3f93367579 openbsd_pkg: Use ansible run_command().
This fixes an asterisk glob problem in get_package_state() where a file
in /root/ could cause shell expansion if it matched the package name.
The actual problem is solved by running with shell=False.
2013-07-20 17:45:07 +02:00
efaaaa6c79 Merge pull request #3551 from sfromm/issue3543
Update stat module to handle symlinks
2013-07-20 08:28:36 -07:00
ecc7f8cb79 Merge branch 'sudo_role' into devel 2013-07-20 11:26:32 -04:00
32d5038d72 Don't add --version HEAD parameter is already HEAD, some versions of git don't like this. 2013-07-20 11:24:16 -04:00
c10c2cae4e Merge branch 'ansible_sudo_at_role_level' of git://github.com/jeromew/ansible into sudo_role 2013-07-20 11:05:38 -04:00
f7dec4f8f4 Rename plugin. 2013-07-20 11:02:16 -04:00
9dec701728 Merge pull request #3559 from sergevanginderachter/flat_list
Introduce flat_list lookup plugin
2013-07-20 07:59:44 -07:00
d6449711ae Revert "Added an elb_region parameter for interacting with the ec2 elastic load balancer to work with regions other than us-east-1"
This reverts commit 1264a5b47d.
2013-07-20 10:48:39 -04:00
7d2585caf7 Merge pull request #3577 from Tinche/extra-vars-in-playbook-includes
Enabled the use of extra vars in playbook file paths when including play...
2013-07-20 07:37:35 -07:00
13a18980bb Merge pull request #3597 from jlund/glossary-cleanup
Cleanup Glossary documentation
2013-07-20 07:36:38 -07:00
63af5aa3a3 Merge pull request #3598 from ianoc/devel
Added an elb_region parameter for interacting with the ec2 elastic load ...
2013-07-20 07:28:56 -07:00
1264a5b47d Added an elb_region parameter for interacting with the ec2 elastic load balancer to work with regions other than us-east-1 2013-07-19 18:21:51 -07:00
e8c6da6045 Cleanup Glossary documentation 2013-07-19 17:32:00 -06:00
162530dd74 Merge pull request #3595 from bcoca/fix_selinux_fix
missing self in self method usages
2013-07-19 11:55:57 -07:00
c8d6e5be0b missing self in self method usages
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-19 14:46:35 -04:00
f4b1e426ea Merge pull request #3379 from serenecloud/devel
Return a friendly error message if aptitude isn't installed
2013-07-19 07:36:39 -07:00
9314341923 Merge pull request #3465 from jlund/best-practices
Add documentation for Role Variables to the Best Practices page
2013-07-19 07:33:39 -07:00
6aa1ecbc30 Merge pull request #3493 from eest/openbsd_pkg-fixes
openbsd_pkg corner case fixes
2013-07-19 07:30:18 -07:00
ce89382473 Legacy variable removal. 2013-07-19 10:27:37 -04:00
9caef884e1 fail early on the wrong sudo password instead of waiting until the timeout happens 2013-07-19 10:23:00 -04:00
0bd8935899 Merge pull request #3515 from neomantra/apt_repository
apt_repository: enhance documentation
2013-07-19 07:06:05 -07:00
597e5075f1 Merge pull request #3585 from devo-ps/documentation
Minor typo on site about host_key_checking config section.
2013-07-19 06:50:28 -07:00
1867fb4888 Update an example. 2013-07-19 09:49:44 -04:00
10bc6f6d9c Merge pull request #3541 from pol/docs_withitems_regivar
Create with_items example with a registered var
2013-07-19 06:46:31 -07:00
5d5d579eca Legacy variable usage. 2013-07-19 09:45:08 -04:00
0fe680d43f Trim legacy variable usage. 2013-07-19 09:44:25 -04:00
a5e4567c4c Remove legacy variable usage. 2013-07-19 09:43:27 -04:00
1ff8c78f26 Removing legacy variable usage. 2013-07-19 09:42:22 -04:00
764504b578 Legacy variable usage removed. 2013-07-19 09:40:53 -04:00
131c8489d4 Legacy variable usage removed 2013-07-19 09:40:00 -04:00
c931675520 Trim old style var references. 2013-07-19 09:38:31 -04:00
86ddbb224b Trim old style var references 2013-07-19 09:37:19 -04:00
303a8ff563 Fix module path in readme file. 2013-07-19 09:34:43 -04:00
c101d4b30b Documentation indentation fix. 2013-07-19 09:33:31 -04:00
deda5c8ee7 Remove backlinks:top which is setting hyperlinks in docs sections so they are hard to bookmark. 2013-07-19 09:33:31 -04:00
ad5ac71219 Merge pull request #3542 from pol/docs_task_format
Update to conventional task format
2013-07-19 06:26:42 -07:00
20fa22b631 Merge pull request #3523 from jpmens/mysql1
mysql_db small fix to docs
2013-07-19 06:23:25 -07:00
c98b20b2cf Slight style preferences. 2013-07-19 09:22:17 -04:00
5fcbfa984d More informative error message on failure to resolve tmpdir 2013-07-19 09:19:40 -04:00
1a7a779e88 Handle SSH failures when creating remote tmpdir
Bail out if the SSH command fails rather than continuing with an
empty tmp variable.
2013-07-19 09:19:26 -04:00
f938bc660f Slight documentation tweak. 2013-07-19 09:13:30 -04:00
21e06a87ce Merge pull request #3530 from candeira/with_nested
add documentation for with_nested
2013-07-19 06:11:37 -07:00
8a3ea0774a Update error message since user may have specified connection type via non command line or by default. 2013-07-19 09:09:04 -04:00
5eea4b56fa Merge pull request #3591 from cocoy/fix_3567
Allow roles to be interpolated from --extra-vars
2013-07-19 06:04:59 -07:00
7965bc729b Merge pull request #3588 from Atte/devel
Check for existence of isatty on stdout before calling it
2013-07-19 06:04:31 -07:00
7a759e6396 Merge pull request #3582 from bcoca/fail_if_selinux_and_missing_bindings
fatal if target selinux and missing bindings
2013-07-19 06:03:29 -07:00
c11e96928a Merge pull request #3578 from jlaska/git_branch
(git module) Resolve incompatability between depth and version
2013-07-19 06:02:54 -07:00
6b2be84a27 Merge pull request #3590 from fgtham/lvol_fix
Fix for  Issue #3586:  UnboundedLocalError when removing a logical volume.
2013-07-19 06:02:15 -07:00
a4e829c874 Allow roles to be interpolated from --extra-vars 2013-07-19 18:28:21 +08:00
ceff31241b fix fatal error when removing logical volumes 2013-07-19 10:59:11 +02:00
511c7c858d Check for existence of isatty on stdout before calling it 2013-07-19 11:06:31 +03:00
6a00cb7b3b Minor typo on site about host_key_checking config section. 2013-07-19 13:26:30 +08:00
f6c99a69db switched from sestatus to selinuxenabled as per recommendation
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-19 00:55:41 -04:00
b21f6fc591 new module that handles extended attributes on files
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-18 22:29:07 -04:00
98cc29f9fd now returns fatal error if operation on selinux enabled target is
attempted w/o selinux python bindings
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-18 22:06:26 -04:00
de0bc96b70 Implement sudo/sudo_user at the include and role levels 2013-07-18 22:32:56 +00:00
cf3f9380d0 added AAAA example 2013-07-18 17:12:14 -04:00
95a22338a2 Resolve incompatability between depth and version
Git is unable to checkout the specified `version` when the repository is
cloned with a reduced history (`depth`).  However, if the repository is
already cloned, subsequent git module calls will update the repository
(default update=True), then properly checkout the specified `version`.
To allow the initial call to properly clone the specified `version`, at
the specified `depth`, this patch adds the `--branch` parameter when
cloning the repository.
2013-07-18 17:03:17 -04:00
4a732c1e9f Enabled the use of extra vars in playbook file paths when including playbooks from other playbooks. 2013-07-18 22:45:18 +02:00
e9de70668b fixed doc typos 2013-07-18 15:41:44 -04:00
a5e9057752 AWS route53 module 2013-07-18 13:45:00 -04:00
c3a8b6ff07 Merge pull request #3568 from andrew-todd/devel
Changed shebangs that use /usr/bin/env to use /usr/bin/python and theref...
2013-07-17 18:15:44 -07:00
e477d993dd Changed shebangs that use /usr/bin/env to use /usr/bin/python and therefore be compatible with the ansible_python_interpreter variable. 2013-07-17 16:37:04 -04:00
730b368259 Introduce flat_list lookup plugin
- hosts: localhost
    gather_facts: False
    tasks:
    - debug: msg="{{item}}"
      with_flat_list:
      - a
      - - b
        - c
        - d
        - - e
        - f
        - - g
          - h
      - i
      - j
      - - k
        - l

  # note: main list or list (sub)items can also be set as a variable

  TASK: [debug msg="{{item}}"] **************************************************
  ok: [localhost] => (item=a) => {"item": "a", "msg": "a"}
  ok: [localhost] => (item=b) => {"item": "b", "msg": "b"}
  ok: [localhost] => (item=c) => {"item": "c", "msg": "c"}
  ok: [localhost] => (item=d) => {"item": "d", "msg": "d"}
  ok: [localhost] => (item=e) => {"item": "e", "msg": "e"}
  ok: [localhost] => (item=f) => {"item": "f", "msg": "f"}
  ok: [localhost] => (item=g) => {"item": "g", "msg": "g"}
  ok: [localhost] => (item=h) => {"item": "h", "msg": "h"}
  ok: [localhost] => (item=i) => {"item": "i", "msg": "i"}
  ok: [localhost] => (item=j) => {"item": "j", "msg": "j"}
  ok: [localhost] => (item=k) => {"item": "k", "msg": "k"}
  ok: [localhost] => (item=l) => {"item": "l", "msg": "l"}
2013-07-17 13:59:41 +02:00
04349ec362 Added --skip-tags option to ansible-playbook. 2013-07-16 19:43:58 -03:00
fb869e58ee Merge pull request #3540 from pol/docs_deprecate_onlyif
Glossary Doc: deprecate the old "only_if:" format in favor of "when:"
2013-07-16 13:54:58 -07:00
a5459e8a03 * Added documentation for Role Variables
* Fixed a few minor typos
2013-07-16 14:53:20 -06:00
2af6510ded Update stat module to handle symlinks
Add follow parameter to stat module that controls whether to follow
symlinks.  It defaults to no.
This then calls os.stat or os.lstat based on the value of follow.
Add lnk_source key/value pair if path is a symlink and follow=no.
Drop the statement that sets isdir=False and islnk=True when path is a
symlink that points to a directory.
2013-07-16 10:27:38 -07:00
c222c8133b Merge pull request #3548 from arsatiki/patch-1
Fix pretty_bytes for exa- and zettabytes
2013-07-16 06:42:28 -07:00
1fec79ab9d Merge pull request #3549 from arsatiki/patch-2
Fix ZFS module issues with spaces in property values
2013-07-16 06:42:05 -07:00
9ec103e748 Added IAM role support 2013-07-16 13:31:30 +01:00
7b8f24adda Make zfs set_property accept values with embedded spaces
Converting the argument list to a string with ' '.join causes
the shell interpreter to misparse spaces in property values.
Since the zfs command does not need shell anywhere, using
a list instead of a string works just as well with run_command. 

Fixes #3545.
2013-07-16 14:01:14 +03:00
7670572578 Fix zfs property parsing
Current property parser breaks when values contain spaces. Since
zfs get -H returns tab separated lines,  it is better to explicitly
split on tabs than on whitespace.
2013-07-16 13:49:19 +03:00
b12cc909a9 Fix pretty_bytes for exa- and zettabytes 2013-07-16 13:09:56 +03:00
52321c1557 fixes ansible/ansible#3547 2013-07-16 09:17:57 +02:00
8a0861f804 Create with_items example with a registered var 2013-07-15 17:44:50 -06:00
d933fef93f Deprecate only_if in favor of when. 2013-07-15 17:41:09 -06:00
bd7448ccf0 Update to conventional task format 2013-07-15 17:35:20 -06:00
4560e8fc7c Added redis config module (slave and flush) 2013-07-15 21:47:36 +02:00
fa9635478b Fixing your YAML Seth :) 2013-07-15 13:16:37 -04:00
0fa6ed490a Merge pull request #3534 from trbs/issue_3363
fix missing json module for issue #3363 print JSON error as string instead
2013-07-15 07:54:31 -07:00
38b6087495 fix missing json module for issue #3363 print JSON error as string instead 2013-07-15 16:50:31 +02:00
b6c4ec0713 Merge pull request #3529 from bcoca/setup_stat_exception
now won't throw exception if we don't have permission to stat a mtab
2013-07-15 06:54:09 -07:00
d3a97bfb07 add documentation for with_nested 2013-07-15 14:28:02 +10:00
80b9b01e97 now won't throw exception if we don't have permission to stat a mtab
entry on linux (weird chromebook issue)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-14 22:59:24 -04:00
d05462fcab Merge pull request #3528 from bcoca/keep_remote_true
now ANSIBLE_KEEP_REMOTE_FILE acts as boolean
2013-07-14 19:49:25 -07:00
18cb155bd5 now ANSIBLE_KEEP_REMOTE_FILE acts as boolean
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-14 22:08:36 -04:00
23557b6e5a change the name from transpose to "together". Change to use itertools.izip_longest() rather than method cribbed from nested.py 2013-07-14 16:31:37 -07:00
60d2ad3642 Document changed_when clause 2013-07-14 21:43:10 +02:00
eb45f07ae3 Introduce 'changed_when' keyword to override a task's changed status with the evaluation of a Jinja2 expression 2013-07-14 21:07:45 +02:00
c4189dfd3c mysql_db small fix to docs 2013-07-14 13:11:03 +02:00
81940c8b11 add examples for yum: state=latest name=* 2013-07-13 14:29:04 -04:00
7216a2b169 add a '*' option for name to state=latest to do a global update 2013-07-13 14:28:52 -04:00
e7226e104e Fix inconsistent json output
The file module would in some cases return dest=/path/to/file, and in other cases return path=/path/to/file, this change makes it more consistent and in line with all the other file-related modules (i.e. copy, assemble, template, ...) by using dest= instead of path= as the input and output argument. (Of course, path is still there as an alias for compatibility).
2013-07-12 21:23:34 +02:00
01fc2b61dc apt_repository: enhance documentation 2013-07-12 15:03:37 -04:00
f5c81f79de supervisor_ctl: rename to server_url and improve documentation 2013-07-12 11:53:26 -04:00
27fcfe9cac Merge pull request #3508 from ipauldev/devel
Allow check mode when gathering ec2 facts
2013-07-12 08:20:33 -07:00
8fe15f0a30 Merge pull request #3426 from trbs/services_sleep_option
sleep option for service module which adds a pauze between stopping and ...
2013-07-12 08:18:22 -07:00
2631823b8b Merge pull request #3425 from jpmens/stat1
files/stat: add pw_name and md5 sum to stat, and add meaningful? example
2013-07-12 07:21:09 -07:00
80bbd6a0bf Merge pull request #3510 from echohead/quantum-typo
Correct typo in error message.
2013-07-12 05:39:12 -07:00
472c18c2b4 'prefix' avoids potentially making people confuse 'path' with $PATH. 2013-07-12 10:13:53 +01:00
ea93a36b10 Adding transpose lookup method. This will matrix transpose arrays that are passed in, and then work like items over the resulting list of lists. e.g.:
Transpose a list of arrays:
    [1, 2, 3], [4, 5, 6] -> [1, 4], [2, 5], [3, 6]
    Replace any empty spots in 2nd array with "":
    [1, 2], [3] -> [1, 3], [2, ""]
2013-07-11 23:45:03 -07:00
84f6192c34 Correct typo of 'quantun' in error message. 2013-07-11 21:12:24 -07:00
5656e9d66e Allow check mode when gathering ec2 facts 2013-07-11 19:50:55 -05:00
fba1f7ef42 Revert "expand vars like $HOME used in config values too" -- breaks remote_tmp if set.
This reverts commit e5ff35bbdb.
2013-07-11 17:27:17 -04:00
cea812c3a7 update_attr should wait for the full wait timeout before checking for a missing IP addres 2013-07-11 14:05:26 -04:00
848b38fc7f digital_ocean doc update 2013-07-11 13:33:42 -04:00
bdbc963736 digital_ocean: don't run update_attr if wait=no
Sometimes when using digital_ocean with wait=no I get the error "No ip is found".  But with wait=no I wouldn't expect there to be any IP, that gets allocated later.   However, looking at the code, it turns out that with even with wait=no it waits up to 10 seconds for an IP to be allocated.  We could wait longer, but with wait=no that seems like the wrong choice; it's easy enough to grab an IP later with a wait=yes command.

To make this change I removed the call to update_attr in @classmethod add.  An add is always followed by an ensure_powered_on which will do the update_attr if wait=yes.   It would be possible to instead do a call to update_attr with no retries and ignore the errors but I figured it would be better to be consistently not return an IP than to sometimes return it and sometimes not.   Inconsistent behaviour makes debugging deployment scripts very difficult.
2013-07-11 13:30:42 -04:00
4971736660 Merge pull request #3501 from cristobalrosa/devel
Devel
2013-07-11 06:20:48 -07:00
afcd869487 Merge pull request #3451 from sergevanginderachter/template_ansible_ssh_host
allow ansible_ssh_host to be templated
2013-07-11 06:04:13 -07:00
95b90cf71a Merge pull request #3454 from nyetsche/abspath
set checkout destination directory to be full path
2013-07-11 06:03:39 -07:00
9990688fd1 Merge pull request #3453 from jsmartin/cleanup
Fixed #3433. Using get_bin_path, removed uneeded imports, "module" is in...
2013-07-11 06:03:19 -07:00
aacf81da59 Merge pull request #3488 from weltenwort/devel
Use the force=yes option for apt upgrade actions
2013-07-11 05:56:32 -07:00
3a84254f6d Merge pull request #3496 from johanwiren/bsd-ipv6-facts
Fix for populating default_ipv6 on BSD systems
2013-07-11 05:55:53 -07:00
d1398594ce Merge pull request #3497 from johanwiren/bsd-gateway
Updated setup module to collect gateway fact for BSD systems
2013-07-11 05:55:26 -07:00
7cc9ebc1a7 Merge pull request #3387 from stoned/test-ignore-errors
Add test for 'ignore_errors:'
2013-07-11 05:39:40 -07:00
2e8a78b3e0 Merge pull request #3415 from neomantra/digital_ocean_inv
digital_ocean.py enhancements
2013-07-11 05:36:38 -07:00
952760c605 Merge pull request #3388 from bcoca/fixed_user_create_doc
updated module docs to reflect 'correct' on_create vs on_creation
2013-07-11 05:34:37 -07:00
324a28f3dd Merge pull request #3439 from eest/bestpractices_templates_fix
Fix path to ntp.conf.j2 in example.
2013-07-11 05:31:25 -07:00
f8c7a3c654 Merge pull request #3406 from podollb/devel
fixing small mis-spelling
2013-07-11 05:29:11 -07:00
0fd7864482 Merge pull request #3432 from jlund/hg-spelling
Fix some minor spelling mistakes in the hg module documentation
2013-07-11 05:26:57 -07:00
90dfc115d6 Merge pull request #3463 from stoned/filterskipped
Add Jinja2 filter 'skipped' to test for a registered variable from a ski...
2013-07-11 05:26:25 -07:00
279247dfac Merge pull request #3464 from stoned/filterquote
Add Jinja2 filter 'quote' to quote string for shell usage
2013-07-11 05:25:43 -07:00
d6d9e804d3 Merge pull request #3480 from j2sol/fail_doc
Update fail docs for new syntax
2013-07-11 05:22:47 -07:00
5f36079ffd Merge pull request #3486 from pieska/expandvars
expand vars like $HOME used in config values too
2013-07-11 05:22:18 -07:00
ee73276310 Merge pull request #3492 from jlund/advanced-playbooks
Fix some minor typos in the Advanced Playbooks documentation
2013-07-11 05:21:13 -07:00
e44847e3d6 Merge pull request #3494 from jlund/authorized-key
Add a new with_file example to the authorized_key documentation
2013-07-11 05:20:24 -07:00
1c247c9eb4 Updated GenericBsdIfconfigNetwork to collect gateway 2013-07-11 00:05:53 +02:00
10e9194744 Fix for populating default_ipv6 on BSD systems 2013-07-10 22:54:33 +02:00
cc275ca2be Added a new with_file example to the authorized_key documentation 2013-07-10 14:09:03 -06:00
1b08da26fd openbsd_pkg: some whitespace cleanup. 2013-07-10 21:23:10 +02:00
7c78fef1f5 Fixed some minor typos in the Advanced Playbooks documentation 2013-07-10 13:09:12 -06:00
af52cd6ec1 openbsd_pkg: sync package_latest().
This diff syncs package_latest() with the changes to package_present().
I have not managed to figure out how to handle the cornercases where
stderr is set but the command has not failed, so leave a FIXME blob for
other adventurers.
2013-07-10 21:06:35 +02:00
0e4e6e8a84 openbsd_pkg: Handle another pkg_add gotcha
* Add '-m' to pkg_add incovation to get access to the "packagename-1.0: ok"
  message.
* Watch for that message if we are about to fail because of stderr in
  package_present().
2013-07-10 18:19:01 +02:00
6346798e7e Keystone_user module: fix authentication needs tenant_name too
The keystone client needs to be passed tenant_name when authenticating the
user/password way. Also it needs auth_url instead of endpoint.
This fix adds login_tenant_name as a module parameter which is consistent
with the other OpenStack modules.
2013-07-10 07:21:07 +01:00
a67ea75dec openbsd_pkg: handle pkg_add quirks better.
This fixes a problem when trying to install a package with a specific version
number from a local directory and the local directory is checked after a remote
repository:

Error from http://ftp.eu.openbsd.org/pub/OpenBSD/[...]/packagename-1.0.tgz
ftp: Error retrieving file: 404 Not Found
packagename-1.0: ok
2013-07-09 20:56:22 +02:00
e5ff35bbdb expand vars like $HOME used in config values too 2013-07-09 20:33:33 +02:00
9ba4a42ff8 Minor typo 2013-07-09 17:33:30 +01:00
ec78daa456 Let someone specify a path to a Rabbit that's not installed in the usual place. 2013-07-09 17:33:14 +01:00
b5df29901f Use the force=yes option for apt upgrade actions 2013-07-09 10:57:19 +02:00
8f14ffe56b Bug fixes and enhancements.
Bugs:
(1) no longer allow empty jobs
(2) strip the header added by crontab package used in openSuSE and SuSE
(3) try not to leak temp files when things go wrong
(4) issue returning job names under certain conditions

Enhancements:
(1) Allow all special times not just reboot.
(2) Fail earlier by performing more input validation
(3) Add feature to allow removing cron file under /etc/cron.d

ToDo:
(1) Validate times (minute, hour, ...)
(2) Strip white space from fields such as name and job such that name=foo equals name=' foo'.
(3) More testing
2013-07-09 03:21:40 +00:00
1689001036 Update fail docs for new syntax
Use when instead of only_if
Use new variable style
2013-07-08 14:22:05 -07:00
714cb02f5b Merge pull request #3477 from bcoca/fix_service_checkmode
fixed check mode for service module
2013-07-08 12:44:44 -07:00
0664e36aa2 fixed check mode
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-08 15:41:39 -04:00
7932ccef46 added note about AMI security 2013-07-08 10:24:22 -07:00
e33f5ae56e Merge branch 'devel' of https://github.com/evan82/ansible into devel 2013-07-08 09:26:04 -07:00
45bdda24db added region to spec 2013-07-08 09:24:18 -07:00
1bf4a4fa97 Merge pull request #3469 from johnny-die-tulpe/devel
Fixed indention of vv() output
2013-07-08 05:58:11 -07:00
922a71fced Only append non_unique parameter if a uid is provided as well 2013-07-08 11:46:38 +02:00
8c8b4d56fc Fixed indention of vv() output 2013-07-08 11:18:33 +02:00
247322bb16 Add Jinja2 filter 'quote' to quote string for shell usage 2013-07-08 00:37:23 +02:00
906746b1f0 Add Jinja2 filter 'skipped' to test for a registered variable from a skipped task 2013-07-07 22:13:14 +02:00
2d88c70cd5 Introduce exception AnsibleFilterError and use it in Jinja filters. Ignore this exception when trying to find the name of a task for display (callback) purpose. 2013-07-07 19:18:32 +02:00
51166c9cfa Remove unnecesary call 2013-07-06 22:12:30 +02:00
b2d881a899 Fixup changelog dates 2013-07-05 22:12:33 -04:00
8a82b5c817 Slight revisement to configuration file comment. 2013-07-05 22:11:51 -04:00
6063f64526 Update changelog 2013-07-05 22:11:32 -04:00
3712ca7cde Update releases 2013-07-05 22:10:34 -04:00
5354ab043d Update changelogs 2013-07-05 22:09:04 -04:00
cf6e1f8db9 Make it possible to tell paramiko to not record new host keys, which can be slow with a large number of hosts.
-c ssh is preferred in most cases if you have ControlPersist available, otherwise if you are comfortable you
can turn off recording while leaving host key checking on, etc.
2013-07-05 22:06:54 -04:00
14818af446 Merge pull request #3450 from tonk/sudo
Repair issue #3447
2013-07-05 16:08:29 -07:00
aa9385411d Merge pull request #3443 from ajsalminen/arg_unicode_fix
Use .encode() instead of str() to support unicode arguments.
2013-07-05 15:26:29 -07:00
b37ecb055c set checkout destination directory to be full path
we chdir into this path and read the playbook/inventory if a
non-absolute path is given on the command line, that will fail
2013-07-05 17:57:01 +00:00
93d5d76468 Fixed #3433. Using get_bin_path, removed uneeded imports, "module" is inlined, misc other style improvements. 2013-07-05 13:22:44 -04:00
37ee361be1 Repair issue #3447 2013-07-05 19:10:36 +02:00
129c7522d9 allow ansible_ssh_host to be templated
Use case: e.g. dual homed hosts on production en management network

The inventory_hostname is the regular host name and matches the
dns name on the production network; ansible connects to the host
through a management network; the dns name on the management network
is standardized and equals ${inventory_hostname}-mgt.mynetwork.com

Now this can be configured as the default in group_vars/all:

   ansible_ssh_host: {{ inventory_hostname + '-mgt.mynetwork.com' }}
2013-07-05 18:05:26 +02:00
4dfbbc4499 Revert "ini_file: add support for lists of options/values"
Breaks "," values in INI files

This reverts commit af051d6f77.
2013-07-05 12:04:07 -04:00
98bbf9708a digital_ocean: whitespace changes 2013-07-05 10:38:04 -04:00
9b1a57f1f3 digital_ocean: make sure 'images' includes non-global images
The `dopy` library function all_images includes a 'global' filter
by default.  This was preventing private images from showing up
in --images.

The problem also made this script fail immediately for people
who had droplets previously created with private images.
2013-07-05 10:00:01 -04:00
cf48141a33 Fixed monit module. Ignore uppercase letters 2013-07-05 05:49:07 +02:00
4a9f72dcce Merge in release notes from 1.2.1 2013-07-04 22:02:10 -04:00
8163518c0e Update packaging changelogs.
Conflicts:

	packaging/rpm/ansible.spec
2013-07-04 21:58:05 -04:00
b9206d9df9 Update the releases list.
Conflicts:

	RELEASES.txt
2013-07-04 21:54:58 -04:00
d002c2d907 Document 'smart' option and connection type default changes. 2013-07-04 19:10:56 -04:00
3d73fb9cd7 Merge pull request #3444 from skvidal/yumopt
- optimize for the extremely common case of people specifying pkg names ...
2013-07-04 15:58:22 -07:00
107ced7ec5 Mention envrionment variable configuration. 2013-07-04 18:56:46 -04:00
1ead97098d Talk more about transports in documentation. 2013-07-04 18:51:47 -04:00
2cb7c30834 Improve interlaced output prevention when asking for host key approval. 2013-07-04 18:17:45 -04:00
d710201ecc - optimize for the extremely common case of people specifying pkg names which are, ultimately, already installed
on a system here time went from  16s for a series of pkgs to 3s to just
  check that they were installed.
2013-07-04 17:35:34 -04:00
c55adc9ac9 Default to 'smart' transport, which will use OpenSSH if it can support ControlPersist. 2013-07-04 16:47:17 -04:00
d7c6cf10c2 Use .encode() instead of str() to support unicode arguments.
str() throws an UnicodeEncodeError for code points that cannot be
represented in 7-bit ASCII. This makes it impossible to use any
non-ASCII characters in module arguments. Using encode('utf-8')
gives the desired result.
2013-07-04 23:16:38 +03:00
1683d44d2e Lock around SSH connectivity to new hosts in host checking mode such that prompts for host approval
messages do not get interlaced.
2013-07-04 16:04:31 -04:00
cb26945d54 Close the named temporary file. 2013-07-05 01:24:08 -04:00
3b1aa092f8 Closing stdin too early. 2013-07-05 01:20:08 -04:00
ffadbc520a Enable paramiko to ask whether to add keys to known hosts. 2013-07-04 14:05:41 -04:00
cbeb6a63e5 supervisorctl: add command-line options as module parameters
Adds more parameters which may be passed to supervisorctl:  config,
serverurl, username, password

Also refactored the various `module.run_command(build_a_string)` calls
into a single `run_supervisorctl` function.
2013-07-04 12:23:16 -04:00
ae992c6b6e Rewritten s3 module to allow for additional modes of operation. 2013-07-04 15:55:06 +01:00
1f1aa1f0a8 Fix path to ntp.conf.j2 in example.
The "common" role adds "common/templates/" to the src path.
2013-07-04 15:42:46 +02:00
cff4ab511c Merge pull request #3434 from mspaulding06/git_submodule_update
Fix git submodule update when version specified
2013-07-03 17:41:40 -07:00
871f781ec7 Fix git submodule update when version specified 2013-07-03 17:19:14 -07:00
d96cedcad1 Example config file should use correct config setting. 2013-07-03 16:55:10 -04:00
9db4f7a9a6 Makes host key checking the default behavior but can be disabled in ansible.cfg or by environment variable. 2013-07-03 16:47:20 -04:00
caf394c8f6 Fix some minor spelling mistakes in the hg module documentation 2013-07-03 13:23:08 -06:00
9a82d8c692 files/stat: add pw_name and md5 sum to stat, and add meaningful? example
remove unnecessary import,
  md5 sum on regular files only
2013-07-03 21:07:45 +02:00
de211aa8ec Getting timeout errors this morning as AMIs are taking a bit longer to create, so I changed to timeout to 15 minutes 2013-07-03 11:10:39 -07:00
637a6c562e fixed spelling errors, unused variables and unused import 2013-07-03 10:35:32 -07:00
4407ca8031 Merge pull request #3427 from insom/issue3409
Make the CPU facts Hyperthreading aware
2013-07-03 08:40:58 -07:00
efc4bc10d4 Make the CPU facts Hyperthreading aware 2013-07-03 16:25:35 +01:00
3b2173b6df sleep option for service module which adds a pauze between stopping and starting a service using state=restarted. This helps for bad scripts that exist immediatly after signaling a process to stop. 2013-07-03 17:08:07 +02:00
f8396622fa Merge pull request #3418 from stoned/filter-bool
Add Jinja2 filter |bool : return boolean interpretation of the value
2013-07-03 05:01:29 -07:00
2f4c930d35 Merge pull request #3423 from arsatiki/devel
Fix service enable on FreeBSD
2013-07-03 05:00:59 -07:00
93fc3391fe Fix service enable on FreeBSD
Some services have a knob (i.e. rc.conf setting) whose name
differs from that of the script. For example, lockd process
is controlled with a script called lockd, but the rc.conf
value is rpc_lockd_enable.

Fixes issue #3382.
2013-07-03 14:52:23 +03:00
0b3483cf03 Add Jinja2 filter |bool : return boolean interpretation of the value
'yes', 'on', '1', 'true', insensitively, and 1 are true,
 everything else is false
2013-07-03 02:13:19 +02:00
3f6bc3f664 digital_ocean.py enhancements
* Always refresh droplet information (versus getting it from cache) for
  --list, --host, --droplets, and --all.   All the DigitalOcean calls are
  pretty fast and without this change, inventory was often stale/incorrect.
  For example, previously if you destroyed a droplet, the inventory
  script would still find it and attempt to act on it.

* Added --force-cache option

* Added some option shortcuts -d, -r

* Added more value sanitization
2013-07-02 15:49:43 -04:00
c8f8f14e59 Added module for baking EC2 AMIs 2013-07-02 11:24:40 -07:00
c1a757e982 as per mpdehaan, change string formatting to something that will work with python 2.4 2013-07-02 09:41:11 -06:00
1bea4b1709 fixing small mis-spelling 2013-07-01 21:33:25 -05:00
25aaee4c38 Merge pull request #3394 from jpmens/docs3
broken docs in files/file module!
2013-07-01 07:26:31 -07:00
8745de11a6 Update gem
I've added ability to install gems in system-wide manner with --no-user-install options
2013-07-01 06:20:46 -07:00
4cb48f0dcc Check if mysql allows login as root/nopassword before trying supplied credentials. 2013-07-01 11:56:04 +01:00
f77c0a44f9 broken docs in files/file module!
remove obsolete examples: key
2013-07-01 12:18:07 +02:00
9f75397310 updated module docs to reflect 'correct' on_create vs on_creation
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-06-30 20:32:05 -04:00
baf868f825 Add test for 'ignore_errors:' 2013-07-01 02:31:16 +02:00
955611bda8 Fixes #3294 2013-06-30 19:59:48 -04:00
1b8ebfb224 Changelog updates 2013-06-30 19:55:00 -04:00
195aa65969 Changelog update. 2013-06-30 19:51:31 -04:00
6d9949698b Merge pull request #3292 from sfromm/git-submodule
Add submodule support to git module
2013-06-30 16:46:19 -07:00
f3dc5707a8 Merge pull request #3282 from jlaska/devel
Reference ansible_lsb.major_release, not ansible_lsb.major_version
2013-06-30 16:43:30 -07:00
6ba72854ee Merge pull request #3296 from ninetythirty/devel
Added flexible filename handling for main files
2013-06-30 16:42:57 -07:00
fafb3c10a5 Merge pull request #3293 from jarv/devel
Adds termination support to the ec2 module
2013-06-30 16:40:51 -07:00
506178542d Merge pull request #3303 from markmandel/feature/sudo_pass
Don't turn on sudo for all tasks when setting the sudo_user or ask_sudo_pass
2013-06-30 16:35:20 -07:00
c2988dfdb0 Merge branch 'option-updates' of git://github.com/jlund/ansible into devel
Conflicts:
	bin/ansible-pull
2013-06-30 19:31:37 -04:00
c9b6f0d0f2 Merge branch 'files_force' of git://github.com/rhaido/ansible into devel 2013-06-30 19:24:37 -04:00
be5386f945 Merge remote branch 'origin' into devel 2013-06-30 19:24:24 -04:00
8b592c9d4b Add some whitespace to script 2013-06-30 19:21:28 -04:00
8f5c9aec47 Merge branch 'env-setup-shell-tweaks' of git://github.com/madduck/ansible into bash_hacking
Conflicts:
	hacking/env-setup
2013-06-30 19:20:27 -04:00
2bbad5dae3 Merge pull request #3275 from madduck/implicit-negations
Enable negated patterns
2013-06-30 16:12:37 -07:00
15bf8a8398 Merge pull request #3315 from madduck/fix-service-updatercd-changed
Let update-rc.d set changed flag properly
2013-06-30 16:09:39 -07:00
39105dc853 Fix RST formatting in documentation (underline too short) 2013-06-30 19:01:06 -04:00
7821473710 Fixup documentation YAML 2013-06-30 19:00:43 -04:00
681696846a Styling: semicolon 2013-06-30 18:56:03 -04:00
ecc2b6e742 Styling: deprecation 2013-06-30 18:55:45 -04:00
2e63faf257 Styling: deprecation 2013-06-30 18:55:03 -04:00
257d827c9e Styling: misc pep8 2013-06-30 18:54:32 -04:00
bc7de7bf3f Styling: indentation 2013-06-30 18:53:55 -04:00
0e51a1c0ea Styling: semicolon 2013-06-30 18:53:22 -04:00
39834d854c Styling: trailing spaces 2013-06-30 18:52:57 -04:00
fc8ffc1864 Styling: blank lines 2013-06-30 18:52:33 -04:00
c7eb68e043 Styling: deprecation 2013-06-30 18:52:17 -04:00
4827d1451e pep8: deprecation 2013-06-30 18:51:47 -04:00
899ea4de82 Styling: indentation 2013-06-30 18:51:11 -04:00
0b251d840b Styling: spacing 2013-06-30 18:51:00 -04:00
ea2a665981 Styling: misc pep8 2013-06-30 18:50:40 -04:00
f2fc185651 Styling: indentation 2013-06-30 18:49:49 -04:00
82d51e6354 Semicolons must die 2013-06-30 18:49:17 -04:00
75cadeebcb update changelog 2013-06-30 18:46:23 -04:00
6dd93fa964 Some minor doc tweaks 2013-06-30 18:32:49 -04:00
ee4d9b1516 Merge branch 'devel' of git://github.com/shirou/ansible into devel 2013-06-30 18:28:35 -04:00
c265c761d0 Slight message tweak. 2013-06-30 18:27:15 -04:00
e6adc2f066 Merge branch 'devel' of git://github.com/arturaz/ansible into devel 2013-06-30 18:25:33 -04:00
29894737cf Merge pull request #3374 from jsmartin/bugfix
cloudformation: Fixed bug in module_fail. Consistent error handling.
2013-06-30 15:22:25 -07:00
407edf097a Merge pull request #3386 from skorokithakis/feature/onlyifchanged
Add --only-if-changed option.
2013-06-30 14:23:44 -07:00
213e74a44c Merge pull request #3298 from devo-ps/linode
Add Linode cloud support.
2013-06-30 14:22:07 -07:00
53207ddbdf Add --only-if-changed option. 2013-07-01 00:20:58 +03:00
1d1d30f338 Merge pull request #3357 from neomantra/devel
Add DigitalOcean inventory plugin
2013-06-30 14:20:21 -07:00
f2e3a9a850 Merge pull request #3370 from y-p/PR_role_doc_enh
Add doc example of attaching tags to a role
2013-06-30 14:18:11 -07:00
fa4313c7ee Merge pull request #3358 from aristanetworks/devel
initial arista module import
2013-06-30 14:17:47 -07:00
146455fd0a Merge pull request #3375 from jhoekx/mandatory-filter
Add a mandatory jinja2 filter for use in templates.
2013-06-30 14:16:17 -07:00
a501e94b63 Merge pull request #3364 from sergevanginderachter/lvol
lvol module: add support for multiple size formats
2013-06-30 14:15:55 -07:00
8dfff02077 Merge pull request #3373 from exosite/devel
Added Linode inventory plugin
2013-06-30 14:14:48 -07:00
7b825f72df Fixed bug in module_fail. Consistent error handling. Adding comments. Removal of unused variable. Removed unecessary wait_for option. was never been used to begin with. Trim down the stack_outputs. Don't need to include stack name and region since they are already required parameters. Rollback supported in status operations. Using dict when possible. 2013-06-30 16:59:50 -04:00
6d5ac43dcb Merge pull request #3368 from j2sol/wait_for_improv
Improvements to wait_for module
2013-06-30 09:20:12 -07:00
88c907af90 Merge pull request #3340 from bpennypacker/stat
get file/path facts via 'stat'
2013-06-30 09:19:06 -07:00
71b9be509c Merge pull request #3347 from AscendLearning/irc-with-pass
Added a provision for passing a server password to IRC
2013-06-30 09:17:19 -07:00
a8e8a9583b Merge pull request #3336 from lorin/htpasswd
Add htpasswd module
2013-06-30 09:15:50 -07:00
98e7eaf07a Merge pull request #3316 from dsedivec/devel
expanduser on each component of plug-in paths
2013-06-30 09:12:15 -07:00
e4e3c239c7 Merge pull request #3385 from stoned/find_plugin-cleanup
Remove redundant call to _get_path() in PluginLoader.find_plugin()
2013-06-30 08:29:09 -07:00
b7f89837bb Remove redundant call to _get_path() in PluginLoader.find_plugin() 2013-06-30 16:38:26 +02:00
a17ca862fb Return a friendly error message if aptitude isn't installed 2013-06-30 15:36:13 +12:00
037a6d497b moved modules to net_infrastructure 2013-06-29 19:59:14 -04:00
d61a65ff08 Merge pull request #3377 from kjkuan/easy_install_fix
Fix the issue of easy_install ignoring virtualenv_site_packages=yes.
2013-06-29 14:21:44 -07:00
a07324c590 Fix the issue of easy_install ignoring virtualenv_site_packages=yes. 2013-06-29 17:03:12 -04:00
a37f55d32e Add a mandatory jinja2 filter for use in templates. 2013-06-29 16:01:34 +02:00
35d8d118a4 Added notes about hostname resolution. 2013-06-28 19:51:58 +00:00
eb2653283c Added linode plugin 2013-06-28 19:11:32 +00:00
y-p
a4dfc14a6c Add doc example of attaching tags to a role 2013-06-28 16:28:41 +03:00
a439afeb8f add description about host parameters in a inventory file. 2013-06-28 17:59:47 +09:00
467f612ef6 Merge pull request #3367 from rstrox/devel
Include identity_type required by Pyrax 1.4
2013-06-27 18:15:31 -07:00
d541e68027 Elapsed time should account for the delay 2013-06-27 17:42:33 -07:00
01c9e7ea88 digital_ocean: add --env to inventory script 2013-06-27 14:52:32 -04:00
e836e5789e Include identity_type required by Pyrax 1.4 2013-06-27 13:50:36 -05:00
807f3e76db Add DigitalOcean inventory plugin
Intended to complement the recently added digital_ocean module.
2013-06-26 23:01:30 -04:00
eb082e22b8 initial arista module import 2013-06-26 22:59:23 -04:00
dc984d94ac Updates to Ansible command options
* Moved the --list-hosts option that is common to both `ansible` and
  `ansible-playbook` into utils/__init__.py (corrects a FIXME)
* Wrote new help text for the --list-hosts option that makes sense
  for both of the commands that it applies to
* Changed the usage argument in `ansible-playbook` so that it is
  setup in the base_parser method the same way that it is in
  the `ansible` executable
* Updated the help text for several options to correct typos,
  clarify meaning, improve readability, or fix grammatical errors.
  In the case of `ansible-pull`, I changed the help text so that
  it adheres to the same standards as the other executables.
2013-06-26 19:57:31 -06:00
27d90e9003 Merge pull request #3353 from j2sol/typo
Remove a trailing quote
2013-06-26 15:34:51 -07:00
95326ce41b Remove a trailing quote 2013-06-26 15:09:00 -07:00
0a10727652 Merge pull request #3350 from billwanjohi/devel
validate files: fix usage error in example tasks
2013-06-26 13:14:42 -07:00
f3093cbb1a Fixup previous apt_key patch to enable file based modes to work. 2013-06-26 14:46:29 -04:00
bf56d69df7 validate files: fix usage error in example command
visudo requires the -f option to check any other file than the default.
I've added this to the example ansible tasks.
2013-06-26 13:24:15 -05:00
d9eca9182e Merge pull request #3349 from tgerla/fixec2
ec2 inventory plugin: fix whitespace around connection validity test
2013-06-26 09:54:05 -07:00
c47d121481 don't fail if the file doesn't exist. Just set 'exists' to true/false as appropriate 2013-06-26 12:32:28 -04:00
57b72d242a ec2 inventory plugin: fix whitespace around connection validity test 2013-06-26 09:22:16 -07:00
b86d93adc9 added a provision for passing a server password to IRC 2013-06-26 14:16:59 +00:00
6853553310 Merge pull request #3343 from j2sol/add_host_changed
add_host should not be a changed action
2013-06-25 19:26:03 -07:00
56813c030f fixup appearances of config_directory, remove slash, remove hardcoded /etc/bprobe 2013-06-25 14:40:14 -06:00
59a045e4cb Fixed stat of symlinked dirs 2013-06-25 14:14:18 -04:00
e1dd83f2b6 add_host should not be a changed action
The action doesn't actually change anything on a system, so setting
the status to changed is wrong. add_host is much like set_fact in that
regard.

Since changed is False by default, there is no need to explicity set
it, so just create an empty dict for result and add to it from there.
2013-06-25 10:58:55 -07:00
19b8de7ede get file/path facts via 'stat' 2013-06-25 11:04:22 -04:00
9be93d6ac7 Better error for fireball + sudo mode. 2013-06-25 10:45:01 +03:00
f69f364b90 Add GPL header and copyright 2013-06-24 21:18:05 -04:00
445c888464 made changes as requested by mpdehaan and added code to remove key and cert pem files on removal of meter 2013-06-24 16:20:36 -06:00
f000dcd526 add more support for different size formats 2013-06-24 22:37:31 +02:00
06d92f1103 Add htpasswd module
Add a new module for managing entries in an htpasswd file, used
for basic authentication with web servers such as Apache and Nginx
2013-06-24 16:24:55 -04:00
6304b7e793 Merge pull request #3332 from jlaska/rhn_register_cfgfile_fix
rhn_register - Correctly load up2date configuration
2013-06-24 10:43:46 -07:00
4311412b44 Correctly load up2date configuration
Previously, a configuration file name of None was being passed into
up2dateInitConfig().  This resulted in a correct configuration import,
but failed to properly save the configuration back to disk in the event
a different serverURL was supplied.  This change removes support for
customizing the up2date filename entirely, and relies on up2date to
choose the default config filename.
2013-06-24 13:00:23 -04:00
f42e3bf010 Merge pull request #3323 from lorin/rabbit-pw-force
Doc: rabbitmq_user pw change and force
2013-06-23 10:52:44 -07:00
da34aec0fe Merge pull request #3322 from stoned/hacking-env-setup
Handle login shell bash processes hence match $0 with "*bash"
2013-06-23 10:00:56 -07:00
1bcc60992c Doc: rabbitmq_user pw change and force
Document that need to add force=yes to change password of
existing user
2013-06-23 11:05:09 -04:00
6d2e94966c Handle login shell bash processes hence match $0 with "*bash" 2013-06-23 15:32:45 +02:00
3839dcd56c Remove extra $ character
Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-23 14:58:09 +02:00
85b8538e0e Expand usage of Python 2.6 if statement
Syntax like "'foo' if bar else 'baz'" is not supported by all Python
versions targetted by Ansible. Hence we break it up.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-23 09:19:27 +02:00
64995bfc22 Merge pull request #3314 from benjixx/fix-digitalocean-arguments
fix wrong argument_spec in digital_ocean module
2013-06-22 15:32:06 -07:00
b32131c867 expanduser on each component of plug-in paths
ansible.constants was calling expanduser (by way of shell_expand_path)
on the entire configured value for the library and *_plugins
configuration values, but these values have always been interpreted as
multiple directories separated by os.pathsep.  Thus, if you supplied
multiple directories for one of these values, typically only the first
(at least on *nix) would have e.g. "~" expanded to HOME.

Now PluginLoader does expansion on each individual path in each of
these variables.
2013-06-22 17:01:12 -05:00
3df2e15277 Let update-rc.d set changed flag properly
When update-rc.d is used to enable/disable service, the changed flag was
always true (see #2189). This commit fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-22 20:04:37 +02:00
31bc25063e fix wrong argument_spec in digital_ocean module
as 'required' and 'default' are mutually exclusive removed 'required' in preference of 'default'
2013-06-22 14:48:25 +02:00
a61ec2e6b3 typo 2013-06-21 13:45:14 -04:00
c85b0bb05f using instance_ids and state=absent for removing instances 2013-06-21 13:43:29 -04:00
7b0b9016b5 Improve error messages on missing required variables. 2013-06-21 21:41:00 +08:00
73dda68e18 Don't turn on sudo for all tasks when setting the sudo_user or ask_sudo_pass, 2013-06-21 23:20:12 +10:00
c124411c36 Consistent wait_timeout between doc and module 2013-06-21 18:03:55 +09:00
2eaf5ee206 Fix last bugs, complete all tests. 2013-06-21 17:01:29 +08:00
17a55d6adf Update documentation 2013-06-21 13:59:09 +08:00
9c26b9ddce Add linode cloud provider. 2013-06-21 13:41:33 +08:00
7b1e87b62d Added flexible filename handling for main files
tasks, handlers, and vars main files can now be any of main, main.yml, or main.yaml
2013-06-20 22:03:17 -06:00
3a5f095693 Adds termination support to the ec2 module
Pass in the `instances` output of the ec2 module
to terminate a list of instances that were previously provisioned.

Useful for automated testing.
2013-06-20 20:00:52 -04:00
76d848331f Add submodule support to git module
This does two things:
* add --recursive option to git clone command in clone().  This will
  initialize all submodules when cloning a remote repository.
* Add submodule_update() and call that from fetch().  submodule_update()
  calls two git commands iff the file .gitmodules exists in the
  repository:
  * 'git submodule sync' - synchronizes the submodules' remote URL
    configuration setting to the value in .gitmodules.
  * 'git submodule update --init --recursive' - initialize and update
    registered submodules to the commit specified in the index of the
    containing repository.

If a repository was cloned without --recursive, submodule_update() will
ensure that the submodules are initialized and updated.
2013-06-20 14:48:39 -07:00
c7c5ac1ab6 Merge pull request #3288 from espro/devel
Update ansible.cfg
2013-06-20 14:08:45 -07:00
3eeacaba81 Updated ansible.cfg to be more consistent
Updated the example ansible.cfg to be more consistent in spacing/commented lines
2013-06-20 17:19:47 -03:00
a00c7b0c08 Comment remote_user in ansible.cfg
remote_user should not be set in example config. This file is used in rpm .spec for /etc/ansible/ansible.cfg
2013-06-20 16:14:15 -04:00
e2cf3b2d29 Update ansible.cfg
Previous commit made config invalid.
2013-06-20 15:47:45 -04:00
eb2ae8b3c2 Reference major_release, not major_version 2013-06-20 08:23:49 -04:00
bba19cb998 Fixed typo 2013-06-20 12:46:23 +02:00
541b086883 Updated documentaion for the file module 2013-06-20 12:46:23 +02:00
6c44e264c9 added possibility to force symlinks to none-existent destination (which might appear later) 2013-06-20 12:43:23 +02:00
57154b04bb added force parameter to symlink invocation, in order to force the creation in case of already existing destination with the type of 'file' 2013-06-20 12:43:23 +02:00
bbbc214ffb Remove bashisms, replace with POSIX constructs
This replaces double conditional brackets with single ones and gets ris
of bashisms, so that the tool should be sourcable from any POSIX shell.

Constructs like [ $foo = "$bar"* ] yield filesystem-globbing behaviour
according to POSIX. A compliant way is to use case statements.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-20 08:18:37 +02:00
9f4988dbfd Quote variables in shell script
In case paths contain spaces, it's better to consistently quote
variables, and to use $() instead of `` for external invocations.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-20 08:18:37 +02:00
4b9f8fc294 Replace external command with shell construct
dirname/basename do not need an external process, shell variable
expansion can be made to do the same a bit faster.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-20 08:18:11 +02:00
013cd38929 Remove shebang line
The env-setup script is not intended to be run directly, so it does not
need a shebang line, which might even create the wrong expectations.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-20 08:18:11 +02:00
fd02443d42 Enable negated patterns
A host pattern of the form '!foo' by itself does not work, but
'all:!foo' does. If the first pattern is a negation, this commit
automatically prepends 'all'.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-20 07:55:35 +02:00
995ef374db Fixup versions of newly added modules. 2013-06-19 22:39:08 -04:00
85ef79443a Fix a documentation formatting warning. 2013-06-19 22:38:04 -04:00
3f8aa8aec5 Fix up some module docs formatting errors. 2013-06-19 22:37:09 -04:00
231d9b101d YAML fix 2013-06-19 22:33:19 -04:00
b72109a04b Merge pull request #3273 from jlund/ansiblecc-to-ansibleworkscom
Update all ansible.cc references in the documentation to point to ansibleworks.com
2013-06-19 19:31:34 -07:00
727cee509c Merge branch 'PR_add_chdir_to_pip' of git://github.com/y-p/ansible into devel
Conflicts:
	library/packaging/pip
2013-06-19 22:30:44 -04:00
4c51a6141b Merge remote branch 'origin/devel' into devel 2013-06-19 22:29:12 -04:00
010440dc47 Merge pull request #3114 from laggyluke/roles_combine_vars
Added basic support for hash_behaviour=merge in roles
2013-06-19 19:27:27 -07:00
200bd75426 Merge pull request #3149 from blandonnimrat/devel
added error checking on connect_to_region() in ec2.py
2013-06-19 19:26:17 -07:00
49eb772667 Update changelog 2013-06-19 22:25:48 -04:00
4c43264033 Various code reformatting 2013-06-19 22:23:31 -04:00
db94171f5b Merge branch 'rds' of git://github.com/bpennypacker/ansible into rds 2013-06-19 22:11:41 -04:00
2ed9b52481 Quote some strings in the docs 2013-06-19 22:10:48 -04:00
3570c191c0 Update changelog 2013-06-19 22:10:01 -04:00
dbbb2bc269 Merge remote branch 'origin/devel' into devel 2013-06-19 22:09:22 -04:00
e1abda42a9 Merge pull request #3171 from mynameisdaniil/devel
Adds 'groups' field into ec2 plugin
2013-06-19 19:06:29 -07:00
3060e66e77 Update CHANGELOG 2013-06-19 22:03:49 -04:00
7b7cd855c4 Merge pull request #3091 from sdossett/with_inventory_hostnames
with_inventory_hostnames inventory based lookup plugin
2013-06-19 19:02:55 -07:00
fc45470162 Merge branch 'with_inventory_hostnames' of git://github.com/sdossett/ansible into inv_hostnames 2013-06-19 22:01:57 -04:00
c80ad67d7e Merge pull request #3226 from jpmens/ini_file2
ini_file: add support for lists of options/values
2013-06-19 18:59:19 -07:00
b1596073c5 update changelog 2013-06-19 21:58:38 -04:00
2e680019c9 Merge remote branch 'origin/devel' into devel 2013-06-19 21:56:59 -04:00
faaa90ed03 Merge branch 'ocean' into devel
Conflicts:
	library/cloud/digital_ocean
2013-06-19 21:53:33 -04:00
c9c45ac597 Reformat examples 2013-06-19 21:52:59 -04:00
cc1cb01540 Rename digital ocean module to digital_ocean, add documentation. 2013-06-19 21:49:05 -04:00
66b5689afb Ensure an existing ssh-key returns useful information (id + name) instead of a string; this way it can be used to register a variable to use in a later task. 2013-06-19 21:48:52 -04:00
60d1ff125e Add digital-ocean cloud support. 2013-06-19 21:48:41 -04:00
f9a09e10e5 Merge branch 'digitalocean' of git://github.com/devo-ps/ansible into ocean 2013-06-19 21:48:19 -04:00
5ac1e7d0ca Merge pull request #3209 from madduck/generalise-hacking-dir-path-discovery
Generalise hacking dir path discovery
2013-06-19 18:47:21 -07:00
4553b3d0cf Merge branch 'generalise-hacking-dir-path-discovery' of git://github.com/madduck/ansible into envsetup2 2013-06-19 21:43:59 -04:00
0ce7996bb6 Merge pull request #3266 from trbs/20130619_first_found
enable use of multiple terms in first_found
2013-06-19 18:39:29 -07:00
ffb94f2e71 Merge branch 'purge' into devel 2013-06-19 21:38:39 -04:00
6a7dac6176 Fix purging of packages
A small error in the reuse of a variable caused packages to never get
purged. This commit fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-19 21:37:37 -04:00
50fa88f28a Merge branch 'fix-apt-purge' of git://github.com/madduck/ansible into purge 2013-06-19 21:35:28 -04:00
0f81d1630f * Updated all ansible.cc references in the documentation to point
to ansibleworks.com
* Fixed a few misspelled words
2013-06-19 19:34:02 -06:00
6d6df1959c Merge pull request #3259 from dirtyharrycallahan/b_setup
bug fix: modify get_device_facts to handle servers with multiple pci domains
2013-06-19 18:24:10 -07:00
d2721526de Small tweak, don't merge conditionals, just evaluate each in turn. 2013-06-19 21:18:05 -04:00
58f5bfb4c1 Merge pull request #3252 from tgerla/gettingstarted
Explicitly mention the Linux requirement for the Ansible machine, remove...
2013-06-19 17:08:11 -07:00
20104bf14d Correct description in CHANGELOG 2013-06-19 19:56:59 -04:00
6ff05e0fc0 Update CHANGELOG 2013-06-19 19:01:18 -04:00
d9c0a5c37d Revert "now modules can implement with_items list globbing w/o updating"
This reverts commit 4942a06bc2.

Conflicts:

	lib/ansible/runner/__init__.py
2013-06-19 19:00:18 -04:00
56bfae361f initial commit of boundary_meter module 2013-06-19 16:01:47 -06:00
07bea63533 Allow 'ec2.group' field to handle lists of groups 2013-06-20 01:23:30 +04:00
e8db983684 Merge pull request #3267 from SirScott/changelog
It's WITH_ITEMS_USES_LIST not WITH_ITEMS_WANTS_LIST.
2013-06-19 14:16:23 -07:00
46c7809e6e It's WITH_ITEMS_USES_LIST not WITH_ITEMS_WANTS_LIST. 2013-06-19 09:44:21 -06:00
0bd92d8196 Merge pull request #3262 from j2sol/add-host-name
make name the parameter, with hostname as alias
2013-06-19 08:33:12 -07:00
5b1babbdc0 Merge pull request #3260 from lorin/migrate-noinput
django_manage: Pass --noinput to migrate
2013-06-19 08:31:19 -07:00
d0a4f2d1e4 Merge pull request #3264 from arturaz/devel
datadog_event module requires urllib2, not httplib2.
2013-06-19 08:27:13 -07:00
87c7fa9138 enable use of multiple terms in first_found 2013-06-19 16:37:29 +02:00
9098908cc8 Set master_password for modify command 2013-06-19 09:35:50 -04:00
ae42144752 Always assume purged for older python-apt
Older python-apt modules don't export Package.installed_files and there
seems to be no other way to figure out if a package is
removed-but-not-purged, so we just always assume it's purged.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-19 10:56:43 +02:00
0ea0a2c6d7 datadog_event module requires urllib2, not httplib2. 2013-06-19 11:17:05 +03:00
420f7d7ac6 Introduce non-purged package status
A package may be removed but not purged with APT. The only way to
identify this state is by looking at the list of installed files of
a package. Even if the package has no files installed, this list will be
non-empty until the package is removed:

  # python -c "import apt; c=apt.Cache(); c.update(); c.open(); p=c['ruby1.8']; print p, p.installed, p.installed_files"
  <Package: name:'ruby1.8' id:1425> None [u'']

  # dpkg --purge ruby1.8
  (Reading database ... 27904 files and directories currently installed.)
  Removing ruby1.8 ...
  Purging configuration files for ruby1.8 ...

  # python -c "import apt; c=apt.Cache(); c.update(); c.open(); p=c['ruby1.8']; print p, p.installed, p.installed_files"
  <Package: name:'ruby1.8' id:1425> None []

See http://bugs.debian.org/712749 too.

If a package is not marked installed but it still 'has_files', then it
should be processed if the request is to purge it.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-19 10:00:33 +02:00
8e37a2bec9 Fix purging of packages
A small error in the reuse of a variable caused packages to never get
purged. This commit fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-19 10:00:33 +02:00
c642ba77ae Added basic support for hash_behaviour=merge in roles
Dict vars passed to roles are now properly merged
instead of simply overriding dict vars that are
coming from vars_files.
2013-06-19 09:14:20 +03:00
1074896105 make name the parameter, with hostname as alias
name is used throughout Ansible, it's the "standard". This change
applies that standard to the add_host routine and updates the docs to
reflect that. Related to https://github.com/ansible/ansible/pull/3254
2013-06-18 21:11:52 -07:00
1ef1b03bf6 django_manage: Pass --noinput to migrate
The django 'migrate' command should receive the --noinput command,
otherwise it can block waiting for user input.
2013-06-18 23:05:40 -04:00
b5b862fe6f bug fix: modify get_device_facts to handle servers with multiple pci domains
On machines with multiple pci domains get_device_facts would fail to
find a matching pci device causing setup to fail. Also on some platforms
there is additional information between the pci information and 'host'.
Modified get_device_facts to call lspci with the -D option and modified
the regex to account for the pci domain and to be more selective.
2013-06-18 22:48:05 -04:00
f2cf8d3e67 Fine-tune Ansible control system OS requirements a bit 2013-06-18 18:19:58 -07:00
fc2d25eb82 Merge pull request #3127 from bennojoy/devel
bug fix for #3077, environment settings for script
2013-06-18 17:57:10 -07:00
575e052c6c Merge pull request #3147 from toshywoshy/setup_mtab_without_bind
changed get_mount_facts to ignore mount types 'none'
2013-06-18 17:56:49 -07:00
132c89e681 Merge branch 'callbackinit' of git://github.com/sergevanginderachter/ansible into devel 2013-06-18 20:52:43 -04:00
51bda285bd update changelog 2013-06-18 20:33:32 -04:00
1e3ab98a13 Merge pull request #3219 from arturaz/devel
datadog_event module: submit your events to DataDog service.
2013-06-18 17:31:52 -07:00
dd7f7d5593 Merge branch 'file_hard' of git://github.com/bcoca/ansible into devel
Conflicts:
	library/files/file
2013-06-18 20:31:05 -04:00
e90d0be199 Update the changelog with everything that has happened so far. 2013-06-18 20:28:46 -04:00
61ac8d03af Clarify module docs 2013-06-18 20:19:29 -04:00
31b63b033b Merge conflict 2013-06-18 20:18:17 -04:00
96134d003e Merge remote branch 'origin/devel' into devel 2013-06-18 20:17:31 -04:00
51ba3d8c3d Merge pull request #3230 from sayap/openrc
Add OpenRC support to the service module.
2013-06-18 17:13:06 -07:00
273f37b394 Merge pull request #3255 from jlund/sha256-example-cleanup
Removed merge conflict header
2013-06-18 17:08:59 -07:00
7193ff5fbf Merge pull request #3250 from gildegoma/more_magical_ansible_ssh_user
Make 'ansible_ssh_user' available in templates
2013-06-18 17:08:29 -07:00
2f1420f071 Merge pull request #3258 from j2sol/apt-doc
pkg option of apt is not required
2013-06-18 16:56:35 -07:00
43fba4e307 Merge pull request #3256 from DMBuce/pkgbuild-update
Fix typo in PKGBUILD
2013-06-18 16:56:03 -07:00
cbd54f6c2e Merge pull request #3257 from jimt/patch-1
spelling ansbile->ansible
2013-06-18 16:53:43 -07:00
86bc2ec08a pkg option of apt is not required
You can use apt module with update_cache and without specifying a
package. Update the docs to reflect this.
2013-06-18 16:25:46 -07:00
240a52906e spelling ansbile->ansible 2013-06-19 10:37:02 +12:00
e04ee519ef Fix typo in PKGBUILD
ansbile.cfg -> ansible.cfg
2013-06-18 17:31:34 -04:00
bb4de94937 Removed merge conflict header 2013-06-18 15:01:01 -06:00
b4358d1300 Merge branch 'apt_key_file' of git://github.com/veeti/ansible into devel
Conflicts:
	library/packaging/apt_key
2013-06-18 16:18:31 -04:00
a94e404a97 Merge pull request #3236 from lwade/ec2_placementzone
Added placement_group parameter for cluster compute. Issue 3232.
2013-06-18 13:14:03 -07:00
6f426f7986 Explicitly mention the Linux requirement for the Ansible machine, and remove a vestigial heading. 2013-06-18 12:12:37 -07:00
89ee762ab7 Merge pull request #3247 from SirScott/vars_prompt_docs
Document the 'default' argument for vars_prompt.
2013-06-18 11:48:49 -07:00
583b3e5957 Merge pull request #3251 from jlund/sucess-typo-fix
Fixed a few small typos
2013-06-18 11:47:49 -07:00
2123507315 Merge branch 'sha256' of git://github.com/jlund/ansible into devel
Conflicts:
	library/network/get_url
2013-06-18 14:46:57 -04:00
92754065bf Remove debug statement. 2013-06-18 14:41:52 -04:00
ba853b8c1a Fixed a few small typos 2013-06-18 12:26:40 -06:00
bac81be3f9 Add undefined variables feature to example config file. 2013-06-18 13:31:08 -04:00
5a504e3a3b Tweak error messages for undefined variables feature. 2013-06-18 13:30:02 -04:00
637983cf31 cleanup example config file + Squashed commit of the following:
commit c36b66dc952dfff91043ecbca56cf3f1f8f00703
Merge: 240d7bf f4cf934
Author: Michael DeHaan <michael@ansibleworks.com>
Date:   Tue Jun 18 13:04:51 2013 -0400

    Merge branch 'unevaluated-vars' of git://github.com/lorin/ansible into lorin_undefined

    Conflicts:
    	lib/ansible/runner/__init__.py

commit f4cf934367
Merge: 2531440 07a1365
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu Jun 6 11:07:41 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 253144045c
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu Jun 6 11:06:37 2013 -0400

    Fail template from file on undefined vars

    If config option is set, raise an exception if templating from a
    file and a variable is undefined.

commit aecb71d8b7
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Wed Jun 5 17:12:12 2013 -0400

    Add fail_on_undefined flag

    Add a fail_on_undefined flag to the template and template_from_string methods.

    If this flag is true, then re-raise the ninja2.excpetions.UndefinedError instead of
    swallowing it.

commit cbb1808f05
Merge: d4bbf49 41425fb
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Wed Jun 5 16:14:12 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit d4bbf492b0
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Mon Jun 3 19:46:13 2013 -0400

    template: Raise UndefinedError exception

    In template_from_string, raise an undefined error if it occurs.

    Have the caller catch it and throw an AnsibleUndefinedVariable

commit c947802805
Merge: 8d919d6 be33bcf
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Mon Jun 3 10:09:43 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 8d919d6c97
Merge: 0f68ad8 b8630d2
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu May 30 16:27:48 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 0f68ad8193
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu May 30 14:32:03 2013 -0400

    Optionally fail task on undefined variables

    This patch introduces a new configuration option called
    error_on_undefined_vars, which defaults to false.

    If this option is set to true, then a task which has unevaluated
    variables in its arguments will fail instead of running. Output looks
    like this:

        TASK: [set rabbitmq password] *************************************************
        fatal: [10.20.0.7] => Undefined variables: rabbitmq_user, rabbitmq_password
2013-06-18 13:24:30 -04:00
48fe7ac19d Enlarge scope of 'ansible_ssh_user' magic variable
Allow to use ansible_ssh_user variable in `sudo_user` or `when` clauses
2013-06-18 17:53:52 +02:00
cc12b85e49 Document the 'default' argument for vars_prompt. 2013-06-18 09:25:51 -06:00
240d7bf197 Use new site URLs in README 2013-06-17 22:20:31 -06:00
25b43cf6ec Merge pull request #3231 from jpmens/docs_more
Docs: consistently format playbook EXAMPLES
2013-06-17 20:48:02 -07:00
cadecc0a52 Merge pull request #3240 from SirScott/vars_prompt_defaults
Display default value in prompt when using vars_prompt
2013-06-17 20:31:50 -07:00
6d19150bb1 Merge pull request #3242 from bcoca/mount_findbin
now mount/unmount binaries are searched for instead of hardcoded
2013-06-17 20:31:12 -07:00
9af24f5345 Merge branch 'a_devel' into digitalocean 2013-06-18 10:46:42 +08:00
d4b5122ad9 Rename digital ocean module to digital_ocean, add documentation. 2013-06-18 10:45:45 +08:00
c9c7b01620 now mount/unmount are searched for instead of hardcoded
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-06-17 17:01:35 -04:00
b10b676158 Print the default value if one is provided. 2013-06-17 14:15:31 -06:00
77159d21da Add apt_key examples for file and data 2013-06-17 18:23:40 +03:00
898889d20e added try/except around conn.get_all_dbinstances 2013-06-17 09:42:42 -04:00
d25622f17e changed 'action' to 'command'. Fixed a tab issue. 2013-06-17 09:39:45 -04:00
886a71e8eb Added placement_group parameter for cluster compute. 2013-06-17 14:35:53 +01:00
30d641094b Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
bfcead8c33 Remove reference to non-existant module. 2013-06-16 23:33:49 -04:00
bcca609bc6 Add OpenRC support to the service module. 2013-06-17 11:29:48 +08:00
e128e8b563 Merge pull request #3162 from strawlab/apt-key-binary-fix
allow apt-key module to work with binary key
2013-06-16 20:27:10 -07:00
3e1e163ec3 Merge pull request #3172 from gw0/fix-mongodb2.2-compat
Fix `mongodb_user` compatibility with MongoDB 2.2 (used in Debian 7).
2013-06-16 20:24:31 -07:00
45f9642730 Merge branch '20130613_xbits' of git://github.com/trbs/ansible into devel 2013-06-16 23:23:32 -04:00
aa340c1508 Merge pull request #3169 from Debilski/fix-duplicate-host-reads
Allow inventory to be read from a pipe
2013-06-16 20:22:54 -07:00
fe9849530c Merge pull request #3120 from chrisgardner/solaris-os-facts
Add Solaris O/S distribution facts
2013-06-16 20:18:43 -07:00
fda74110bd Merge pull request #3202 from trbs/20130613_docs_fix_ansible_cfg_loading_order
docs fix ansible cfg loading order
2013-06-16 20:17:25 -07:00
f698ab9232 Merge pull request #3204 from goozbach/devel
fixed msg bug in library/cloud/quantum_network
2013-06-16 20:16:14 -07:00
7b763dc487 adds 2 django commands (migrate, collectstatic)
Signed-off-by: Jochen Maes <jochen@sejo-it.be>
2013-06-16 23:15:43 -04:00
70a9be27f6 Merge pull request #3217 from dagolden/topic/late-sudo_user
Expand sudo_user after variable merging
2013-06-16 19:56:01 -07:00
306caf84f9 Merge pull request #3218 from lorin/fileglob-roles
Document: with_file(glob) relative path and roles
2013-06-16 19:52:22 -07:00
af9b510769 Merge pull request #3220 from dsedivec/devel
Improve Markdown (and other) module doc output
2013-06-16 19:50:48 -07:00
17cf833e0e Merge branch 'user_password_update_optional' of git://github.com/bcoca/ansible into devel
Conflicts:
	library/system/user
2013-06-16 22:49:06 -04:00
2eb3a9a3c9 Resolve docs conflict. 2013-06-16 22:48:11 -04:00
572f49b11f Fix merge conflict. 2013-06-16 22:47:29 -04:00
c3544de1df Merge pull request #3228 from skvidal/facts.d
first cut and docs for facts.d mechanism for setup module
2013-06-16 19:46:02 -07:00
58e8a97e91 Merge pull request #3225 from eest/openbsd_pkg-check_mode
openbsd_pkg: Add check_mode support.
2013-06-16 19:40:46 -07:00
613df1d649 Merge pull request #3213 from veeti/apt_key_data
Document the data argument for apt_key
2013-06-16 19:39:55 -07:00
d9f91be34a Merge pull request #3227 from bcoca/modules_wantlist
implementing with_items list globbing made easier for modules
2013-06-16 19:29:02 -07:00
f87299842c Merge pull request #3199 from chrishoffman/doc_error
Fixing documentation error
2013-06-16 19:28:12 -07:00
294230d529 Merge pull request #3177 from stintel/mysql56-compat
Fix MySQL 5.6 compatibility
2013-06-16 19:27:17 -07:00
936e61fc28 Merge pull request #3181 from melodous/devel
HP-UX virtualization facts
2013-06-16 19:26:07 -07:00
a4223e119d fixed x-bits in git 2013-06-16 22:22:16 -04:00
4849539399 Merge pull request #3194 from E-M/patch-2
Fixed Issue #3193 - make rhn_register module compatible with EL 5
2013-06-16 19:17:05 -07:00
78fdedd490 Merge remote branch 'origin' into devel
Conflicts:
	library/web_infrastructure/django_manage
2013-06-16 22:15:30 -04:00
512d7ba531 Spelling fixes 2013-06-16 22:09:35 -04:00
a1d1ce8360 Merge branch 'docs_examples' of git://github.com/jpmens/ansible into standardize_docs 2013-06-16 22:07:20 -04:00
f0d66f0cda Merge pull request #3176 from jpmens/sol-epoch
setup epoch time doesn't have tics on Python 2.6.4 (Solaris).
2013-06-16 19:06:19 -07:00
36df7e8c95 cut and docs for facts.d mechanism for setup module 2013-06-15 18:31:31 -04:00
4942a06bc2 now modules can implement with_items list globbing w/o updating
hardcoded lists in ansible code, just add WITH_ITEMS_USES_LIST in a
comment anywhere, and of course, support recieving params as list.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-06-15 16:28:43 -04:00
af051d6f77 ini_file: add support for lists of options/values 2013-06-15 22:21:34 +02:00
5c69918d53 DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition)
Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string
  Added deprecation warning to moduledev.rst and remove deprecated example from it
  Fixed up a few typos and uppercased some acronyms.
  add consistency to how EXAMPLES are formatted
2013-06-15 20:54:25 +02:00
2470c3f26d now you have the option to NOT set the password if the user already exists,
this works well for 'initial password setting' on user creation and avoids
having extra tasks and conditionals.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-06-15 12:16:25 -04:00
9e6a584c3f Added hardlink option
Also a bit nicer now with failures
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-06-15 11:14:34 -04:00
9dfc420927 openbsd_pkg: Add check_mode support.
The biggest change has been to package_latest since it was previously
just comparing version numbers before and after an upgrade had run.
We now parse the output from a dry run instead.

Thanks to Johan Belin for triggering the discussion :).
2013-06-15 16:27:45 +02:00
0bd5fe9951 Merge pull request #3221 from sergevanginderachter/filedocfix
docfix on file module, aliases for path parameter
2013-06-14 15:24:21 -07:00
8b188429c7 docfix on file module, aliases for path parameter 2013-06-14 20:45:58 +02:00
7681b1ce68 Improve Markdown (and other) module doc output
- The html_ify filter now escapes HTML found in module documentation.
  THIS COULD AFFECT MORE THAN JUST MARKDOWN but I didn't see any modules
  expecting to use e.g. HTML entities or HTML tags in their
  documentation.

- The markdown_ify filter (used as jpfunc in markdown.j2) escapes at
  least a few Markdown in-line formatting characters.

- Improvements to markdown.j2:

    - Call jpfunc on the module name heading so that it gets escaped for
      Markdown (e.g. my_module_name becomes my\_module\_name).

    - Added paragraph breaks between paragraphs in the description.

    - Added examples heading, which is consistent with the notes heading
      below it.
2013-06-14 13:27:59 -05:00
b86740e1fd datadog_event module: submit your events to DataDog service. 2013-06-14 18:36:14 +03:00
d7ba2e06eb Document: with_file(glob) relative path and roles
Document that with_file and with_fileglob path is relative to
the files directory inside of a role.
2013-06-14 11:15:45 -04:00
d65f45f0b2 Expand sudo_user after variable merging
Previous commit c3659741 expanded sudo_user during task construction,
but this is too early as it does not pick up variables set during
the play.

This commit moves sudo_user expansion to the runner after variables
have been merged.
2013-06-14 09:59:31 -04:00
1284bfd742 Add a file argument to apt_key 2013-06-14 14:34:04 +03:00
dcb06a2306 Document the data argument for apt_key 2013-06-14 14:32:56 +03:00
3b008d6fa6 Expand usage synopsis
'source' is actually a "bashism" and the POSIX-way of sourcing a file
uses the single dot (which is arguably less readable). Both yield the
same result, and since the script may now also be sourced from
within the hacking directory, this commit expands the usage synopsis
accordingly.

Signed-off-by: martin f. krafft <madduck@madduck.net>

Conflicts:
	hacking/env-setup
2013-06-14 10:39:58 +02:00
581dea70d1 Generalise determination of hacking directory path
Bash needs a special case to determine the dirname of the sourced path
(the hacking dir), but in all other cases, using $0 allows the script to
be sourced also from within the hacking directory, not only from its
parent.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-14 10:39:26 +02:00
f9e3480d12 Ensure an existing ssh-key returns useful information (id + name) instead of a string; this way it can be used to register a variable to use in a later task. 2013-06-14 14:59:52 +08:00
fd5bb8c7f7 Add digital-ocean cloud support. 2013-06-14 11:56:01 +08:00
0840af5bda fixed msg bug in library/cloud/quantum_network 2013-06-13 23:02:04 -04:00
8a55210fb6 Removing all the default: null from the documentation 2013-06-13 20:43:14 -04:00
653fac2f5c fix loading order of ansible.cfg in documentation 2013-06-13 23:13:54 +02:00
10dc5ae876 minor fix, path name of ansible.cfg in changelog 2013-06-13 23:09:22 +02:00
cf2ddb6f80 Merge pull request #3197 from lorin/doc-fixup
Fix broken link in django_manage doc
2013-06-13 14:05:58 -07:00
0d4eec36f4 fixed x-bits in git 2013-06-13 23:05:08 +02:00
499c7309e3 Fixing documentation error 2013-06-13 15:19:35 -04:00
d2ea9d85d0 Fix broken link in django_manage doc 2013-06-13 14:01:32 -04:00
46ad4299a8 Fixed Issue #3193 2013-06-13 15:17:35 +03:00
39aa5e5eac Merge pull request #3175 from jpmens/setup9
Protect None value in setup module (ansible 1.2)
2013-06-13 04:22:15 -07:00
de7487f316 Merge pull request #3179 from ralphbean/docs-typofix
Fix a typo in the docs.
2013-06-13 04:21:36 -07:00
e6f745e2a8 Merge pull request #3189 from E-M/patch-1
Fixed module rhn_register name in examples section
2013-06-13 04:20:52 -07:00
E-M
170a5f36f1 Fixed module name in examples section
Examples showed that modules name is rhnreq_ks, when it actually is rhn_register.
2013-06-13 11:13:53 +03:00
2a7f9df109 add support for callback_plugins/ relative to playbook 2013-06-12 23:54:00 +02:00
14eda0d125 Added replication_source to the results 2013-06-12 16:22:35 -04:00
f9f0f5ce2c HP-UX virtualization facts 2013-06-12 18:59:20 +02:00
1ef29a3654 endpoint is available only when instance is available 2013-06-12 11:44:33 -04:00
dd5707ddd9 Well, a little more readability. 2013-06-11 14:58:28 -04:00
416e72c900 Fix a typo in the docs. 2013-06-11 14:54:42 -04:00
c9e373dd7d Added modify action 2013-06-11 13:11:11 -04:00
26c37d7c07 added 'facts' action 2013-06-11 10:45:50 -04:00
767c208e6c Fix MySQL 5.6 compatibility
In MySQL 5.6, the root account created by default during MySQL
installation has the PROXY ... WITH GRANT OPTION privilege for ''@'',
that is, for all users.

The mysql_user module tries to revoke this privilege, but this fails:
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near '''@'' FROM 'root'@'localhost''
at line 1")

Quick fix: don't revoke privilege if user is root and the privilege to
revoke contains PROXY.
2013-06-11 15:00:14 +02:00
f6521d88f5 setup epoch time doesn't have tics on Python 2.6.4 (Solaris). 2013-06-11 09:13:32 +02:00
3f301fd439 Protect None value in setup module 2013-06-11 07:08:55 +02:00
643b5e2c5d Fix dead link, remove redundant section. 2013-06-10 18:37:56 -04:00
47c8396598 Fix mongodb_user compatibility with MongoDB 2.2 (used in Debian 7). 2013-06-10 22:43:50 +02:00
1fd863cf5d Update docs to reference release tarball directory on new site. 2013-06-10 16:06:58 -04:00
d62beb2df5 fixed bug in delete action - skip_final_snapshot must always be set 2013-06-10 15:49:38 -04:00
18c8382fb2 Update .gitignore 2013-06-10 15:46:16 -04:00
404b082d82 Version bump and assorted things to start new development version. 2013-06-10 15:34:52 -04:00
f67c13f8f1 Update packaging dates in preparation for release. 2013-06-10 15:24:09 -04:00
ba21f8e3d3 Merge pull request #3168 from tgerla/doccontent
re-add docs css class required for some theme elements
2013-06-10 11:45:26 -07:00
3d21dab705 Small fix so template plugins can see inject variables. 2013-06-10 14:23:48 -04:00
041a4872fe Amazon RDS module 2013-06-10 12:17:31 -04:00
71afb9e432 Use with guard for file reads. 2013-06-10 17:16:31 +02:00
deaf499ba1 Remove duplicate host file reads by removing a legacy check.
This allows using a form such as

    ansible -i <( arbitrary command ) all -m ping
2013-06-10 17:15:12 +02:00
8a9cded133 re-add docs css class required for some theme elements 2013-06-10 07:57:13 -07:00
790a145f6c Use get_bin_path for blkid and add some aliases to the filesystem module. 2013-06-10 10:39:19 -04:00
36e9cf5d7d Mention YAML variable quoting. 2013-06-09 21:35:51 -04:00
36c3c91d6e Add roles to glossary. 2013-06-09 21:20:35 -04:00
573d5f620f Merge pull request #3159 from cchurch/devel
Callback Plugin Context / Naming Fixes
2013-06-09 18:19:57 -07:00
b0bf39ef6c Merge pull request #3163 from DMBuce/pkgbuild-update
PKGBUILD update
2013-06-09 18:18:22 -07:00
02f416ec69 Merge pull request #3164 from DMBuce/doc-update
Doc update
2013-06-09 18:14:53 -07:00
dfb3fe2d28 Include docs, config in Arch package 2013-06-09 17:36:24 -04:00
64610c585a Add provides=('ansible') to PKGBUILD
This lets packages use ansible-git as a dependency in place of ansible.
2013-06-09 17:36:12 -04:00
af54efa56a Let makepkg control compression of man pages
makepkg will automatically compress man pages in MAN_DIRS if 'zipman'
is in the OPTIONS array of makepkg.conf.
2013-06-09 17:19:02 -04:00
7d2422cf92 Update supported package managers
Ansible has modules for package managers other than yum and apt,
so update the documentation accordingly.
2013-06-09 17:16:08 -04:00
563147d344 Reference Inventory & Patterns more
Link to the Inventory & Patterns page in places where the Getting
Started guide refer to it, so that users unfamiliar with the
inventory syntax can easily familiarize themselves with it.
2013-06-09 17:16:08 -04:00
94e66ef558 allow apt-key module to work with binary key 2013-06-09 20:03:28 +00:00
edb6a683f3 Merge pull request #3160 from tgerla/toctree
show entire doc index in left sidebar on the documentation home page
2013-06-09 11:10:54 -07:00
b3e0071635 show entire doc index in left sidebar on the documentation home page 2013-06-09 11:04:16 -07:00
92dce671bb Resolve merge commit 2013-06-09 13:57:20 -04:00
d706aca82b Merge 2013-06-09 13:55:58 -04:00
d1de7839d7 Renamed on_no_hosts_matched/on_no_hosts_remaining to correct names in noop callback, added methods to callback plugin examples. 2013-06-09 12:19:07 -04:00
3f17a39238 Set current play/task to None for callback context when finished running the current play/task. 2013-06-09 12:17:57 -04:00
6f8e9c1b29 Merge pull request #3156 from jlund/authorized_key
Updates to the authorized_key documentation
2013-06-08 11:24:15 -07:00
a7e8f37dcc Update changelog to reflect module renames. 2013-06-08 14:18:58 -04:00
41bded178d Rename module 2013-06-08 14:18:31 -04:00
2f37314d41 Revise section referencing 1.1 since release is Monday. Will push with release. 2013-06-08 14:15:10 -04:00
cabeafc550 Remove 1.1 reference (docs will be pushed with release of 1.2) 2013-06-08 14:14:12 -04:00
305694a847 Update "added in" version in zypper, update doc name of rhn_register module. 2013-06-08 14:09:37 -04:00
cbee66c88b Rename module 2013-06-08 14:08:52 -04:00
c26d39c9d4 Rename rhnreg_ks to rhn_register 2013-06-08 14:08:23 -04:00
f452241967 update changelog 2013-06-08 14:07:37 -04:00
e2a112d22d Update changelog 2013-06-08 14:07:37 -04:00
d0ded631d6 Merge pull request #3148 from jlaska/rhnreg_ks
Add rhnreg_ks module
2013-06-08 11:06:24 -07:00
3b86690b54 Merge pull request #3145 from dirtyharrycallahan/f_zypper
Simple zypper module to install, remove, or upgrades packages.
2013-06-08 11:04:41 -07:00
c1ec8ead6c BUG FIX: Add package name to the cmd. 2013-06-07 23:31:21 -04:00
51c7441244 Updates to the authorized_key documentation
* Clarified the meaning of 'user'
* Changed 'sshdir' to 'path' in the example
  * 'sshdir' is used internally in the module, but the argument is 'path'
* Made the capitalization consistent in the descriptions
2013-06-07 15:43:42 -06:00
f4db6d1a91 fixed whitespace and added a comment to explain if statement 2013-06-07 18:25:14 +00:00
6059ce34e3 Minor adjustments to subscription_manager and rhnreg_ks 2013-06-07 14:18:23 -04:00
4733dc6b5b added error checking around boto ec2 connection errors when using a bad region name 2013-06-07 18:13:22 +00:00
65993e8f35 Reorganize subscription_manager module.
Also ...
 * When unregistering, first unsubscribe from all content
2013-06-07 14:07:00 -04:00
a2cbcec328 The rhnreg_ks module acts as a wrapper to the command 'rhnreg_ks'. The
rhnreg_ks command allows users to manage registration to a Red Hat
Network (RHN) (e.g. rhn.redhat.com) server.  The moduel will also
interact with the specified RHN system via XMLRPC as needed.

Before proceeding with registration, the rhnreg_ks module will enable
the system to receive updates from RHN.  This involves enabling the
appropriate RHN yum plugin, as well as disabling an active
subscription-manager yum plugin.

Once enabled, the module will support the following operations:
 * configure
 * register
 * subscribe to custom child channels (see `rhn-channel` command)
 * unregister
2013-06-07 13:45:25 -04:00
37f15d0216 Setting version_added for this feature to 1.3 2013-06-07 11:37:41 -06:00
f76043f404 changed get_mount_facts to ignore mount types 'none' 2013-06-07 16:55:33 +02:00
79b56667e3 Simple zypper module to install, remove, or upgrades packages. 2013-06-06 21:57:32 -04:00
e204394c2c Update CHANGELOG 2013-06-06 19:21:57 -04:00
df4c444571 Fixup doc YAML 2013-06-06 19:21:18 -04:00
6b15c871ee Merge branch 'subscription_manager' of git://github.com/jlaska/ansible into devel 2013-06-06 19:16:22 -04:00
1db7795e34 Merge pull request #3142 from mmoya/devel
Update changelog
2013-06-06 15:53:42 -07:00
41451aced9 Update changelog 2013-06-07 00:04:38 +02:00
19b7cb6653 Updated examples and documentation 2013-06-06 16:30:06 -04:00
25822330a2 Add support for multiple ranges in a host
e.g.  db[01:10:3]node-[01:10]

- to do this we split off at the first [...] set, getting the list
  of hosts and then repeat until none left.
- also add an optional third parameter which contains the step. (Default: 1)
  so range can be [01:10:2] -> 01 03 05 07 09
2013-06-06 22:27:30 +02:00
3ba19bf369 Add RHN subscription_manager module
The subscription_manager module acts as a wrapper to the command
'subscription-manager'.  The subscription-manager utility allows users
to manage RHN registration, subscription and yum repositories from the
Red Hat Entitlement platform.

Currently, this module supports the following sub-commands:
 * config
 * [un]register
 * subscribe
2013-06-06 15:00:38 -04:00
07a1365c55 Merge pull request #3128 from lorin/ex-fix
lineinfile example: /etc/host[s]
2013-06-06 06:08:55 -07:00
4372e4f6fb Merge pull request #3125 from melodous/devel
Facts for HP-UX
2013-06-06 06:06:47 -07:00
b94fde28fe Merge pull request #3133 from Gavitron/devel
quick and dirty bugfix for irc module
2013-06-06 06:05:13 -07:00
16ffac4784 Merge pull request #3137 from Barthalion/devel
Add info about apk-tools module to contrib.rst.
2013-06-06 06:04:33 -07:00
cd65bbc1c4 Add info about apk-tools module to contrib.rst. 2013-06-06 15:00:05 +02:00
561d79b6d4 quick and dirty fix for irc module - shadowIRCd discards unbuffered
input, and the extra channel hash on join wasn't helping either.
2013-06-05 17:12:44 -07:00
04aa74ddf1 lineinfile example: /etc/host[s]
Change a lineinfile example from /etc/host to /etc/hosts
2013-06-05 13:54:37 -04:00
017e7f24ed bug fix for #3077, environment settings for script 2013-06-05 19:59:39 +05:30
2475bc416c Facts for HP-UX 2013-06-05 14:01:18 +02:00
41425fb535 Merge pull request #3121 from tgerla/devel
fix AWS page heading styles for 'pending information'
2013-06-05 04:59:07 -07:00
9b8478c596 Merge pull request #3123 from zonk1024/inventory-skips-dotfiles
Skip dotfile in hosts dirs
2013-06-05 04:58:45 -07:00
2ce7f136b2 * Added a sha256 method to module_common
* Added a sha256sum parameter to the get_url module to enable
cryptographic verification of downloaded files
* Fixed a few typos in the documentation
2013-06-04 23:28:28 -06:00
588d4080df don't want to ignore explicit cwd 2013-06-04 21:06:49 -07:00
69db160e2f Skip dotfile in hosts dirs 2013-06-04 18:16:09 -07:00
a26cbd957c fix heading styles for 'pending information' to avoid creating a new top-level chapter 2013-06-04 14:57:43 -07:00
0b6570eef8 Merge pull request #3115 from sergevanginderachter/groupdepth
optimization when adding child groups
2013-06-04 13:00:30 -07:00
f1cf81b086 optimization when adding child groups 2013-06-04 11:25:59 +02:00
y-p
50666eac34 Add is_local_path check to pip module, for skipping --use-mirrors 2013-06-04 03:01:42 +03:00
y-p
9ebb7450d5 Add chdir parameter to pip 2013-06-04 02:15:39 +03:00
3629867210 Merge pull request #3112 from hudecof/devel
fixed first_available_file and roles support for copy and template action
2013-06-03 15:19:14 -07:00
2ba47318dc Use first line from /etc/release in "distribution_release" for consistency across Solaris and derivatives. 2013-06-03 22:33:01 +01:00
e8ff3c43ad fixed first_available_file and roles support
for copy and template action
2013-06-03 22:47:50 +02:00
48e13f5c6d Merge pull request #3110 from rubbsdecvik/devel
Trivial typo fix in Amazon documentation
2013-06-03 11:43:06 -07:00
4e5c0da7d6 Trivial typo fix in Amazon documentation 2013-06-03 13:54:26 -04:00
e0a15d0c50 Updated to support inventory options from command line 2013-06-03 12:42:52 -04:00
f0d7324e25 Merge pull request #3094 from sfromm/issue2464-redux
Updates to ansible-pull and ansible-pull docs
2013-06-03 09:01:39 -07:00
fc0e4f738d Update changelog 2013-06-03 11:53:58 -04:00
4ae3ef8af9 Disable inventory test 2013-06-03 11:52:42 -04:00
788680a15d Merge branch 'devel' of git://github.com/trbs/ansible into more_users 2013-06-03 11:50:17 -04:00
57f4e808a0 Merge branch 'devel' of git://github.com/dirtyharrycallahan/ansible into rpm_change 2013-06-03 11:48:00 -04:00
c52abd40b0 Fix for the directory inventory source where depth information on the group was being discarded
due to initial copy.  New model will reuse the first object and copy attributes on the second.
2013-06-03 11:41:56 -04:00
be33bcf16f Merge pull request #3105 from shirou/devel
fix utf-8 named task failed with --step.
2013-06-03 07:03:17 -07:00
3783dc42d4 normalize path 2013-06-03 09:57:02 -04:00
66247042a5 fix utf-8 named task failed with --step. 2013-06-03 22:45:02 +09:00
dcde9bcdba Merge pull request #3100 from dstoflet/devel
Support for all:vars in script inventories
2013-06-03 04:37:58 -07:00
c0baf10845 Support for all:vars in script inventories 2013-06-02 14:54:29 -07:00
3b77d17a26 Spelling fix. 2013-06-02 16:03:41 -04:00
1f7c197a9d os.path.dirname returns '' not None in some cases, handle this so inventory can be specified with ./ 2013-06-02 16:01:09 -04:00
79ec5fac7a Merge pull request #3095 from sergevanginderachter/contrib
add mention of github.com/ginsys/ansible-plugins in contrib.rst
2013-06-02 11:19:49 -07:00
a37b6a2ad3 Do not set RPMDIST to '%dist' when dist is not set by the distribution. 2013-06-02 13:27:04 -04:00
18e7974021 add mention of github.com/ginsys/ansible-plugins in contrib.rst 2013-06-02 17:56:12 +02:00
355ab6983c remove errant and unneeded import of ansible.constants 2013-06-01 21:47:38 -07:00
a611027329 Update ansible-pull documentation 2013-06-01 21:44:52 -07:00
291fb9e944 Help ansible-pull work better in bootstap environment
Add option to specify inventory.  No default is defined since
ansible-playbook already does this and it allows an ansible.cfg in the
git repository to take precedence.
Overall, this should help ansible-pull work with less setup in advance,
which should be helpful in kickstart scenarios.  Much of this was
discussed in issue #2464.
2013-06-01 21:44:52 -07:00
1c4fa2c45e Doc standardization 2013-06-01 18:42:03 -04:00
e01cdf876c Docs standardization 2013-06-01 18:40:04 -04:00
fdfba6aa68 Standardize docs 2013-06-01 18:38:16 -04:00
956bff2f07 Standardize docs 2013-06-01 18:36:44 -04:00
6e679bbe49 Update changelog 2013-06-01 18:34:27 -04:00
c3ff4ccb35 These options to bypass the check code seem to need to occur before said checks. 2013-06-01 18:32:02 -04:00
4a93c247bd Another lookup plugin relative path tweak. 2013-06-01 18:22:56 -04:00
b8a66ce5bb Lookup plugins in included files now look in paths relative to their files, allowing role usage. 2013-06-01 18:15:38 -04:00
7f0e89a2f6 Explain when statements with |failure and |success. 2013-06-01 17:41:31 -04:00
c4a125e6d9 Add ability to use |success and |failed as Jinja2 filters.
Example:

when: registered_variable|failed
2013-06-01 17:38:12 -04:00
4840e59b90 Allow cowsay to be removed mid playbook run. 2013-06-01 17:06:40 -04:00
f0a4a17ff6 Add Solaris O/S facts "distribution" and "distribution_*" 2013-06-01 20:32:28 +01:00
754d5f91a3 Show how to set PW length. 2013-06-01 12:36:24 -04:00
88102df07c Show 'yes' and 'no' in choices on docs page. 2013-06-01 12:33:11 -04:00
caa07e7fab pep8 fixes 2013-06-01 12:29:03 -04:00
15560c9801 Fix module labelled incorrectly. 2013-06-01 12:25:24 -04:00
bddbdd4881 avoid duplicate hyperlink warning (silly Sphinx) 2013-06-01 12:22:06 -04:00
d434252ba4 Docs standardization 2013-06-01 12:20:45 -04:00
417be6f81e Docs standardization 2013-06-01 12:16:24 -04:00
6ae9804738 Docs standardization 2013-06-01 12:15:19 -04:00
2a416babee Docs standardization 2013-06-01 12:14:35 -04:00
6b0a547652 Docs standardization 2013-06-01 12:13:21 -04:00
16c7c50e8f Docs standardization 2013-06-01 12:12:11 -04:00
e5d911fbce Docs standardization 2013-06-01 12:11:26 -04:00
e06ced89fb Doc standardization/style 2013-06-01 12:09:04 -04:00
e38a83e1ca Docs standardization/style 2013-06-01 12:06:48 -04:00
548063a617 Docs standardization/style 2013-06-01 12:04:36 -04:00
ab4b45df3f Docs/style 2013-06-01 12:02:47 -04:00
eb84f55a09 Docs/style 2013-06-01 12:00:04 -04:00
53d0a4766c Module doc standardization/style 2013-06-01 11:57:53 -04:00
6a8e16e324 Standardize module doc 2013-06-01 11:55:05 -04:00
13e37aad95 Standardize docs 2013-06-01 11:53:57 -04:00
858efd00e3 Standarize docs 2013-06-01 11:52:28 -04:00
d0286f7611 Standardize docs 2013-06-01 11:50:23 -04:00
dd7efc70a7 Standardize docs 2013-06-01 11:49:29 -04:00
d323a0ccaa Standardize example 2013-06-01 11:49:02 -04:00
c0fd491b68 Update changelog 2013-06-01 11:47:19 -04:00
1de2028677 Update docs about examples, add edX online's configuration repo to examples 2013-06-01 11:46:32 -04:00
1ff93e6b08 Plugin with_inventory_hostnames - loops generated from groups or
hosts in inventory
2013-06-01 11:42:44 -04:00
b9e72cdd98 Warn when there is a space in the mount module opts parameter. 2013-06-01 11:33:17 -04:00
9f567f05d6 Document group_vars and host_vars additional paths. 2013-06-01 10:40:39 -04:00
6cd3ba5b06 Allow the group_vars and host_vars directories to be stored alongside the playbook as well as inventory. 2013-06-01 10:38:16 -04:00
9736ec03a9 Merge pull request #3089 from kentfrazier/unsafe-extra-vars-fix
Keep ansible-playbook from bombing without extra-vars
2013-06-01 06:06:00 -07:00
3316b87059 Keep ansible-playbook from bombing without extra-vars
A recent change to ansible-playbook to support json extra-vars
also inadvertently broke the script when no extra-vars are
provided. Simply checking to make sure it is defined and truthy
should take care of the issue.
2013-05-31 22:37:16 -05:00
3b3afe2283 Add support for Open and NetBSD platforms for user and group modules, including a new login_class parameter for FreeBSD, OpenBSD and NetBSD. 2013-05-31 20:53:37 -04:00
9122efb24a Merge pull request #3083 from mvo5/feature/facts-add-statvfs
add "size_{total,free}" to the "mount" facts
2013-05-31 14:22:58 -07:00
5edc130476 Merge pull request #3081 from qjcg/arch-optdepends
Added optional dependencies for fireball mode to PKGBUILD.
2013-05-31 14:21:27 -07:00
f9ddfc6cab Merge pull request #3080 from bigpandaio/devel
Issue #3079: Initializing key_exists in case the S3 bucket does not exis...
2013-05-31 14:21:02 -07:00
049b77be6d Merge pull request #3076 from mmoya/userspace-arch-facts
Provide userspace_{architecture,bits} facts
2013-05-31 14:20:38 -07:00
514f18acac Merge branch 'solaris-network-facts' of git://github.com/chrisgardner/ansible into devel 2013-05-31 17:16:13 -04:00
47b9db0d98 Remove debug statement in previous patch. 2013-05-31 17:13:54 -04:00
eec53347b5 Merge branch 'devel' of git://github.com/trbs/ansible into groups 2013-05-31 17:13:41 -04:00
43d96ba335 cleanup to dmi fact discovery
When invoking dmidecode, first use module.get_bin_path() and secondly
use module.run_command.
Remove sub function execute() from get_dmi_facts().
Simplify get_dmi_facts() by only using two mechanisms to determine dmi
facts:  first try /sys/devices/virtual/dmi and if not available, use
dmidecode executable.
2013-05-31 17:10:34 -04:00
2c9a6ba2e9 Merge pull request #3085 from benjixx/remove-unused-git-function
remove unused git function is_current_branch (looks like it returns alwa...
2013-05-31 14:05:53 -07:00
a0c89e742e remove unused git function is_current_branch (looks like it returns always True anyway which might be wrong) 2013-05-31 22:27:56 +02:00
80bebc1806 Merge pull request #3069 from benjixx/consistently-get-bin-path-for-git
consistently use module.get_bin_path('git', True) to get git path before...
2013-05-31 13:21:00 -07:00
d078ad5a13 Merge pull request #3068 from lorin/authkey-default
authorized_key: Set manage_dir default value
2013-05-31 13:16:44 -07:00
4afc0a5c03 Merge pull request #3044 from chrisgardner/solaris_facts
Solaris facts
2013-05-31 13:15:58 -07:00
d5182f5c92 Update changelog 2013-05-31 16:08:29 -04:00
fbba92b61e Add an example of JSON extra variables on the command line. 2013-05-31 16:07:40 -04:00
b19609b98b Slight docs tweak 2013-05-31 16:05:07 -04:00
0837c9785f Merge pull request #3040 from bfabio/devel
Support JSON in --extra-vars.
2013-05-31 13:06:05 -07:00
a58baae2c4 Make the actual user used for executing play available as 'ansible_ssh_user' variable 2013-05-31 16:03:56 -04:00
957a7bf373 Merge pull request #3020 from rtheys/virt-state
Support state parameter in list_vms command
2013-05-31 13:03:48 -07:00
3cae9d6d0d use module.get_bin_path('git', True) once and pass git_path to functions 2013-05-31 21:42:15 +02:00
69d514100c Refine error message. 2013-05-31 15:23:24 -04:00
0b30c74e86 Merge branch 'rc.d-systemd' of git://github.com/glensc/ansible into sysd 2013-05-31 15:20:48 -04:00
6acf9a9b3b use statvfs.f_bavail to match the output of "df -B1" 2013-05-31 21:20:40 +02:00
ee6ea97435 Merge pull request #3082 from pol/devel
Handle '#' in var strings by splitting on ' #'
2013-05-31 12:14:23 -07:00
73a12b04a4 add "size_{total,free}" to the "mount" facts 2013-05-31 21:01:45 +02:00
4432c01ceb Handle '#' in var strings by splitting on ' #'
If someone has a " #" in a quoted var string, it
will interpret that as a comment and refuse to
load the inventory file due to an unbalanced
quote. Noisy failure > unexpected behavior.
2013-05-31 12:34:45 -06:00
424109d8de Added optional dependencies for fireball mode to PKGBUILD. 2013-05-31 12:53:52 -04:00
fe6ca38bec Issue #3079: Initializing key_exists in case the S3 bucket does not exist 2013-05-31 16:37:37 +03:00
4a5b567f0c Merge pull request #3078 from bennojoy/devel
bug fix nova_compute
2013-05-31 05:25:24 -07:00
0b93c68d57 bug fix nova_compute 2013-05-31 17:39:00 +05:30
7628ccbfe4 Merge pull request #3075 from dahpgjgamgan/doc_yaml_fix
advanced playbooks docs yaml snippets always use ---
2013-05-31 04:39:37 -07:00
d0843a7f55 Provide userspace_{architecture,bits} facts
When running inside a chroot userspace architecture might not
match that of the actual host.

This patch provides userspace_bits as reported by python's
platform.architecture(). Also provides userspace_architecture fact
if host is an x86 machine.
2013-05-31 12:24:43 +02:00
8ebd1792eb advanced playbooks docs yaml snippets always use --- 2013-05-31 10:54:13 +02:00
1b8adab2cc Add Solaris network facts. IPv4 and IPv6 both working. 2013-05-31 00:57:23 +01:00
b537aff586 Fix for #3062 additional groups should only be added once.
Also consolidated duplicate groups code into one get_groups_set() method.
Removed unused call to user_group_membership.
Removed sorting operations on set functions cause sets are inherently unordered.
Minor style improvements to match the rest of the code.

The new function will make the order of group names passed to the system command less determistic.
Which was already the case for modify_user_usermod() but not for other methods.
It will also strip out duplicate group names automatically which was not always the case previously.
2013-05-30 19:18:18 -04:00
8c9cceacbf authorized_key: Set manage_dir default value
This commit fixes a bug where the authorized_key module causes
the ~user/.ssh directory to be owned by root instead of the user,
when the manage_dir argument is not specified.

If the manage_dir argument was not specified, the module behaved as if
manage_dir was set to false, even though it's supposed to default to
true.

This module assumed that an optional argument, with no default
specified, will not be present in the module.params dictionary.

What actually seems to happen is that the argument does appear in
the module.params dictionary with a value of None.

The upside is that this line was evaluating to None instead of
true:

    manage_dir = params.get("manage_dir", True)

I fixed the problem in this particular module by explicitly specifying
the default value for the manage_dir arugment. But if this bug
occurred because of a change in behavior in AnsibleModule, then other
modules may be broken as well.
2013-05-30 16:16:14 -04:00
b8630d2bc4 Merge pull request #3067 from pol/devel
Remove inline comments from inventory tokenizing.
2013-05-30 13:16:14 -07:00
ba78360c52 Remove inline comments from inventory tokenizing. 2013-05-30 14:12:23 -06:00
ad1a02aa55 Merge pull request #3064 from sfromm/issue2990
Verify /proc/modules is readable (issue #2990)
2013-05-30 11:12:30 -07:00
77ffef5379 Merge pull request #3065 from sfromm/issue2983
Use get_bin_path to find mkfs command (issue #2983)
2013-05-30 11:12:14 -07:00
00b3a450c7 Verify /proc/modules is readable (issue #2990) 2013-05-30 10:25:48 -07:00
3127bab6d6 Use get_bin_path to find mkfs command (issue #2983) 2013-05-30 10:25:35 -07:00
0c03a5cfc2 Merge pull request #3049 from stoned/cmd-expanduser-once
No need to expanduser() command's chdir argument twice
2013-05-30 05:48:47 -07:00
27640de0a3 Merge pull request #3058 from markmandel/devel
Updated vagrant external plugin
2013-05-30 05:47:02 -07:00
2b71ab6765 Fix typo. Solaris 9 should now correctly ignore 'brand' and use 'implementation'. 2013-05-30 08:51:03 +01:00
88115f4ab2 TODO: Separate IPv4 and IPv6 2013-05-30 08:39:11 +01:00
18f8fe1149 Update vagrant external inventory file to handle multiple boxes, and --list and --host params. 2013-05-30 14:16:58 +10:00
e75ab08e3d Merge pull request #3054 from maxamillion/maxamillion/docsite
provide link to older docs when mentioning older docs
2013-05-29 16:55:30 -07:00
0741ca3d81 Merge pull request #3055 from kubicek/freebsd
Add some FreeBSD facts
2013-05-29 16:55:00 -07:00
5cb0525430 Add some FreeBSD facts
added:
 * ansible_distribution
 * ansible_distribution_release 
 * ansible_distribution_version
 * ansible_os_family
 * ansible_pkg_mgr
 * ansible_ssh_host_key_ecdsa_public

Also adds ECDSA public key for all plaforms.
2013-05-30 01:34:33 +02:00
6809b56233 Add Solaris network facts. IPv6 details overwrite IPv4 per interface, needs further work. 2013-05-30 00:06:57 +01:00
3163109681 Update changelog 2013-05-29 19:01:01 -04:00
07361375b5 Fix version added field in modules. 2013-05-29 18:56:48 -04:00
53c490f453 Merge pull request #3050 from lorin/os-grizzly-only
Document: OpenStack inventory script needs grizzly
2013-05-29 15:54:49 -07:00
fd77804bff Merge pull request #3017 from sergevanginderachter/roles-script
Add roles support for the script module
2013-05-29 15:54:18 -07:00
44e32cc45e Some formatting fixes so docs will build, etc. 2013-05-29 18:43:23 -04:00
250bcaff03 Fix docs build causing parse error message. 2013-05-29 18:37:31 -04:00
5e8923c04f use EXAMPLES vs examples (easier to format) 2013-05-29 18:35:47 -04:00
f7cabfe64e use EXAMPLES vs inline examples (easier to format) 2013-05-29 18:35:47 -04:00
b7485ea4d6 Merge pull request #3046 from dstoflet/devel
Adding monit module to start/stop/monitor/unmonitor process via monit
2013-05-29 15:32:59 -07:00
02e772bb29 Merge pull request #3032 from thaumos/devel
Pagerduty and Pingdom modules for core
2013-05-29 15:30:51 -07:00
80bf5d49fe provide link to older docs when mentioning older docs 2013-05-29 17:29:59 -05:00
a9fcea5893 Merge branch 'escape' of git://github.com/ngrilly/ansible into repr 2013-05-29 18:29:16 -04:00
0a28358ebc Minor docs tweak. 2013-05-29 18:27:16 -04:00
c9b2df619b Merge pull request #3043 from mvo5/feature/document-facts
Feature/document facts
2013-05-29 15:23:15 -07:00
31b31a12e7 Merge pull request #3052 from chelsea/devel
Updated loop documentation with explicit example of hash usage
2013-05-29 15:21:19 -07:00
7350d61ad0 Merge pull request #3053 from maxamillion/maxamillion/docsite
fix ambiguous use of automatically automatic in Roles docs
2013-05-29 15:20:49 -07:00
33870745b1 fix ambiguous use of automatically automatic in Roles docs 2013-05-29 17:14:20 -05:00
b8045bc29e Updated loop documentation with explicit example of hash usage 2013-05-30 08:05:14 +10:00
f482649cbb Add clock speed to processor description for SPARC CPU. 2013-05-29 21:00:21 +01:00
8050110ba2 Not sure why RPM was trying to avoid certain files starting with f. Change that. 2013-05-29 14:21:25 -04:00
b5ed926720 Add AWS doc to table of contents. 2013-05-29 14:17:32 -04:00
68959e7f92 Use 'implementation' if 'brand' not available (Solaris 9). Add CPU socket/core counting. 2013-05-29 18:54:43 +01:00
bbe352b544 Document: OpenStack inventory script needs grizzly
The OpenStack Inventory script uses the OS-EXT-IPS:type parameter
to distinguish between fixed and floating IP addresses.
This was only added in the Grizzly release, see
https://bugs.launchpad.net/nova/+bug/1117784

Specify in the docs that this inventory script requires Grizzly
or greater.
2013-05-29 11:38:11 -04:00
f9cff3c444 No need to expanduser() command's chdir argument twice 2013-05-29 17:05:11 +02:00
f9a14f0d70 Fixup fetch doc formatting. 2013-05-29 10:45:31 -04:00
267b29cec7 Manpage tweaks, docs rebuild 2013-05-29 10:30:04 -04:00
efee2e2630 Some tweaks to EC2 docs 2013-05-29 10:25:54 -04:00
383b8ce14a Merge branch 'awsdocs' of git://github.com/lwade/ansible into devel 2013-05-29 10:15:02 -04:00
01a2384cdd Minor style tweak. 2013-05-29 10:14:47 -04:00
7de718cd51 Fix copy when force=no and update _remote_md5 docs.
Previously setting force=no caused copy to subversively
fail when target did not exist on remote host.

Caused by Runner._remote_md5 returning 1
when files don't exist, rather than 0.
2013-05-29 10:14:47 -04:00
3e774fedea Modified assemble module so the dest file is streamed together rather than built-in memory before writing. 2013-05-29 10:14:47 -04:00
1f8d319753 Merge pull request #3000 from mvo5/devel
document in the man-page that {ansible,ansible-playbook} -M can also be ...
2013-05-29 07:04:40 -07:00
a581077b4d Merge branch 'facter-fix' of git://github.com/flyapen/ansible into devel 2013-05-29 10:00:20 -04:00
2908687a7b This plugin is not quite ready as it needs to support --host <hostname> and --list, like the other inventory plugins, but we should get this tweaked and include it once it is standardized. Watch this space! 2013-05-29 09:58:29 -04:00
bf309e1cd0 Merge pull request #2982 from markmandel/devel
Vagrant external inventory plugin
2013-05-29 06:56:44 -07:00
2c433cb707 Add an example of Jinja2 casting. 2013-05-29 09:43:32 -04:00
575967cee4 Merge pull request #3038 from jsmartin/riak_bugfixes
Riak bugfixes
2013-05-29 06:38:31 -07:00
1c0e01a72b Implement NetBSD-specific subclass of Hardware in the setup module.
Defines memory and CPU facts:
- memfree_mb
- memtotal_mb
- swapfree_mb
- swaptotal_mb
- processor (a list)
- processor_cores
- processor_count
- devices

As a matter of fact, on NetBSD, it is possible to get memory, swap and
processor facts exactly as on Linux. Tested on NetBSD-5, NetBSD-6 and
NetBSD-6.1 (without Linux emulation).
2013-05-29 09:37:46 -04:00
ebf28ff856 Merge pull request #2867 from cstorey/rabbitmq_user-node-parameter
Allow specification of erlang node name for rabbitmq_user/vhost/parameter actions.
2013-05-29 06:35:09 -07:00
6d7bf811b1 Merge pull request #3047 from kavink/devel
Avoid crash in module_common when the file cannot be moved/copy
2013-05-29 04:33:39 -07:00
8217e0706f Avoid crash in module_common when the file cannot be moved/copy 2013-05-29 00:03:12 -07:00
0b53c711a6 Adding monit modules to start/stop/monitor/unmonitor process via monit 2013-05-28 23:22:34 -07:00
9ca7165f88 Use kstat for Solaris CPU info 2013-05-28 22:44:06 +01:00
66c10410ec Use kstat for Solaris CPU info 2013-05-28 22:36:49 +01:00
746edecf68 fix indent 2013-05-28 18:32:14 +02:00
b625f99938 fix typo 2013-05-28 18:25:44 +02:00
e13842fad1 add gathering-facts example 2013-05-28 18:23:12 +02:00
03e9d9a742 update info on debian/ubuntu packages 2013-05-28 18:12:33 +02:00
dbfad567bc Merge pull request #3041 from sergevanginderachter/performance-groups-list
performance optimization in inventory.groups_list()
2013-05-28 05:14:32 -07:00
0c0d6c0b4e performance optimization in inventory.groups_list()
don't calculate all hosts for every parent group of every group
when that parent group was already in the cache
2013-05-28 12:53:51 +02:00
6bef150695 Support JSON in --extra-vars.
If --extra-vars starts with either a '{' or a '[', it will be assumed
we are dealing with JSON and parse the data as such.
2013-05-28 09:46:50 +02:00
1aec4c0e74 Now can specify amount of time to wait_for_handoffs or ring ready instead of booleans. 2013-05-27 17:24:10 -04:00
633724dc8c Timeouts implemented for riak stats operation. Removed failback mode
for fetching riak stats.
2013-05-27 17:12:13 -04:00
da5be56b33 Pagerduty and Pingdom modules for core 2013-05-27 11:55:29 -07:00
5ec35fa388 Merge pull request #3025 from lorin/keystone-docs
Documentation for keystone_user
2013-05-27 08:06:27 -07:00
ce142be1e0 Merge pull request #3027 from sergevanginderachter/verbose_always_tag_cli
hide magic variables used bin/ansible output
2013-05-27 08:05:25 -07:00
dd9919342b hide magic variables used bin/ansible output
'verbose_override' and 'verbose_always'
2013-05-27 14:42:55 +02:00
b432ae5a74 Documentation for keystone_user
Updated the module with proper documentation.
2013-05-27 07:35:05 -04:00
c5b40ca2ff change fix to lookup path with get_bin_path 2013-05-27 07:38:17 +02:00
e97f789913 Fix tabs 2013-05-26 23:06:23 +02:00
c01992b564 Update rabbitmq_user/vhost/parameter to pass the node to rabbitmqctl using -n flag to rabbitmqctl rather than setting the environment variable. 2013-05-26 14:51:50 +01:00
a61978aed9 Support state parameter in list_vms command
Support the state parameter in the list_vms command to filter the
VM's to list based on their state.
2013-05-25 22:20:25 +02:00
5859af7285 script support for roles: use the files/ directory
instead of an additional scripts/ directory
2013-05-25 16:51:59 +02:00
d7b5b47efe improve wording, thanks to Michael DeHaan 2013-05-25 08:53:20 +02:00
3a635d2d26 Lots of formatting fixes 2013-05-24 23:46:23 -04:00
9c5d6f11f0 Fix tabs and spaces in OpenStack modules. 2013-05-24 23:34:48 -04:00
e5c2d0b247 update changelog 2013-05-24 23:19:59 -04:00
11792a9daa Merge pull request #2987 from kentfrazier/sudo_user
Fix bug with include-level vars and sudo_user.
2013-05-24 20:08:04 -07:00
b499f0754e Merge pull request #2986 from wbowling/devel
Fixes apt_repository always reporting file uri repos as changed
2013-05-24 20:07:03 -07:00
82909179a0 Merge pull request #2976 from stoned/pip-virtualenv_command-pathname
Allow virtualenv_command argument of the pip module to be a pathname
2013-05-24 20:01:12 -07:00
698b2fe9c5 Merge pull request #2992 from SirScott/service_pattern
Fixes #2991: Service module pattern argument ignored.
2013-05-24 19:58:42 -07:00
84623441e1 Merge pull request #2945 from jsmartin/new_fetch
Fetch destination path can now be overriden.
2013-05-24 19:57:19 -07:00
4fc6be8579 Merge pull request #2993 from SirScott/pkgng
Make pkgng and with_items result in a single module call.
2013-05-24 19:55:56 -07:00
e68894ea45 Merge pull request #2975 from stoned/doc-pip-fix
Fix pip module documentation (YAML quoting)
2013-05-24 19:55:14 -07:00
4b988dbd43 Merge pull request #2978 from bryanlarsen/basename
add basename and dirname to the core jinja2 filters
2013-05-24 19:54:36 -07:00
27236cf598 Merge pull request #2998 from SirScott/runner-permissions
Ensure the tmp_path is sufficiently open.
2013-05-24 19:52:23 -07:00
e3af9258ae Merge pull request #2995 from SirScott/pip-sudo-user
pip module -- sudo_user permission problem fix
2013-05-24 19:51:38 -07:00
c397969ca3 Merge pull request #3001 from SirScott/user-always-changing
Fixes #2924: User creation always reports 'changed'
2013-05-24 19:50:48 -07:00
159ba7d68a Merge pull request #2956 from akerl/unicodefix
ignore unicode errors in stdout
2013-05-24 19:46:25 -07:00
9d92125a93 Merge pull request #2989 from lorin/keystone_user
OpenStack Identity (keystone) user module
2013-05-24 19:39:52 -07:00
6ed01d2d9c Merge pull request #2985 from bennojoy/devel
OpenStack Modules
2013-05-24 19:38:19 -07:00
2459255739 Merge pull request #3016 from bpennypacker/airbrake_deployment
new airbrake_deployment module
2013-05-24 19:37:49 -07:00
98a4331107 Merge pull request #2999 from ngrilly/python
Python
2013-05-24 19:36:47 -07:00
5fdca267ac Merge pull request #3018 from dsedivec/devel
Plug-ins loaded from top-level plug-in directory
2013-05-24 18:58:00 -07:00
fd9bbeb4f3 Merge pull request #3019 from sergevanginderachter/debug-allways-verbose
Make debug module always verbose in playbooks
2013-05-24 18:55:10 -07:00
94028852d9 Make debug module always verbose in playbooks
Created a new flag 'verbose_always' handled by
on_ok callback, similar to the 'verbose_override'
flag used by the setup module.
2013-05-25 00:27:23 +02:00
611d56dc4c Plug-ins loaded from top-level plug-in directory
PluginLoader._get_paths, as of 391fb98e, was only finding plug-ins that
were in a subdirectory of one of the basedirs (i.e. in a category
directory).  For example, action_plugins/foo.py would never be loaded,
but action_plugins/bar/foo.py would work.

This makes it so that "uncategorized" plug-ins in the top level of a
directory such as action_plugins will be loaded, though plug-ins in a
"category" subdirectory will still be preferred.  For example,
action_plugins/bar/foo.py would be preferred over action_plugins/foo.py.
2013-05-24 17:05:28 -05:00
0224dc464d roles/x/scripts support: update docs
also added example on where regular tasks fit in
2013-05-24 22:42:24 +02:00
4c9ebe8522 Add roles support for the script module
allows to put scripts directly in a dir within the
role:

 roles/<role>/scripts/..

Same as the copy and template module.

As requested in and closes #2969
2013-05-24 22:10:46 +02:00
fceaca4a53 new airbrake_deployment module 2013-05-24 14:40:37 -04:00
07a1b2f1c1 Start of aws best practices docs 2013-05-24 16:59:24 +01:00
1d3782cfc7 Merge pull request #3006 from stoned/doc-fix-npm
Fix typo in npm module documentation preventing it to be processed by an...
2013-05-23 18:08:58 -07:00
5c5b2204ac Merge pull request #3007 from stoned/doc-fix-git
Fix typo in git module documentation preventing it to be processed by an...
2013-05-23 18:08:15 -07:00
c9f268ac48 Fix typo in git module documentation preventing it to be processed by ansible-doc 2013-05-24 01:33:47 +02:00
81e0a7adcc Fix typo in npm module documentation preventing it to be processed by ansible-doc 2013-05-24 01:27:46 +02:00
75ceb80572 Escape args injected in new style modules 2013-05-24 01:01:07 +02:00
922a1efbc0 Fixes #2924: User creation always reports 'changed' 2013-05-23 13:43:23 -06:00
22b0cf9275 use the same text for -M in ansible.1 and ansible-playbook.1 2013-05-23 21:34:33 +02:00
8338e75463 document in the man-page that {ansible,ansible-playbook} -M can also be overriden with the ANSIBLE_LIBRARY environment 2013-05-23 21:22:58 +02:00
5516ece859 Ensure the tmp_path is sufficiently open. 2013-05-23 12:13:09 -06:00
7aee588918 Idiomatic Python: use in operator instead of method find 2013-05-23 20:12:43 +02:00
7babd30cf7 Idiomatic Python: use isinstance instead of type 2013-05-23 20:12:43 +02:00
3c131dbd2b Initial Commit. 2013-05-23 13:33:36 -04:00
b2542bff72 Chdir to tempdir to prevent permissions problems. 2013-05-23 10:56:52 -06:00
d91bc1692e Make pkgng and with_items result in a single module call. 2013-05-23 09:43:38 -06:00
b274fb9774 Fixes #2991: Service module pattern argument ignored. 2013-05-23 09:39:26 -06:00
dbd9d92861 OpenStack Identity (keystone) user module
Module for managing users, tenants, and roles within OpenStack.
2013-05-23 10:35:27 -04:00
e2e10c1977 fix for facter being installed in a different location 2013-05-23 11:21:01 +02:00
4c6583bd00 Fix bug with include-level vars and sudo_user.
If a variable was provided for an include, in either of these ways:

    ---
    - hosts: all
      tasks:
      - include: included.yml param=www-data
      - include: included.yml
        vars:
          param: www-data

and then that param was used as the value of sudo_user in the included
tasks:

    ---
    - name: do something as a parameterized sudo_user
      command: whoami
      sudo: yes
      sudo_user: $param

you would receive a "failed to parse: usage: sudo" error back and the
command would not execute.

This seemed to be due to a missing call to template.template somewhere,
because the final value being passed through ssh was still `$param`.
After some digging, the issue seems to instead have been a problem with
providing the wrong context to the template for expansion. Inside the
`Task` logic, it was passing `play.vars` as the context, where
`module_vars` seemed more appropriate. After replacing it, my test case
above ran without issue. There was a comment above suggesting that the
template call might be unnecessary, but removing it made the original
error return, since it is not getting escaped later down the line. I
removed the comment since it was inaccurate.

I tried to actually incorporate my test case above into the test suite
as a regression test, but was unable to figure out how to structure it.
The existing test infrastructure seemed to only be testing for correct
number of counts in things (ok vs. changed, etc.), without regard for
whether the content generated by the command is correct. If there is an
example of a test similar to this one (where I would want to check the
JSON generated to make sure sudo_user had been converted), please let me
know and I will be happy to submit an additional patch.
2013-05-23 00:05:11 -05:00
222f004bfa Fixes apt_repository always reporting file uri repos as changed 2013-05-23 12:39:22 +10:00
b16e2a1d48 OpenStack Modules 2013-05-23 07:55:05 +05:30
f2f3fb1a8e Vagrant external inventory file, to dynamically determine your vagrant vm ip. 2013-05-23 09:13:26 +10:00
0ab58774bd Ignore Intellij IML files. 2013-05-23 09:11:38 +10:00
f629baef11 add basename and dirname to the core jinja2 filters 2013-05-22 14:06:18 -04:00
d4d0753e03 Allow virtualenv_command argument of the pip module to be a pathname 2013-05-22 18:15:21 +02:00
83cce7d2e0 Fix pip module documentation (YAML quoting) 2013-05-22 18:09:01 +02:00
8f3b2b281f Merge pull request #2967 from jonEbird/devel
Inventory script for Spacewalk servers based on the spacewalk-reports pa...
2013-05-22 05:34:26 -07:00
dc8feb799c Do not need to chmod cache file each time
This is particularly important if you've manually ensured you have write
access via group permissions and not by owner.
2013-05-21 14:44:00 -07:00
aecc954aa4 Merge pull request #2965 from bpennypacker/devel
newrelic_deployment bug fix to support both python 2.4 and 2.6
2013-05-21 13:59:06 -07:00
5111e0c2f7 Inventory script for Spacewalk servers based on the spacewalk-reports package 2013-05-21 12:40:26 -07:00
d4429fcb91 Fixed handling of urlopen result to work properly under both python 2.4 and python 2.6 2013-05-21 13:59:42 -04:00
753ebea186 Prefer categorized modules to uncategorized, such that if someone does an install on top of old content
the categorized modules will win over the 1.1 uncategorized modules, as the packages may not automatically
clean up the old content.
2013-05-19 20:09:44 -04:00
cd57d59913 If ansible is configured to use a log file but cannot write to it, exit, but don't traceback. 2013-05-19 20:05:04 -04:00
496f06c3c9 Pass variables to lookup function for those that want to use them. 2013-05-19 19:26:30 -04:00
16709ecd76 Replace tab with spaces. 2013-05-19 19:26:30 -04:00
e96bc981ce Set paramiko's logging level
Excplicity set paramiko's logging level to WARNING.
By default it inherits ansible's DEBUG logging level (set in
callbacks.py) and fills the log file with useless debug messages.
Obviously it only applies if log_path is set in ansible.cfg
2013-05-19 19:26:30 -04:00
1179d1bbd8 corrected indentation 2013-05-19 12:25:19 -04:00
2adc335481 ignore unicode errors in stdout 2013-05-19 11:57:08 -04:00
14aa54172c Merge pull request #2955 from jarv/devel
pip module blowing up when name is not included in arg list
2013-05-19 06:48:44 -07:00
daf4c358f7 fixes case where name is omitted from pip arg list
This code:
```
    if name.endswith('.tar.gz') or name.endswith('.tar.bz2') or
name.endswith('.zip'):
        is_tar = True
```
was not checking whether name is defined since it is an
optional param.
2013-05-18 20:59:21 -04:00
7dfb29f8f9 Merge pull request #2952 from mmoya/bug-fixes
Don't hardcode chroot path
2013-05-18 17:13:17 -07:00
e53a9e5743 Merge pull request #2954 from jarv/devel
fixing syntax error
2013-05-18 16:55:05 -07:00
423fe82d94 fixing syntax error 2013-05-18 19:49:25 -04:00
d3a2b1dbbb no need to init None to None 2013-05-19 00:20:10 +03:00
60f24bb077 Remove unused modules 2013-05-18 23:11:47 +02:00
f52e3dee70 Don't hardcode chroot executable path 2013-05-18 23:09:38 +02:00
9db256adce Merge pull request #2951 from DazWorrall/vim_swp
Add vim swap files to gitignore
2013-05-18 14:00:54 -07:00
0a28d26d6e Add vim swap files to gitignore 2013-05-18 21:51:43 +01:00
5f98c6c246 Merge pull request #2948 from jcbagneris/devel
Fixes in apt module doc: typos, examples
2013-05-18 13:33:27 -07:00
206b34783f Merge pull request #2942 from stoned/doc-requirements
Fix empty requirements specifications in modules documentation
2013-05-18 13:26:41 -07:00
328065506e Merge pull request #2941 from bcoca/setup_bin
no uses get_bin_path for 2nd use of ip tool
2013-05-18 13:22:24 -07:00
39673fe8c0 Merge pull request #2940 from madema/patch-3
-o and -r option don't exist on AIX
2013-05-18 13:21:48 -07:00
0938d4d89a Allow the remote MD5 checks to be run via sudo 2013-05-18 16:20:54 -04:00
8475a92dec Merge pull request #2939 from mmoya/lookup-crypted-passwds
Add support for crypted passwords to password lookup
2013-05-18 13:17:41 -07:00
fee3d9004f Merge pull request #2934 from j2sol/git-update
Add an update option to the git module
2013-05-18 13:14:04 -07:00
223e4e2349 Merge pull request #2932 from bcoca/apt_getbins
apt now uses module function to find bin paths
2013-05-18 13:13:04 -07:00
3ecae5f21a Merge pull request #2931 from caredotcom/flowdock_nochange
flowdock module returns changed=false on succes
2013-05-18 13:03:00 -07:00
3cb3c58548 Merge pull request #2926 from stoned/doc-fix
Fix registered variable usage example
2013-05-18 13:00:12 -07:00
d4dbb8e96b Merge pull request #2923 from benjixx/fix-package-mentioned-twice
fix package mentioned twice in setup.py
2013-05-18 12:59:47 -07:00
40d2e247ff Merge pull request #2922 from gtmanfred/devel
update archlinux PKGBUILD for pacman 4.1
2013-05-18 12:59:18 -07:00
439c2ef684 Merge pull request #2921 from lwade/ec2_fact_doc
Added a helpful example to the ec2_facts doc.
2013-05-18 12:58:33 -07:00
d6048425e3 Merge pull request #2919 from fabulops/campfire_notification_fixes
Campfire Notification Module: Typo fixes, tighter error handling, corrected check mode support
2013-05-18 12:57:57 -07:00
8926684942 Fix issue 2906 2013-05-18 15:57:10 -04:00
56e3cef60c Merge pull request #2918 from bcoca/jabber_notchanged
jabber module returns changed=false on success
2013-05-18 12:54:48 -07:00
f8a99335dd Merge pull request #2914 from jpmens/notif_unchanged
notification modules irc, mqtt now exit with changed=False
2013-05-18 12:54:22 -07:00
e389b00050 Merge pull request #2905 from kjkuan/bugfix-apt-version-comparison
Make package version comparison use globbing.
2013-05-18 12:48:28 -07:00
9a19e8a8ae Merge pull request #2875 from yeukhon/devel
Pip's name key can now accept remote package address.
2013-05-18 12:41:12 -07:00
08a486fe31 Pip can now accept vcs or tarball as name. Prevented adding mirrors when name is vcs.
**Summary**:

There was a bug in the previous commit; pip module would add --use-mirrors options to a source package when state is absent. The bug is resolved in this commit by checking ``not is_package`` in the if branch.

Furthermore, in order to support non-vcs source name like tarballs, we must not add -e option to the arg list. Given this circumstance, this commit have is_tar and is_vcs and the latter is checked to add -e option. Since mirrors do not make sense with vcs or tarball source, this commit will not add --use-mirrors (default to True) as always.
2013-05-18 05:31:29 +00:00
JcB
33ba919e5f Fixes in apt module doc: typos, examples 2013-05-17 16:12:30 +02:00
2684066aa1 Merge pull request #2944 from stoned/fix-2916
Fix for issue #2916 : for each host promote the host variables as global...
2013-05-16 14:10:31 -07:00
94ba0f740a Fix for issue #2916 : for each host promote the host variables as globally scoped variables for the sake of the groups determination 2013-05-16 18:57:05 +02:00
45f5447f9f Fix name in copyright 2013-05-16 18:49:35 +02:00
d25888f410 Fix empty requirements specifications in modules documentation
And also be liberal in what ansible-doc accepts as an empty
requirements specification.

While here fix a typo in template module documentation
wrt jinja2 overrides example.
2013-05-16 17:15:21 +02:00
8d6e18fc90 no uses get_bin_path for 2nd use of ip tool (fixes reported issue with openwrt)
module needs this added to many tool invokations, but his is a start
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-16 08:32:49 -04:00
58d59c180d -o and -r option don't exist on AIX 2013-05-16 14:30:42 +02:00
96afc3f462 Add support for crypted passwords to password lookup
Added new parameter 'encrypt' with same semantics from that of
vars_prompt. When encryption is requested a random salt will be
generated and stored along the password in the form:
'<password> salt=<salt>'.

Also store passwords with an ending '\n' for easier looking at files
with console tools. File content was being already rstripped so this
is harmless.
2013-05-16 13:24:54 +02:00
f645d27f5e Add an update option to the git module
This will allow just making sure the repo exists w/out actually making
any chnages to it. Useful if you're going to run a play repeatedly
against a host that might have active development going on in the
repository (think initial bootstrap of a developers system, and
continued playbook runs to work on other projects).
2013-05-15 22:14:17 -07:00
a8ca48888f apt now uses module function to find bin paths
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-15 22:44:12 -04:00
ccd2bafd37 notification modules should set chnged to False 2013-05-15 21:40:16 -04:00
c0f138db1f Merge pull request #2927 from bcoca/solaris_lock
changed lockfile to be opened in write mode
2013-05-15 17:18:40 -07:00
8dd72d2828 changed lockfile to be opened in write mode (solaris for one doesn't like
exclusive locks on read)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-15 16:56:20 -04:00
2b58e03571 Fix registered variable usage example 2013-05-15 22:11:07 +02:00
61e660442c fix package mentioned twice in setup.py 2013-05-15 21:02:53 +02:00
e954c41705 update archlinux PKGBUILD for pacman 4.1 2013-05-15 12:57:42 -05:00
8b62f25c5c Added a helpful example to the ec2_facts doc. 2013-05-15 16:32:35 +01:00
628254a8ed Typo fixes, tighter error handling, corrected check mode support 2013-05-15 10:37:45 -04:00
b71a09d6ab module returns changed=false on success
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-15 09:59:14 -04:00
79cff7c076 notification modules irc, mqtt now exit with changed=False
(as per discussion on ML)
2013-05-15 07:36:23 +02:00
d29d142a2d Merge pull request #2911 from sergevanginderachter/apt-repo-ppa-bug
fix an idempotence bug in apt-repository where 'ppa' is used in a plain http://ppa. ....
2013-05-14 13:13:04 -07:00
f2a8c0d612 Fix listification inside of with_items so it runs more intelligently. 2013-05-13 21:31:45 -04:00
161f3e3670 Merge pull request #2899 from sergevanginderachter/host-group-vars-no-subdirs
don't parse subdirs in host/group_vars
2013-05-13 15:59:58 -07:00
c7ebe44780 Make package version comparison use globbing.
I have something like:

  apt: pkg={{ item }} state=present
  with_items:
    - python-pysqlite2=2.6.3-*
    - python-paramiko=1.7.7.1-*

But due to the use of *'s in the version specifications, the apt ansible
module always reports changed: true. This patch fixes that.
2013-05-13 15:01:02 -04:00
ff3625b0c9 Merge pull request #2902 from timhabermaas/fix-grammatical-error
Fix grammatical error in error message
2013-05-13 05:47:46 -07:00
332a643246 Merge pull request #2903 from sergevanginderachter/first_found
bug fix in first_found search path assembly
2013-05-13 05:46:58 -07:00
7eeab168bc bug fix in first_found search path assembly 2013-05-13 13:48:56 +02:00
4d24faeeb1 Fix grammatical error in error message 2013-05-13 13:22:57 +02:00
a6b827ca07 don't parse subdirs in host/group_vars
as those are not supported in
core vars_plugins/group_vars.py
but might be used by other vars_plugins
2013-05-13 11:04:49 +02:00
39f84b7f4d Merge pull request #2896 from jpmens/mqtt1
notification/mqtt: ensure network communication and check error
2013-05-12 05:47:46 -07:00
98ddb1ca6b notification/mqtt: ensure network communication and check error 2013-05-12 11:22:34 +02:00
2a091a3505 Remove duplicate import. 2013-05-11 17:26:47 -04:00
a78edbb45c More pep8 2013-05-11 17:26:06 -04:00
50586928b2 No need for trailing semicolon. 2013-05-11 17:25:05 -04:00
ea8302e68d Indentation. 2013-05-11 17:24:40 -04:00
9f47d13306 Misc identation. 2013-05-11 17:24:12 -04:00
0a1657080b Indentation fix 2013-05-11 17:23:45 -04:00
3d3a050648 Style fix. 2013-05-11 17:23:32 -04:00
7af6a11a0c ec2 module: more indentation fixing 2013-05-11 17:23:16 -04:00
3fdf15fa8a template code fixes for 'make pep8' 2013-05-11 17:22:56 -04:00
6b4f09d7dc Style fix. 2013-05-11 17:21:49 -04:00
09fc90cca1 Add newline at end of file 2013-05-11 17:21:29 -04:00
13d98f3977 copy module fixes for 'make pep8' 2013-05-11 17:21:04 -04:00
157f487bcd ec2_vol fixes for 'make pep8' 2013-05-11 17:20:38 -04:00
ab2e9dbffd ec2 module fixes for 'make pep8' 2013-05-11 17:20:09 -04:00
8a860779fd Add some notes about 1.2 things, just to make it more obvious. 2013-05-11 16:40:09 -04:00
25d5018f75 Update version_added 2013-05-11 16:38:17 -04:00
a0fa55c7ae Update version added info. 2013-05-11 16:37:42 -04:00
d51ec37a59 Add version added field to notification modules. 2013-05-11 16:36:37 -04:00
cfef24cc98 Amend docs formatting. 2013-05-11 16:33:49 -04:00
9ca0289dee Fixup the module formatter to explain the EXAMPLES string as well. 2013-05-11 16:32:22 -04:00
0748e86f0e Fix documentation about examples in modules so folks use the new style. 2013-05-11 16:32:22 -04:00
cdda88fda7 Slight tweak of irc module example 2013-05-11 16:32:22 -04:00
d80cb4bd41 Add proper quoting in hipchat example 2013-05-11 16:32:22 -04:00
25e300de42 Fix example formatting in jabber module. 2013-05-11 16:32:22 -04:00
06d9000833 update changelog. 2013-05-11 15:49:44 -04:00
79deb41941 Add OS X say notification plugin. You know you want it! 2013-05-11 15:48:58 -04:00
b62de8f352 update changelog, move newrelic to monitoring category 2013-05-11 15:16:16 -04:00
3afa8b373e Improve check mode reporting for directories and file modes. 2013-05-11 15:05:00 -04:00
71f77d1583 Merge pull request #2895 from jpmens/docreqs
Add Requirements to rst template, ansible-doc
2013-05-11 11:41:20 -07:00
d59d420df3 Merge pull request #2894 from jpmens/nagdoc
spacing in nagios module docs
2013-05-11 11:40:38 -07:00
611705dab4 Merge pull request #2891 from glensc/make-nosetests
make path to nosetests executable configurable
2013-05-11 11:36:27 -07:00
2e2226a912 Merge pull request #2889 from caredotcom/newrelic_deployment_notification
newrelic_deployment notification module
2013-05-11 11:32:59 -07:00
de7829b8b6 Merge pull request #2888 from fabulops/campfire_notification
Campfire Notification Module
2013-05-11 11:31:00 -07:00
cfe86bea17 Merge pull request #2887 from caredotcom/flowdock_notification
flowdock notification module
2013-05-11 11:30:14 -07:00
ec184676b1 Merge pull request #2886 from fesplugas/devel
Fixed Typo
2013-05-11 11:29:20 -07:00
c317979183 Merge pull request #2883 from bleader/devel
new module to handle FreeBSD packages with pkgng
2013-05-11 11:28:58 -07:00
05a4513a03 Merge branch 'group-by-global' of git://github.com/stoned/ansible into devel
Conflicts:
	lib/ansible/runner/action_plugins/group_by.py
2013-05-11 14:28:04 -04:00
11176c0711 Merge pull request #2878 from DavidMikeSimon/devel
Dealing with invalid symlinks and symlink permissions
2013-05-11 11:25:33 -07:00
4e6aefcccb Merge pull request #2877 from mhite/devel
New net_infrastructure "bigip_pool" module to support F5 load balancers
2013-05-11 11:23:38 -07:00
e4e6616169 Merge pull request #2872 from tima/fuzzy-match-localhost-127
Adds fuzzy matching of localhost to 127.0.0.1 host entries and vice versa
2013-05-11 11:15:49 -07:00
344a30938c Merge pull request #2871 from tima/inv-host-entry-fix
Fixed bug where a host entry in the inventory represented as a dict w/o ...
2013-05-11 11:14:48 -07:00
ca82493028 Merge pull request #2869 from jpmens/mqtt
new module: notification/mqtt for publishing a topic to an MQTT broker
2013-05-11 11:13:32 -07:00
584508dda6 Merge pull request #2866 from madema/patch-2
Fixed an error in the get_cpu_facts of the AIX class
2013-05-11 11:10:17 -07:00
dab846a631 Merge pull request #2865 from madema/patch-1
Added AIX class in the service module to control AIX SRC processes.
2013-05-11 11:09:41 -07:00
bfd6f5c546 Merge pull request #2864 from jpmens/irc
new module: IRC notification
2013-05-11 11:08:38 -07:00
53db51a0a2 Merge pull request #2863 from lonerr/freebsd-group
FreeBSD group operations is now supported properly.
2013-05-11 11:08:13 -07:00
cb54922bcd Merge pull request #2862 from lonerr/freebsd-user
Fixed errors in FreeBSD user manipulations.
2013-05-11 11:07:32 -07:00
542eeeb5d6 add option to ignore $legacy variable style substitution 2013-05-11 14:06:01 -04:00
67e67bca1f Change filesystem module message. 2013-05-11 14:03:40 -04:00
ad777f6538 Fix contrib link. 2013-05-11 14:03:07 -04:00
63e510a632 Merge pull request #2853 from abulimov/module_mkfs
Module filesystem
2013-05-11 11:02:43 -07:00
38629b7104 Merge pull request #2860 from bcoca/lininfile_safe
makes lineinfile a bit safer by using atomic rename
2013-05-11 10:58:17 -07:00
eeb80c695f Add Requirements to rst template, ansible-doc
tweak position & look of Requirements in rst
tweak APT's notes as per anhj's wish
2013-05-11 16:46:59 +02:00
0482c12378 spacing in nagios module docs 2013-05-11 16:10:56 +02:00
6949a9fbe4 LinuxService: avoid enforcing systemd even if init.d script was found 2013-05-11 13:24:00 +03:00
a0678771cd make path to nosetests executable configurable
this is to make use python2 when nosetests points to python3:

make NOSETEST=nosetests-2.7 tests
2013-05-11 13:16:04 +03:00
4ead6ee4fc Merge pull request #2885 from mvo5/devel
add "no_log=True to copy:content
2013-05-10 19:31:50 -07:00
5e3ccc3012 newrelic_deployment notification module 2013-05-10 16:02:21 -04:00
cebdcaa9b7 Campfire Notification Module 2013-05-10 15:17:41 -04:00
5b6087c85a s/temlpate/template 2013-05-10 20:34:36 +02:00
22ca463b06 flowdock notification module 2013-05-10 14:32:51 -04:00
fe7843d689 add "no_log=True to copy:content 2013-05-10 20:32:33 +02:00
02e41f3e56 Update service 2013-05-10 18:16:23 +03:00
bdf6819c71 new module to handle FreeBSD packages with pkgng
New binary package management should be the default soon in FreeBSD, and
is already fully useable through self generated and non official binary
repositories.

- add support for pkgng
- support specifying the repository url as a parameter
- allow not to update cache

Signed-off-by: bleader <bleader@ratonland.org>
2013-05-10 15:03:07 +02:00
75100201a2 Allow globally scoped variables with group_by module's conditionals and key argument 2013-05-10 00:02:14 +02:00
190ce16bab Dealing with invalid symlinks and symlink permissions 2013-05-09 15:35:05 -04:00
27e3171483 Initial commit of bigip_pool module 2013-05-09 10:47:14 -07:00
5946a25c91 Pip's name key can now accept remote package address.
Summary:

Pip module would abort when name is a remote package address because
the module was expecting a version if ``=`` is part of the name value.

Furthermore, the pip module would require either name or requirement to
be a key, although the documentation table said neither was required.
The fact that one of them must be present is not documented in the
documentation leads to confusion. This commit added this fact as part
of description.

In this commit, we resolve the confusion by stating either ``name``
or ``requirement`` is needed. Next, if the user puts remote address
as the value of the ``name`` key, we will not use mirror. Lastly,
if the user uses the remote serivice address as the name of the
package and the user does not supply -e option in extra_vars
(which is the whole point of this commit), we will add -e to
 extra_vars so pip command can run with -e option.
2013-05-09 05:11:02 -04:00
bc0e8501d6 new module: notification/mqtt for publishing a topic to an MQTT broker
added username/password authentication
2013-05-09 09:38:18 +02:00
20bf5f130d Adds fuzzy matching of localhost to 127.0.0.1 host entries and vice versa. 2013-05-08 14:11:40 -04:00
b15cc3e2b4 Fixed bug where a host entry in the inventory represented as a dict w/o a hosts or vars key was treated as a group and its vars essentially ignored. 2013-05-08 13:55:50 -04:00
72b60286e1 Fix whitespace, changing tabs to spaces. 2013-05-08 15:34:57 +01:00
6a5d07ecc7 Allow specification of the node we wish to connect to. 2013-05-08 15:26:24 +01:00
cf4dbf1f40 Fixed an error in the get_cpu_facts of the AIX class
assumed proc0 as the first processor but can be different in a LPAR environment
2013-05-08 16:13:13 +03:00
f7c3b73336 Added AIX class in the service module to control AIX SRC processes. 2013-05-08 16:10:22 +03:00
8ef18c2f98 Don't set PasswordAuthentication=no here because the connection plugin will do that unless a password is actually specified with -k/--ask-pass. 2013-05-08 08:51:01 -04:00
08c9b66941 new module: IRC notification 2013-05-08 13:26:05 +02:00
dcb22d1760 FreeBSD group operations is now supported properly. 2013-05-08 13:36:55 +04:00
b2db6483ac Fixed errors in FreeBSD user manipulations. 2013-05-08 13:03:18 +04:00
3d568db0c9 changed lininfile to be safer by writing to temp file and moving into place
instead of writing directly to original
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-07 22:08:29 -04:00
e075607c9b Merge pull request #2859 from swayf/fix/authorized_key_chown_on_link
fix for authorized_key on debian squeeze
2013-05-07 18:05:32 -07:00
3531fbdb29 fix for authorized_key: skip chown and chmod if authorized_key_file is link 2013-05-08 01:47:41 +02:00
736700f350 Merge pull request #2855 from mmoya/doc-fixes
Fix link to Ansible Resources in moduledev page
2013-05-07 05:28:11 -07:00
db618f837f Fix link to Ansible Resources in moduledev page 2013-05-07 13:01:53 +02:00
f4de40fc43 renamed mkfs and moved to system/filesystem 2013-05-06 18:08:38 +04:00
34d18d1f9b Merge pull request #2849 from bcoca/jabber_rooms
fixed to send to conference rooms correctly
2013-05-06 05:53:25 -07:00
066e0fc9b5 fixed to send to conference rooms correctly
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-05 22:22:07 -04:00
aaebf2e88f Merge pull request #2848 from bcoca/jabber
new module to do notifications over jabber (xmpp)
2013-05-05 17:57:16 -07:00
a1f26d3141 new module to do notifications over jabber (xmpp)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-05 19:34:06 -04:00
f34044e8c2 Merge pull request #2843 from jsmartin/devel
Riak module docs and bugfixes.
2013-05-05 12:28:39 -07:00
cf304b43b0 Fixed docs. Fixed fallback status method. Fixed "changed" message with cluster commit. 2013-05-05 14:54:23 -04:00
92c23c85d1 Fix error in previous PR. 2013-05-05 14:30:48 -04:00
d1d3f4b4d2 Merge pull request #2842 from bcoca/cleanup
generalized cleanup and removed atomic_move return
2013-05-05 11:20:33 -07:00
601c2db116 Add a note about where the playbook examples have moved to. 2013-05-05 14:06:06 -04:00
5aad416ffe remove playbook examples from main repo. Fear not, these are now in the ansible/ansible-examples repo :) 2013-05-05 14:04:03 -04:00
293314f777 update changelog 2013-05-05 13:52:38 -04:00
5342c35f7c Update zfs example 2013-05-05 13:47:22 -04:00
b4715cdb9c update user example 2013-05-05 13:46:45 -04:00
8ac6c73803 Simplify description of upgraded_vars example 2013-05-05 13:46:20 -04:00
4d8734f30c Update selective file sources example 2013-05-05 13:45:39 -04:00
ae810d3318 update role example 2013-05-05 13:44:23 -04:00
a911afaaf2 update roletest example 2013-05-05 13:44:06 -04:00
4569713d88 Update register_logic example 2013-05-05 13:43:44 -04:00
777dbc1048 Update rabbitmq example 2013-05-05 13:41:57 -04:00
12755b8961 Update postgres and prompts examples. 2013-05-05 13:41:21 -04:00
6ae99cdc7a update netscaler example 2013-05-05 13:40:12 -04:00
8d0b8c70ce update with_items example 2013-05-05 13:39:03 -04:00
f57e57ba54 Update loop_plugins example 2013-05-05 13:38:17 -04:00
79c2a34fa0 update nested example 2013-05-05 13:37:56 -04:00
bacb6644db update group_by example 2013-05-05 13:36:56 -04:00
ca822045e2 Update get_url example 2013-05-05 13:36:28 -04:00
b5339fe32e update eucalyptus/ec2 example 2013-05-05 13:34:29 -04:00
264f527c98 update environment example 2013-05-05 13:33:05 -04:00
1f93887e02 Update delegation example. 2013-05-05 13:31:48 -04:00
3575a3374b This conditional example is no longer needed. 2013-05-05 13:31:04 -04:00
ebad0d4474 Update conditional examples. 2013-05-05 13:30:26 -04:00
3ac6c45499 generalized cleanup function, in case modules want to use
removed return code as it doesn't make sense anymore
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-05 13:26:29 -04:00
1b5dd3f15b Clean up variable examples to say "$x" is still fine for a reference. 2013-05-05 13:21:47 -04:00
1365f0d6ab Start of making docs use {{ format }} 2013-05-05 13:17:15 -04:00
63b4eea90b Remove searchindex.js from source control. 2013-05-05 12:51:27 -04:00
f87ac5ce29 Merge pull request #2841 from jimi1283/issue_2820
BUGFIX - --start-at-task= works only with --step
2013-05-05 09:47:15 -07:00
9ed177e25e Merge pull request #2840 from toshywoshy/devel
Patch so that delegate_to also uses ansible_ssh_private_key_file
2013-05-05 09:45:35 -07:00
82e2b3028f Merge pull request #2835 from b6d/postgres_privs-fix
postgresql_privs: fix wrong codec specification
2013-05-05 09:44:25 -07:00
d1a59fe62b Merge branch 'when_docs' of git://github.com/tartansandal/ansible into devel
Conflicts:
	docsite/latest/rst/playbooks2.rst
	docsite/latest/searchindex.js
2013-05-05 12:43:06 -04:00
0ed403f6ee Move mail into the notification bucket. 2013-05-05 12:42:09 -04:00
8849be6695 Merge pull request #2830 from ralph-tice/devel
amended s3 plugin to support 'dest' parameter
2013-05-05 09:41:08 -07:00
62453e1d53 Merge pull request #2829 from lorin/per-task-sudo
Document: sudo works per-task too
2013-05-05 09:40:13 -07:00
d82135a60c Merge pull request #2827 from shirou/devel
Add notification/hipchat module.
2013-05-05 09:38:16 -07:00
cfd0413bfd Merge pull request #2815 from jarv/devel
EC2 ELB management
2013-05-05 09:33:39 -07:00
4f5bcd701f Merge branch 'devel_apt-cache_valid_time' of git://github.com/gottwald/ansible into devel 2013-05-05 12:28:33 -04:00
43156f3bab Fix tab 2013-05-05 12:25:55 -04:00
365411d4ee Fix zone 2013-05-05 12:25:55 -04:00
f74316607f Fix security group id for vpc based on @samukasmk solution 2013-05-05 12:25:55 -04:00
2440861b1b BUGFIX - --start-at-task= works only with --step
From issue #2820, --start-at-task does not actually run tasks
unless --step is specified. This appears to be because skip_task
is being evaluated as True in PlayBook._run_task(). This patch
ensures skip_task is set to False in the callback.
2013-05-05 11:05:32 -05:00
62b53f4d2c changed the delegate_to to also use ansible_ssh_private_key_file from the inventory file 2013-05-05 16:54:26 +02:00
29d1b08db4 Merge pull request #2839 from LucianoCavalheiro/devel
Fix #2836. Ensure proper handling of option "system=yes" in module "grou...
2013-05-04 17:43:13 -07:00
d18d2de18e Fix #2836. Ensure proper handling of option "system=yes" in module "group". 2013-05-04 21:24:02 -03:00
68f7ea6099 Apply Gilles's patch to atomic_move based on github comment. (Email address not supplied
since wasn't from a pull request)
2013-05-04 19:31:52 -04:00
bdeb370d79 fixed case in which move fails after remote user copies file and sudo to non root does the move
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-05-03 21:58:27 -04:00
119f33ed34 postgresql_privs: fix wrong codec specification
Use psycopg2's mapping from PostgreSQL encoding names to Python codec names.
2013-05-03 21:31:20 +02:00
13a9613bc6 fix a bug in apt-repository where 'ppa' is used in a plain http://ppa. .... url 2013-05-03 20:57:55 +02:00
c3547a2308 Moar SELinux. 2013-05-03 10:39:24 -04:00
fb7bfa61a9 Fix SELinux context on atomic_move 2013-05-03 10:18:55 -04:00
4ecc7ea2e0 Merge pull request #2817 from sfromm/issue2810
Set selinux context on file after shutil.move in atomic_move()
2013-05-03 06:45:42 -07:00
e5d9dad205 Parameter and variable naming issues 2013-05-03 06:55:06 -04:00
a45b312907 changing arg name for consistency, absent/present for registration 2013-05-02 21:29:36 -04:00
7cd1bc9628 Merge pull request #2832 from rektide/fix-openvz-venet-ipv6
Fix setup module's handling of venet & unknown ipv6 interfaces
2013-05-02 17:44:50 -07:00
cabd40b0aa add docs for 'when: var is defined' idiom 2013-05-03 08:57:31 +10:00
4f21dc4cd1 Duplicate pull #2803 in ipv6, fixing setup module's handling of venet & unknown interface types. 2013-05-02 17:19:22 -04:00
918de8d6dc amended s3 plugin to support 'dest' parameter to allow uploading to custom location 2013-05-02 14:27:12 -05:00
c66b724817 Document: sudo works per-task too
Document that you can use sudo at the task level as well
2013-05-02 15:14:53 -04:00
ce67588dcf Fix module doc organization 2013-05-02 11:35:24 -04:00
627b6a0455 Have 1.2 clear in docs 2013-05-02 11:31:51 -04:00
f79be1e0bc Add notification/hipchat module.
This module can send a message via hipchat (https://www.hipchat.com/).
2013-05-02 23:23:40 +09:00
66c52b3308 Merge pull request #2826 from tgerla/devel
Fix up a couple of references to 'only_if' and change them to 'when'
2013-05-02 06:50:22 -07:00
bdf50d1fb7 Fix up a couple of references to 'only_if' and change them to 'when' 2013-05-02 09:22:08 -04:00
fc8e8231d7 Merge pull request #2823 from iat00/devel
typo
2013-05-02 05:21:09 -07:00
3d60ee899c Merge pull request #2825 from sergevanginderachter/firstfound-ossep
remove hardcoded unix dir separator in first_found
2013-05-02 05:20:55 -07:00
53a7ab74c8 use os.path.join instead of hardcoded unix separator in first_found lookup plugin 2013-05-02 13:58:23 +02:00
9699e086d7 typo 2013-05-01 23:11:19 +02:00
50e94e4a2f Set selinux context on file after shutil.move in atomic_move()
This is intended to fix #2810.  It sets the context of the tmp_dest file
after shutil.move() operation and before os.rename().  This should
retain the selinux context of the file across moves.
2013-04-30 10:15:09 -07:00
2cf30148ba Test for the existance of a file that might not be present on older RHEL. 2013-04-30 09:26:25 -04:00
e625155cd5 doc update 2013-04-30 09:03:31 -04:00
70b61f13e4 marking the state changed only when there are ELBs to work on 2013-04-30 09:00:10 -04:00
627a84387e Merge pull request #2812 from leucos/patch-2
Updates Arch PKGBUILD
2013-04-30 05:10:37 -07:00
733bf3bd9f Merge pull request #2811 from jpmens/ansibledoc
ansible-doc: skip directories (new library/ format)
2013-04-30 05:10:10 -07:00
cd852309ea Updates Arch PKGBUILD
Recurse in subdirectories to handle the new libs layout.
Updated on AUR.
2013-04-30 10:18:44 +03:00
2f76bc9e47 ansible-doc: skip directories (new library/ format) 2013-04-30 08:31:39 +02:00
e9254fbc5a Adding module to de-register/register EC2 instances
This module handles AWS EC2 ELB registration.

* De-registration requires the instance id which can be looked up using
  the ec2_facts module.
* Registration requires both the instance id and the elbs that the
  instance belongs to.

De-registration will return an ec2_elb fact that can be used for
registration in post_tasks.
2013-04-29 23:40:17 -04:00
3789ac3784 Merge pull request #2807 from tonk/devel
Fix the RPM building
2013-04-29 17:26:07 -07:00
c554339a0f Merge pull request #2809 from piffey/uri_fix
Fixed bug where if destination was unspecified, changed would not be set...
2013-04-29 17:24:05 -07:00
4ce6eca8b3 Slight tweak to set_fact variable documentation to clarify scope info. 2013-04-29 19:15:29 -04:00
99196024dd Fixed bug where if destination was unspecified, changed would not be set, resulting in an UnboundLocalError. 2013-04-29 13:59:06 -05:00
8e54817f50 Squashed commit of the following:
commit c1f92093c8fa985c35d2fbcbb9171d82842983dd
Author: Ton Kersten <github@tonkersten.com>
Date:   Mon Apr 29 19:23:42 2013 +0200

    Fixed RPM building for 1.2
2013-04-29 19:24:41 +02:00
c15d52cc07 Merge pull request #2804 from tonk/devel
Fixed the installation of library directories
2013-04-29 05:27:29 -07:00
17586bafee commit 290ecfcdc2fa6dcbee8328130c85916fdebd5152
Author: Ton Kersten <github@tonkersten.com>
Date:   Mon Apr 29 10:44:30 2013 +0200

    Fixed the installation of library directories

    When running install the `setup.py` give error

    changing mode of /usr/bin/ansible-doc to 755
    running install_data
    error: can't copy './library/utilities': doesn't exist or not a regular file
    make: *** [install] Error 1

    Debugging 'benno' came up with this patch, which works on CentOS 6.4 and
    on Ubuntu.
2013-04-29 10:50:12 +02:00
7117ca5395 Allow modules in a "./library" directory to be referenced by their shortforms "modulename:" instead of just "action: modulename" 2013-04-28 21:05:19 -04:00
e90023281d Slightly refine log output to include username in addition to pid. 2013-04-28 20:57:32 -04:00
ba8f2fca26 Merge branch 'add_pid_to_logging' of git://github.com/mcodd/ansible into devel 2013-04-28 20:52:53 -04:00
df3c4849e9 Also load Jinja2 extensions when processing template from string 2013-04-28 20:52:01 -04:00
d7933522fb Merge pull request #2803 from therealprologic/devel
Fixed setup module to accomodate venet interfaces (OpenVZ)
2013-04-28 17:48:09 -07:00
efc5a83f66 Fixed setup module to accomodate venet interfaces (OpenVZ) 2013-04-29 10:08:24 +10:00
4bea9a612f Don't use "finally" here as it's not 2.4 compliant. 2013-04-28 16:03:03 -04:00
68f711d5ae teach plugin loader to find modules in subdirectories 2013-04-28 15:22:46 -04:00
391fb98ee2 Allow modules to be categorized, and also sort them when generating the documentation. 2013-04-28 15:03:45 -04:00
f46bdb6343 update changelog 2013-04-28 10:16:21 -04:00
a81089231e Register skipped tasks so we can at least check their changed/not-changed status. 2013-04-28 10:13:58 -04:00
7d302c42e6 Upstart, how do I love thee. Let me count the ways. 0. 2013-04-28 09:29:31 -04:00
5742e5dd4b Merge pull request #2800 from tartansandal/env_bug
fix arguments to isinstance() in env lookup
2013-04-28 05:40:36 -07:00
9f90f0e856 fix arguments to isinstance() in env lookup 2013-04-28 14:58:26 +10:00
fcc2a753b7 Merge pull request #2799 from j2sol/flavor-int
Fix instance idempotence
2013-04-27 15:19:23 -07:00
12e9a9c2e1 Remove errant debugging code
This should have never made it in.
2013-04-27 15:13:59 -07:00
670f59a458 Make sure we compare flavor IDs as ints
We were comparing an int to a string and getting things wrong, so
idempotence was lost. This forces the comparison to be int.
2013-04-27 15:13:01 -07:00
9abd31b15f Merge pull request #2794 from stoned/role-library
Add module path library/ if it exists in role directory
2013-04-27 13:12:08 -07:00
91a467bca3 Spec version should be 1.2 2013-04-27 15:25:07 -04:00
3f0820faae Merge pull request #2797 from ciupicri/devel-rpm
Fixed some RPM packaging issues
2013-04-27 12:24:15 -07:00
9b3d52cb62 apt module cache_valid_time documentation fix 2013-04-27 21:23:13 +02:00
a6acd70c67 ansible.spec: update Source0 & Url
The source archive is "tar.gz", not "tar.bz2".
The new home is http://ansible.cc
2013-04-27 21:55:03 +03:00
aec26bb72d Revert "Updated ansible.spec should now work for CentOS 5 and CentOS 6"
make rpm did not work on Fedora 18
This reverts commit ea39454f98.

Conflicts:
	packaging/rpm/ansible.spec
2013-04-27 21:53:24 +03:00
d709c47a64 Merge pull request #2795 from Tinche/lineinfile-doc
[Trivial][Doc] Lineinfile documentation fix.
2013-04-27 10:23:07 -07:00
3b8f69bac8 add pid to log 2013-04-27 13:00:02 -04:00
75b51f79b4 Add module path library/ if it exists in role directory 2013-04-27 18:43:56 +02:00
75cf5c985b Allow playbook tags to be comma seperated strings as well as lists 2013-04-27 12:29:32 -04:00
adc1113ac9 Trivial lineinfile documentation fix. 2013-04-27 18:09:26 +02:00
0fd3af8c3c Document regex patterns. 2013-04-27 12:04:22 -04:00
099e7b39a9 use lookup macro rather than with to demonstrate lookup plugins 2013-04-27 11:59:33 -04:00
a61824470d Update gitignore 2013-04-27 11:55:31 -04:00
b6a8d402c5 Document variables are reserved. 2013-04-27 11:54:30 -04:00
bcac289667 Cows don't need to display brackets around strings. 2013-04-27 11:50:53 -04:00
016b04dff1 Merge branch 'roles_dir_search_order' of git://github.com/mcodd/ansible into devel 2013-04-27 11:46:29 -04:00
caf6bd6ce5 Changed atomic_replace to atomic_move, now ti DOES move atomically in the last
step
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-04-27 11:46:08 -04:00
f876d51c66 Merge pull request #2758 from lonerr/service
FreeBSD startup scripts (rc) supports optional arguments.
2013-04-27 08:38:53 -07:00
6148e1daad Merge branch 'testing_427' into devel 2013-04-27 11:35:56 -04:00
17f3cb6dde Merge branch 'yum-module' of git://github.com/Tinche/ansible into testing_427 2013-04-27 11:34:58 -04:00
b8fdcff524 Merge branch 'nocows' of git://github.com/jpmens/ansible into devel
Conflicts:
	lib/ansible/callbacks.py
	lib/ansible/constants.py
2013-04-27 11:34:39 -04:00
1a4d801cdb Merge branch 'testing_427' into devel 2013-04-27 11:28:46 -04:00
553751aee1 Merge branch 'numeric_ids_refactor' of git://github.com/insom/ansible into testing_427 2013-04-27 11:21:30 -04:00
c83bdc1a8d Add virt guest creation to virt module docs 2013-04-27 11:20:35 -04:00
2e57c40cc2 Merge pull request #2702 from DazWorrall/devel
Add define command to virt module
2013-04-27 08:15:48 -07:00
77e4909166 Implement python-dmidecode/dmidecode as alternative for kernel DMI
This implementation falls back to python-dmidecode (RHEL5.5+) if the kernel as no DMI support. Alternatively, if python-dmidecode is missing, we attempt to use the dmidecode binary (for RHEL5.4 and older) before giving up.

This fixes #376 and #1657 and also helps @lwade on RHEL5.5+.
2013-04-27 11:14:14 -04:00
b4b0d2c4a3 Fixes wrong Source URL
Signed-off-by: Ivan Lezhnjov IV <ivan.lezhnjov.iv@gmail.com>
2013-04-27 11:14:14 -04:00
ea39454f98 Updated ansible.spec should now work for CentOS 5 and CentOS 6
Signed-off-by: Ivan Lezhnjov IV <ivan.lezhnjov.iv@gmail.com>
2013-04-27 11:14:14 -04:00
52bed971cc Merge branch 'devel' of git://github.com/iliv/ansible into testing_427 2013-04-27 11:12:46 -04:00
76723f6b37 Merge pull request #2610 from peterjanes/devel
Basic RDS support for EC2 inventory
2013-04-27 08:10:57 -07:00
d45bc26ab4 Merge branch 'setup-dmidecode' of git://github.com/dagwieers/ansible into testing_427 2013-04-27 11:09:32 -04:00
cc7122e982 Update changelog 2013-04-27 10:45:51 -04:00
d1ac527fb1 Add note about new logging feature in example plugin. 2013-04-27 10:36:37 -04:00
7a135b2569 Add info about log file in changelog. 2013-04-27 10:25:24 -04:00
aa55268514 Adds a logfile for ansible playbooks that can be set by the environment or configuration file. 2013-04-27 10:24:26 -04:00
515fbd5a17 Restructure output to prevent rare cases of interlaced I/O in multiprocessing paths. 2013-04-27 09:46:48 -04:00
6351b74612 Merge pull request #2791 from mcodd/devel
doc typo fix in copy module
2013-04-26 17:07:08 -07:00
f5be8918c9 doc typo fix in copy module 2013-04-26 19:47:33 -04:00
a10ed7793a Merge pull request #2790 from jsmartin/devel
Added a ring_wait option (waits for ring_ready to return true)
2013-04-26 15:26:44 -07:00
40b51684d7 Added a ring_wait option (waits for ring_ready to return true)
Now using module.run()
Fixed raw_stats() function.
2013-04-26 17:16:47 -04:00
eb6aac2303 Merge pull request #2786 from dirkcuys/patch-1
Fix bug causing mysqldump to fail
2013-04-26 12:36:02 -07:00
47d3f238c0 Merge pull request #2788 from aquach/devel
Escape MySQL db names.
2013-04-26 12:35:39 -07:00
92d98d24a6 Escape MySQL db names. 2013-04-26 11:48:38 -07:00
122122234d Fix bug causing mysqldump to fail 2013-04-26 17:07:29 +03:00
c9277ef4c5 Merge pull request #2780 from lwade/cloudformationdoc
Fixed cloudformation docs and updated EXAMPLES section in the docs for t...
2013-04-26 05:29:01 -07:00
3cb56d58c4 Merge pull request #2785 from lrupp/devel
added informations for openSUSE and SUSE Linux Enterprise
2013-04-26 05:28:06 -07:00
e4a955666f Merge pull request #2782 from mcodd/devel
typo fix
2013-04-26 05:27:12 -07:00
21d9789377 added informations for openSUSE and SUSE Linux Enterprise 2013-04-26 11:08:13 +02:00
c164609dd6 typo fix 2013-04-25 23:04:17 -04:00
c83c534a7d Search for roles in the roles subdir first. Throw an error when no role .yml files are found. 2013-04-25 22:40:04 -04:00
a7595a6964 Fixed cloudformation docs and updated EXAMPLES section in the docs for these AWS modules. 2013-04-25 19:22:48 -07:00
4a4958f6c9 Improve check mode support in the file module. 2013-04-25 21:33:47 -04:00
5af271911b Fix duplicate handler notification issue in 1.2 devel 2013-04-25 21:24:15 -04:00
224e20ca60 complex_arg templating should be smarter. Make it so! 2013-04-25 21:11:17 -04:00
ee4a0fc6a0 Merge pull request #2775 from jhoekx/remove-debug-in-template
Remove leftover debug statement in template code.
2013-04-25 17:41:46 -07:00
143b82c18c Clarify script module documentation a minor amount. 2013-04-25 08:45:23 -04:00
bd226eb826 Refactor user_and_group so it works off of numbers
There are various cases where a UID to username to UID mapping breaks
down. One UID can be used by two usernames, or no username. If we
always use UIDs internally, then these ambiguous cases won't be a
problem.
2013-04-25 13:23:07 +01:00
d2e457f81f Accept numeric user and group parameters 2013-04-25 13:23:07 +01:00
2dc59822f7 mkfs module to create filesystems with mkfs command 2013-04-25 13:42:07 +04:00
ac7a632711 Remove leftover debug statement in template code. 2013-04-25 08:47:38 +02:00
1f96925159 Update role example to show tag usage 2013-04-24 22:31:21 -04:00
21fe750cef Flush handlers before pre and post task sections change, but not between task and roles, as this seems
to be confusing to people (and not usually neccessary)
2013-04-24 22:28:06 -04:00
6fdfbb1a34 Improve variable smushing so it only has to be done in one place. This is related to shlex.split being called
on untemplated variables in some rare cases.
2013-04-24 22:00:40 -04:00
af2fb56a10 Changes to allow WANT_JSON to allow JSON to non-Python modules 2013-04-24 22:00:40 -04:00
4e2f8fe0bb Merge pull request #2774 from sfromm/issue2773
Catch exception when logging to systemd journal fails
2013-04-24 18:52:44 -07:00
4135cffc3f Implement python-dmidecode/dmidecode as alternative for kernel DMI
This implementation falls back to python-dmidecode (RHEL5.5+) if the kernel as no DMI support. Alternatively, if python-dmidecode is missing, we attempt to use the dmidecode binary (for RHEL5.4 and older) before giving up.

This fixes #376 and #1657 and also helps @lwade on RHEL5.5+.
2013-04-25 00:31:11 +02:00
189b210f5a Catch exception when logging to systemd journal fails
systemd journal will throw IOError exception when journal.sendv() fails.
This catches that and falls back to syslog.  See issue #2773.
2013-04-24 15:00:47 -07:00
ad004d520f Updated cache_valid_time option to check the update timestamp if update-notifier-common is installed.
mtime of the apt lists is used as fallback.
2013-04-24 22:21:38 +02:00
fd2840c0e4 Merge pull request #2772 from lwade/ec2_volattr
Corrected instance password data check.  Previously broken after adding ...
2013-04-24 11:48:51 -07:00
6a7a8cda40 Corrected instance password data check. Previously broken after adding region support. 2013-04-24 09:45:01 -07:00
a63af4fada Merge pull request #2771 from sergevanginderachter/apt-noninteractive-install
enforce no enteractiveness installing pkg with apt
2013-04-24 04:38:01 -07:00
800ca63de6 enforce no enteractiveness installing pkg with apt
use the same env vars and dpkg options as for the upgrade function
also link check mode to --simulate option when installing a pkg

fixes #2763
2013-04-24 12:02:05 +02:00
b2c0f642d8 Remove stray file 2013-04-23 16:36:04 -04:00
c4df662a7c Updated apt module documentation string with a cache_valid_time explanation 2013-04-23 21:55:04 +02:00
375e9d9721 Added cache_valid_time option to apt module 2013-04-23 21:54:35 +02:00
521375a7fe Merge branch 'fix-a10d74f7' of git://github.com/sfromm/ansible into devel
Conflicts:
	library/setup
2013-04-23 13:52:31 -04:00
30b648e48c FreeBSD startup scripts (rc) supports optional arguments. 2013-04-23 21:40:50 +04:00
471fa6859e Fix how interfaces is updated with interface fact
Was broken when handling a bridge or bonded (possibly others) interface
2013-04-23 09:13:46 -07:00
66bcba7f19 disable_gpg_check in the yum module. 2013-04-23 18:12:37 +02:00
c601e53fce Correct a variable reference in prior code merge. 2013-04-23 12:02:04 -04:00
dfd885a012 Make ANSIBLE_NOCOWS configurable
nocows = 1 in ansible.cfg
	or old environment variable ANSIBLE_NOCOWS=1
add to ansible.cfg example
2013-04-23 16:43:23 +02:00
f36e85efbb Fixup apt module refactoring from previous patch. 2013-04-23 09:38:32 -04:00
bd0c22868e With fileglob should return full paths as in 1.1 2013-04-23 00:54:39 -04:00
5cc3dd353d Update changelog 2013-04-23 00:43:55 -04:00
574061fe47 People using vagrant are driving things top-down through the new provisioner, so the idea of using ansible to fire against
vagrant which then calls ansible seems weird to me.  This module can still be maintained outside of core.
2013-04-23 00:29:02 -04:00
13e90c396c Merge pull request #2733 from chadoh/patch-1
Documentation: Mention vars_files before the Roles section in playbooks1 chapter
2013-04-22 21:21:30 -07:00
35e61d8f16 Merge pull request #2688 from dagwieers/module-global
New module 'set_fact' to define host facts
2013-04-22 21:16:46 -07:00
2fb4307227 Merge pull request #2642 from sergevanginderachter/check4aptitude
apt module: part rewrite of the upgrade logic
2013-04-22 21:07:37 -07:00
c2c50c8fdc Merge pull request #2630 from sergevanginderachter/uri-redirect
URI module -- make it support HTTP 301, 302, 303, 304, 307
2013-04-22 21:01:45 -07:00
40c7afbb64 Merge branch 'yum_with_url' of git://github.com/dparalen/ansible into merginate3 2013-04-22 23:58:51 -04:00
e1ee257619 Default sudo password to SSH password.
While here factor out password prompting in ansible.utils
2013-04-22 23:57:50 -04:00
be947e5266 Resolve merge conflict 2013-04-22 23:57:20 -04:00
528cb2cb3d Merge pull request #2586 from bcoca/new_validate
Added 'validate' feature to copy and template modules,
2013-04-22 20:53:32 -07:00
40fd474d60 Add some whitespace 2013-04-22 23:46:58 -04:00
aa897571b4 Merge branch 'setup-linux-network-advanced' of git://github.com/dagwieers/ansible into devel 2013-04-22 23:44:37 -04:00
9871707998 If sudoing and the sudo user is not root, the original file is saved as you, therefore delete that file as you. 2013-04-22 23:43:13 -04:00
89ab3a0b9f Make --list-tasks work nicer with --tags 2013-04-22 23:24:54 -04:00
e12f91799c Allow args: var to be used to pass a variable in bare, and also templated versions should also DWIM. 2013-04-22 22:17:55 -04:00
6c778acd91 Smush the braces in various places (hey, that rhymes) to avoid undo key=value splitting surprises
in new template system.
2013-04-22 22:05:06 -04:00
4350585a1f Merge pull request #2747 from lwade/ec2_vol_region
Add region support to ec2 volume module.
2013-04-22 19:04:31 -07:00
5cced79cf3 Allow variables to be used raw in with_nested 2013-04-22 21:35:09 -04:00
fbea88b9d9 Allow the environment string to be referenced by a bare variable name like:
environment: foo
2013-04-22 21:29:15 -04:00
e90f313c51 Add region support to ec2 volume module. 2013-04-22 17:27:57 -07:00
f16751de29 Merge pull request #2746 from lwade/ec2region
Add region parameter and changed connection code.
2013-04-22 16:30:25 -07:00
8c8014363e Add region parameter and changed connection code. 2013-04-22 16:23:30 -07:00
f9f1d5ee42 Merge pull request #2745 from sfromm/issue2742
Fix test so that it is /bin/sh compliant (issue #2742)
2013-04-22 16:23:26 -07:00
ab3cb4912e Fix test so that it is /bin/sh compliant (issue #2742)
The old test used syntax that appeared to be bash-specific and did not
work on platforms where /bin/sh did not point to bash.  See issue #2742
where copy to solaris hosts failed with the error:

    output: {'stdout': '', 'stderr': '/bin/sh: test: argument expected\n',
             'rc': 1}
2013-04-22 16:14:27 -07:00
3e0c33c1fa Empty plays should still gather facts 2013-04-21 17:35:09 -04:00
b08181e9b4 Merge pull request #2731 from stoned/flush_handlers-cleanup
handlers must be run once
2013-04-21 14:14:04 -07:00
b1d40ed064 Merge pull request #2734 from chadoh/patch-2
Documentation: Links are the best kinds of instructions
2013-04-21 14:13:06 -07:00
08324cb5d7 Allow play tagging in context of new meta-tasks. 2013-04-21 17:12:12 -04:00
ef23c42a3d Merge pull request #2737 from jkleckner/more-spelling
Nit fix spelling of separate
2013-04-21 14:08:59 -07:00
5e5235a433 Nit fix spelling of separate 2013-04-21 12:33:51 -07:00
e1396f853b Links are the best kinds of instructions
Link people right to this page on Github, so they can click "edit" right there. No need for them to search for the repo, figure out that the docsite isn't a separate repo, and navigate to the given dir.
2013-04-21 13:58:06 -03:00
0bb145af40 Mention vars_files before the Roles section
The Roles section assumes some familiarity with vars_files, which this note attempts to briefly provide.
2013-04-21 13:45:45 -03:00
97f9b6df1c Merge pull request #2730 from tomkins/devel
sysctl check fails if a custom sysctl_file is given.
2013-04-21 09:23:10 -07:00
747c7f0dff handlers must be run once
so remove all occurences of each host from the handlers notified by
lists
2013-04-21 17:23:13 +02:00
b1d5b97bbe sysctl check fails if a custom sysctl_file is given. 2013-04-21 15:28:56 +01:00
7fabaec55f Fix doc formatting error 2013-04-20 22:48:20 -04:00
c9a128a5c5 Rewrote the precedence docs. 2013-04-20 22:44:40 -04:00
f90f571f4d Update the release date & code names in the releases file. 2013-04-20 18:21:25 -04:00
856c721bf7 Update changelog 2013-04-20 18:21:03 -04:00
cf3c77661b Document the new handler flushing system. 2013-04-20 18:10:01 -04:00
32fb6c807c Allow handlers to run in between pre_tasks, roles, tasks, and post_tasks. 2013-04-20 18:03:03 -04:00
84781bf185 Add documentation about pre_tasks and post_tasks with roles. 2013-04-20 16:21:52 -04:00
37789a852a Rename set_up and tear_down to pre_tasks and post_tasks 2013-04-20 16:19:01 -04:00
d7623d1f91 Added a 'set_up' and 'tear_down' which are like tasks, but execute before and after roles. 2013-04-20 16:07:06 -04:00
e6bf01a6b0 Make plugin loader path operations more efficient. 2013-04-20 12:31:14 -04:00
5a8dff5bce Instantiate inventory plugins only once for efficiency reasons. 2013-04-20 09:59:40 -04:00
817b0cdc80 Instantiate filter plugins only once to save some efficiency. 2013-04-20 09:51:20 -04:00
bac3449db7 Restructure hacking readme. 2013-04-20 09:36:09 -04:00
e2d9e1b5c2 Convert 'hacking' instructions to markdown, add more info. 2013-04-20 09:34:38 -04:00
cfe8af493f Since using platform.node, be sure to just return the hostname component. 2013-04-20 09:34:37 -04:00
6e1514e975 Merge pull request #2727 from dsedivec/devel
Don't send unicode instances to the selinux module
2013-04-20 06:21:27 -07:00
5b44c3d52c Merge commit '53ac0bb' into devel 2013-04-20 09:13:10 -04:00
87788b1d17 Ignore inventory config files when using an inventory directory. 2013-04-20 09:10:19 -04:00
58d72b28c5 Fixup authorized key documentation formatting 2013-04-20 09:10:19 -04:00
adac8f5312 Showcase the new-style lookup plugin access in the authorized_key docs rather than the old-style $FILE 2013-04-20 09:10:19 -04:00
53ac0bbec2 Instantiate callback plugins only once so we can set play/task objects on them and they'll stick. 2013-04-20 09:09:35 -04:00
c8f4a56cad Don't send unicode instances to the selinux module
This fixes #2632.  Briefly: specifying things like paths using complex
args in a playbook will make the objects unicode instances.  The selinux
module does not accept unicode instances for its char * arguments; it
wants str instances.

Per mpdehaan's comment on #2632 I just went ahead and converted all
paths to UTF-8.  I don't know if it would be better to do something like
converting to locale.getpreferredencoding(), but I factored all the
conversions out into new method _to_filesystem_str, so there's only one
place that needs to be changed in the future.
2013-04-19 20:12:11 -05:00
df93d7dd97 Ignore inventory config files when using an inventory directory. 2013-04-19 19:01:19 -04:00
66afe13346 Merge pull request #2725 from jtsoi/patch-1
Typo in example, extra space breaks playbook.
2013-04-19 14:54:16 -07:00
8c11624f14 Typo in example, extra space breaks playbook. 2013-04-19 22:43:50 +03:00
8e7dc3c79c Remove an extra space in the module execution line if no environment was set. 2013-04-19 08:11:56 -04:00
5656817776 Fixup authorized key documentation formatting 2013-04-18 22:43:14 -04:00
cd0602889d Showcase the new-style lookup plugin access in the authorized_key docs rather than the old-style $FILE 2013-04-18 22:38:48 -04:00
0f86b26823 Merge pull request #2720 from base10/devel
Small spelling correction to authorized_key module docs
2013-04-18 19:34:10 -07:00
e8f46822e5 Small spelling correction to authorized_key module docs 2013-04-18 22:16:28 -04:00
b13beb3689 New module 'set_fact' to define host facts
This module allows you to set host facts (or export play variables to the playbook scope if you fancy that).

The module also accepts complex arguments.

```yaml
 - action: set_fact fact="something" global_fact="${local_var}"'
 - action: set_fact
   args:
      fact: something
      global_fact: ${local_var}
```
2013-04-18 23:06:58 +02:00
c35ef43517 Merge pull request #2716 from skvidal/first_found_skip_fix
clean up first_found to fix a few issues:
2013-04-18 13:51:48 -07:00
7b8cec3f59 clean up first_found to fix a few issues:
- add a skip option so it won't raise an exception if you don't match anything
 - make it work as a drop-in replacement for first_available_file
 - document in the module comments all of the above cases
2013-04-18 16:47:10 -04:00
5f1e2afc34 Revert "make atomic_replace use shutil.copy2 instead of os.rename() so it will work across filesystems".
AR function was leaving some tmp files behind, want to revert, will have better implementation soon, this is the old way now.

This reverts commit f74a1fa4f0.
2013-04-18 15:46:42 -04:00
3238d0947d Merge pull request #2712 from lwade/devel
correct reference to module
2013-04-18 05:29:13 -07:00
a154a5ddd4 correct reference to module 2013-04-18 10:36:07 +01:00
d8bf87b008 (A) include errors in inventory scripts should they occur.
(B) allow registration with ignore_errors: True
2013-04-17 22:27:00 -04:00
6544af9616 Merge pull request #2705 from b6d/utils-fix
Fix if-statement that always evaluates True
2013-04-17 11:13:58 -07:00
fb0a99e5d8 Fix if-statement that always evaluates True 2013-04-17 19:40:06 +02:00
a02202eff7 Merge pull request #2701 from chamill/devel
Fix 'sequence' plugin error.
2013-04-17 08:48:15 -07:00
08ee8f3c28 Add define command to virt module 2013-04-17 16:46:09 +01:00
88eb5516eb Fix 'sequence' plugin error.
If 'terms' is a string, replace it with a single item list.
2013-04-17 11:45:28 -04:00
40b78f96de Merge pull request #2700 from chamill/devel
Fix errors in lookup plugins.
2013-04-17 08:41:14 -07:00
663d37b537 Fix errors in lookup plugins.
Lookup plugins 'sequence' and 'template' now import 'ansible.utils'
appropriately in order to use the 'listify_lookup_plugin_terms'
function.

Also, 'dnstxt' and 'env' now check to see if 'terms' is a string;
without this calls like '{{ lookup('env', 'HOME') }}' fail.
2013-04-17 11:31:38 -04:00
cce2cad8dc Fix with_sequence doc error 2013-04-16 20:42:06 -04:00
500b9432a2 Merge pull request #2596 from blair/ec2_facts-provides-ec2-region
ec2_facts: add ansible_ec2_placement_region key/value pair for EC2 regio...
2013-04-16 17:28:13 -07:00
515fd9e915 copy action plug-in check mode respects force=no
The copy action accepts force=no, which tells it not to replace an
existing file even if it differs from the source.  The copy action
plug-in wasn't respecting this option when operated in check mode, so it
would report that changes are necessary in check mode even though copy
would make no changes when run normally.

Runner._remote_md5 was changed to make the logic for setting rc perhaps
a little more clear, and to make sure that rc=0 when the file does not
exist.
2013-04-16 20:22:51 -04:00
6cb6223deb Merge pull request #2608 from lwade/ec2zone
Add availability zone parameter
2013-04-16 17:20:55 -07:00
22e3c389b3 Use platform.node() for the hostname, leave fqdn calculated the same way 2013-04-16 20:10:21 -04:00
6a00513731 Add version added to module docs 2013-04-16 20:07:18 -04:00
7c6341718e Merge branch 'combine_vars' of git://github.com/laggyluke/ansible into exp
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	lib/ansible/runner/__init__.py
	lib/ansible/utils/__init__.py
	test/TestPlayBook.py
2013-04-16 20:06:06 -04:00
863cb50530 Allow '.yml'/'.yaml' extension on group_vars files.
Look for a file with the base name of the group/host, first without
a file extension, then with a '.yml' extension, and, finally, with
a '.yaml' extension, loading vars from only the first one found.
2013-04-16 19:59:23 -04:00
454076590c Merge pull request #2580 from blair/ec2_vol-improvements
Ec2 vol improvements
2013-04-16 16:58:54 -07:00
6d66b0e965 Merge pull request #2692 from j2sol/rax
Minor fixes to the rax module
2013-04-16 16:52:43 -07:00
b54e955595 Remove a debug statement. 2013-04-16 19:09:12 -04:00
86d47bce5f Make more lookup plugins tolerant of new variable system, with a little better 'do what I mean' logic to resolving
what happens if you get a string back as a template result.
2013-04-16 19:07:19 -04:00
c0f8af5202 Make more lookup plugins happy with newstyle variables. Not quite done, but this fixes up with_items/with_nested/file/fileglob. 2013-04-16 18:50:30 -04:00
f72649d0f9 Merge pull request #2698 from skvidal/atomic_replace_and_cron
Atomic replace and cron
2013-04-16 12:53:41 -07:00
f74a1fa4f0 make atomic_replace use shutil.copy2 instead of os.rename() so it will
work across filesystems
2013-04-16 15:15:58 -04:00
5df2dadcdb clean up how it puts the files in place - in f18 /tmp is tmpfs which
means ln and os.rename() won't work across fs.
2013-04-16 15:08:27 -04:00
59d0fb6c95 Only accept supported services for rax module
Even though others are possible, fail early on unsupported ones.
2013-04-15 17:22:42 -07:00
55ef1d6e47 Update documentation for rax module
Only list the services supported
Don't put in unncessary required: false
Use better formatting for the example
2013-04-15 17:20:45 -07:00
84fb92dac6 Working on the FAQ. 2013-04-14 19:32:06 -04:00
d00f7cea14 Merge pull request #2676 from b6d/postgresql_privs-module-proposal2
Proposal for a module to manage PostgreSQL privileges (2)
2013-04-13 18:51:03 -07:00
375dd0e16b Merge pull request #2673 from b6d/user-module-extension
user module: return public SSH key
2013-04-13 15:07:32 -07:00
210d711553 Add module postgresql_privs
This Module allows to manage privileges on PostgreSQL database objects
(currently: tables, sequences, functions, databases, schemas, languages and
tablespaces) as well as group role memberships.

It is basically a wrapper around most of the functionality of PostgreSQL's
GRANT and REVOKE statements with additional detection of changes and support
for dry-runs (check-mode).

postgresql_privs should work with PostgreSQL 8.4 and above. Python Module
psycopg2 is required on the remote host.
2013-04-13 22:56:18 +02:00
c2a7314a5f user module: return public SSH key
Return public SSH key if the user module is called with generate_ssh_key=yes.
Since "user" doesn't overwrite files, this also allows querying of existing
public keys.

Used in playbooks together with the "register" keyword, the returned key can be
passed to the "authorized_key" module allowing easy setup of SSH public key
authentication between remote hosts.
2013-04-13 16:10:58 +02:00
96d014581a Merge pull request #2605 from b6d/postgresql_user-quote-pwd
Use psycopg2's string handling to escape password string
2013-04-12 20:44:32 -07:00
2da036046b Merge pull request #2670 from jsmartin/devel
Errors in Riak documentation.
2013-04-12 20:23:20 -07:00
7609c5e0d0 Errors in documentation. 2013-04-12 22:26:18 -04:00
0944e7d56a Make less template calls on playbook objects. 2013-04-12 21:48:01 -04:00
728d81bf12 Add link to prior docs version. 2013-04-12 21:48:00 -04:00
be917e3e54 Merge pull request #2667 from jsmartin/devel
Added catch-all exception for riak stats collection.
2013-04-12 18:25:19 -07:00
62fe4cc3af Explain conditionals as applied to roles. I could also explain with_items but the scope questions are complex
here, and it is better to include such loops inside the imported tasks.
2013-04-12 20:46:12 -04:00
44a9352338 Also template handlers only at the end. 2013-04-12 20:32:35 -04:00
93d0ccd1e1 Added catch-all exception for stats collection. 2013-04-12 20:28:39 -04:00
e7f5186dec Merge pull request #2623 from willthames/when_set_bug
Prevent premature variable substitution in tasks
2013-04-12 17:19:25 -07:00
3ab0ed5fd4 Allow 'when' and 'with_items' to be applied to roles. 2013-04-12 19:02:56 -04:00
7a2d493e67 Teach lookup plugins that if they can't evaluate something they can wait and do it later. 2013-04-12 18:44:40 -04:00
3f3b2a9448 Smush Jinja2 braces in playbooks so unresolved variables get parsed nicely 2013-04-12 18:38:48 -04:00
687a68091f Mention roles in best practices 2013-04-12 18:26:17 -04:00
ffb00d2071 Favor {{ foo }} rather than $foo in documentation. 2013-04-12 18:21:09 -04:00
9ed246e432 Resolve merge conflict. 2013-04-12 17:51:55 -04:00
26819d707d Reorganize docs structure to support snapshots. 2013-04-12 17:50:50 -04:00
e63dac15eb Moving some more files into snapshot directory 2013-04-12 17:47:04 -04:00
148d8859ba Docs on parameterized roles, make document generation output less noisy 2013-04-12 17:45:27 -04:00
b25e537e7d Fixes wrong Source URL
Signed-off-by: Ivan Lezhnjov IV <ivan.lezhnjov.iv@gmail.com>
2013-04-12 13:26:33 -07:00
a379e7ed72 Updated ansible.spec should now work for CentOS 5 and CentOS 6
Signed-off-by: Ivan Lezhnjov IV <ivan.lezhnjov.iv@gmail.com>
2013-04-12 13:14:03 -07:00
7037023aa8 Make debug print things nicer if {{ foo }} didn't interpolate 2013-04-12 15:02:54 -04:00
06b988e2d5 Create the .ssh dir if it does not already exist. 2013-04-12 14:46:41 -04:00
793a3d3f76 More 1.2 templating development; for legacy when_string constructs don't quote the 'in' operator 2013-04-12 13:29:49 -04:00
5d0f78d571 ec2_facts: add ansible_ec2_placement_region key/value pair for EC2 region. 2013-04-12 09:04:12 -07:00
85099be48f Merge pull request #2656 from dstoflet/first_available_file_fix
Quick fix for first_available_file and role support
2013-04-12 08:56:26 -07:00
b8c5a58b7f Avoid running through the legacy template code if no dollar signs are in strings. 2013-04-12 10:33:55 -04:00
251f19263c Remove unneeded import. 2013-04-12 10:23:53 -04:00
8457cf433d Update pause module to not use utils.template 2013-04-12 10:00:20 -04:00
c63207bf75 Quick fix for first_available_file and roles 2013-04-11 20:40:23 -07:00
377bc31311 Prevent premature substitution of variables into tasks
As documented in #2623, early variable substitution causes when_
tests to fail and possibly other side effects.

I can see the reason for this early substitution, likely introduced
in 1dfe60a6, to allow many playbook parameters to be templated.
This is a valid goal, but the recursive nature of the utils.template
function means that it goes too far.

At this point removing tasks from the list of parameters to be
substituted seems sufficient to make my tests pass. It may be the
case that other parameters should be excluded, but I suspect not.

Adding a test case. I would prefer to analyse not just the aggregate
statistics but also whether the results are as expected - I can't
see an easy way to do that with the available callbacks at present.
2013-04-12 09:17:03 +10:00
684cfecda9 package and upgrade are not mutually exclusive, but when both were set, upgrade didn't happen 2013-04-11 23:58:15 +02:00
d3dee7a8a2 add default=yes in upgrade argument spec 2013-04-11 23:43:35 +02:00
a05361f515 This is a fix on top of the 'airplane variable upgrade' commits that fixes legacy when_string so it evaluates correctly in the new eval construct. 2013-04-11 17:20:40 -04:00
4a729ebf3a apt module: part rewrite of the upgrade logic, consistently checking
the executable paths, adding 'safe' as an alias to yes, and adding
'full' to allow aptitude full-upgrade as an alternative to apt-get
dist-upgrade
2013-04-11 23:03:47 +02:00
3e58768344 Merge pull request #2646 from sevein/git-shallow-clone
Add support for shallow clones in the git module
2013-04-11 13:09:42 -07:00
92ddab8a69 Merge pull request #2649 from sergevanginderachter/bin-ansible
make bin/ansible error output consistent for shell module as for the command module when no arguments are given
2013-04-11 12:33:12 -07:00
3e736eaf00 Merge pull request #2622 from skvidal/playbook-start-at-task
implement --start-at-task option to hop to a specific task before starti...
2013-04-11 11:17:24 -07:00
34bacc468c Merge pull request #2627 from jsmartin/riak
Adds a riak module
2013-04-11 11:14:32 -07:00
94243e983f make bin/ansible error output consistent for shell module as for the command module when no arguments 2013-04-11 19:43:31 +02:00
4e79bd0872 Remove unneccessary construction of Jinja2 environment object. 2013-04-11 12:59:33 -04:00
b869551a4c Merge pull request #2628 from victorcoder/devel
Typo in docs
2013-04-11 09:57:38 -07:00
2f5c1d3788 Merge pull request #2629 from stoned/fix-jinja2-filters-init
Fix Jinja2 filter plugins initialization
2013-04-11 09:57:04 -07:00
11a819cc4b Merge pull request #2631 from stoned/templates-filters-base64
Add base64 encode and decode filters to templates
2013-04-11 09:49:27 -07:00
a6777f7e7c Fix template call in group_by module. 2013-04-11 12:43:02 -04:00
62d7e6b006 Add --depth support in the git module 2013-04-11 09:40:15 -07:00
a0a2ef3d9d Merge pull request #2640 from trevor/devel
make json valid
2013-04-11 09:35:46 -07:00
7931597a6a Fix template call. 2013-04-11 12:15:13 -04:00
b779fa4fe9 make json valid 2013-04-10 23:43:16 -05:00
0be04d2b57 Decided to not deprecate legacy template syntax for now. Backwards compat is important, though the docs will suggest the new way. 2013-04-10 19:21:35 -04:00
695acc2de0 Make lookup plugins accessible in templates 2013-04-10 19:19:01 -04:00
5b2035edd9 Changes for 'make pep8' 2013-04-10 19:12:10 -04:00
81a926547c Some continued work on new-style templates and associated test code changes. Legacy template functions
are marked with "legacy_" for possible future removal.
2013-04-10 19:09:57 -04:00
f0b21dcc0f allow references to names of variables in with_items without needing to surround them with Jinja2 '{{' delimeters 2013-04-10 18:42:54 -04:00
9ac25bb8f6 Minor formatting 2013-04-10 18:19:31 -04:00
d7206d84bb Allows Jinja2 that starts a YAML line to not cause a syntax error.
Technically this isn't quite valid YAML when this happens, so we make it valid.  This means that if a future commander
API allows save/load it should make sure it does similar processing.
2013-04-10 18:07:19 -04:00
b09ef21ec9 Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we
can remove the legacy system at a later date.
2013-04-10 17:52:35 -04:00
804056a563 Use Jinja2 strict undefined in string templating to allow the default filter to be used. 2013-04-10 16:45:53 -04:00
998230a84a Allow $foo and {{ bar }} to be used on the same line in playbooks. 2013-04-10 16:40:49 -04:00
29209c4913 Style fixes so "make pep8" is clean. 2013-04-10 16:37:49 -04:00
0113951580 Enable usage of when_set within new eval system. 2013-04-10 16:26:59 -04:00
a83e10d77d Use safe_eval vs eval. 2013-04-10 16:17:24 -04:00
fecfbf9226 Allow jinja2 evals that produce lists to be used in with_items. Ideally want something a bit less heavy
than the eval here.
2013-04-10 15:22:08 -04:00
e8085ad40c Since we removed the (undocumented) playbook include + with_items code, fix the tests to
compensate.
2013-04-10 15:08:18 -04:00
c5d9823467 Fix some items related to playbook includes and indentation. 2013-04-10 15:04:41 -04:00
0893562605 Add base64 encode and decode filters to templates 2013-04-10 02:30:31 +02:00
290780d13f Playbook + with_items was an undocumented feature that was causing problems because it would
evaluate and replace '$item' with ''.  Really it doesn't make sense to include multiple playbooks
via a loop variable, as you can do this with task + with_items already (and it's a simpler code
path).  Given this is undocumented, this removes that feature, and we'll consider next how to
also add 'with_items' support directly to roles.
2013-04-09 20:13:55 -04:00
5c0daf9e0a When saving to dest, check if we get redirected, and use the new
location header to set the dest file name if we only provided a
target dir. Only save if dest not modified.
2013-04-10 02:03:53 +02:00
c64f19dc5f Don't set the item variable as eager template replacement will over-replace the variable as an empty string. 2013-04-09 19:57:53 -04:00
154f58f82d Fix Jinja2 filter plugins initialization
_get_filter_plugins() checks FILTER_PLUGINS against None hence
the latter should be initialized to None.
2013-04-09 22:38:24 +02:00
e874bf86c3 Typo in docs 2013-04-09 20:47:39 +02:00
f60ec80fca initial commit. 2013-04-09 11:53:03 -04:00
690738ea32 implement --start-at-task option to hop to a specific task before starting running them 2013-04-09 01:53:40 -04:00
586ee923a6 Merge pull request #2620 from willthames/shlex_split_bug
Test case and fix for shlex.split unicode bug
2013-04-08 21:28:29 -07:00
5cac2a763b Merge pull request #2616 from victorcoder/devel
Enable virt module to work with different libvirt connection uris.
2013-04-08 16:45:32 -07:00
c5c942c674 Enable virt module to work with different libvirt connection uris. This allow to work with all libvirt supported VMs. 2013-04-08 22:14:37 +02:00
917704ee3a Merge pull request #2613 from garethrees/patch-1
Add separate step update_cache example
2013-04-08 09:40:15 -07:00
bef2f5696f Update changelog 2013-04-08 12:39:00 -04:00
61f2668b0a Don't include the '.yml' in the path to the retry files. 2013-04-08 12:38:05 -04:00
0d530f3bf0 Change the retry logic to write a limit file, able to source limit from files by indicating with @filename 2013-04-08 12:36:01 -04:00
c45b54c1cf Add separate step update_cache example 2013-04-08 18:20:23 +02:00
735db1775c allow URL spec for install 2013-04-08 11:54:27 +02:00
c1d251cbdc Add availability zone parameter 2013-04-08 10:42:34 +01:00
770680180b Use psycopg2's string handling to escape password string
This allows the password to contain single quotes and should make it safe to
use randomly generated passwords (provided passwords can be represented in the
connection encoding).
2013-04-08 08:38:35 +02:00
9d87733f98 Test case and fix for shlex.split unicode bug
When operating on a unicode string in python 2.6, shlex.split returns
a result that does not work with the file constructor.

To reproduce this requires a task include that is templated (this is
because the templated string is a unicode result, whereas a non-
templated string is a non-unicode string)

    [will@centos6.3] $ python
    Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
    [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import shlex
    >>> shlex.split(u'abc')
    ['a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00']

    [will@fedora17] $ python
    Python 2.7.3 (default, Jul 24 2012, 10:05:38)
    [GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import shlex
    >>> shlex.split(u'abc')
    ['abc']

The proposed fix (coercing the include parameters to string before the
shlex.split) may not be ideal but it does fix the bug for my test case.
2013-04-08 14:47:43 +10:00
c695aa2d6a When playbooks fail, attempt to create an inventory file in the inventory directory that allows rerunning
of the playbook against only the hosts that failed.
2013-04-07 23:37:10 -04:00
ca71eb8cfc Changelog update 2013-04-06 19:03:22 -04:00
5c8e081506 Update changelog 2013-04-06 19:03:22 -04:00
5fef2ffb9d Merge pull request #2592 from stoned/include-task-when
when: condition support for tasks include
2013-04-06 16:01:44 -07:00
00252353b9 Decided I liked the asterisks 2013-04-06 18:58:55 -04:00
bc0be456da Modify output banners to have constant length and use dashes instead
of "-" to be less visually heavy (unless cowsay is installed of course)
2013-04-06 18:52:30 -04:00
1ed54b9b3a when: condition support for tasks include 2013-04-07 00:43:39 +02:00
e9d11173cd Remove obsolete comment 2013-04-06 18:38:31 -04:00
fffb1a0a9d Loose tasks not in roles get executed after roles. 2013-04-06 18:36:25 -04:00
f044fc344b When using roles, or other includes, the path to DWIM inside is the path of the task include
file.
2013-04-06 18:32:36 -04:00
f88d13acf9 Merge pull request #2590 from zecrazytux/utf-8
Makes $PIPE and $FILE macros accept utf-8 input
2013-04-06 14:33:49 -07:00
b94bf051d5 Makes $PIPE and $FILE macros accept utf-8 input 2013-04-06 23:28:15 +02:00
12bcd4adfe Update README.md
update web address
2013-04-06 17:22:21 -03:00
d2bc1d5fb7 Update README.md
update my email address
2013-04-06 17:20:20 -03:00
20ec682b30 Remove stray file 2013-04-06 13:14:56 -04:00
5c4ed72571 Demo of parameterized roles! 2013-04-06 12:51:17 -04:00
f308194b9a Added examples of how roles work! 2013-04-06 12:35:35 -04:00
892484812e Much requested feature -- allows relative imports of content within roles or relative to any task or handler include (../templates for template ../files for copy) 2013-04-06 12:13:04 -04:00
a0422bd534 Added 'validate' feature to copy and template modules, now you can add a check to force copy to fail if the check fails.
had to add entry in file for it to accept as a option even though file itself ignores it.
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-04-06 11:52:18 -04:00
95f30f0def Complete streamlining of vars handling in playbooks and how those are templated to avoid
repeat template calls at playbook intialization time.
2013-04-06 10:45:09 -04:00
1dfe60a6ea Allow any parameter in a play to be set by --extra-vars through cleaner use of data structure
templating.
2013-04-06 10:09:16 -04:00
4cd69e81b9 Catch recursive templating errors and display what string caused them. 2013-04-06 09:55:31 -04:00
2b58145599 Merge pull request #2582 from blair/inventory-scripts-not-in-path
Fix for inventory scripts with no path prefix that are in CWD.
2013-04-06 06:23:28 -07:00
6826aa7360 Tweaked merge_hash to also affect Runner behavior 2013-04-06 13:06:38 +03:00
36b3fc3acf Fix for inventory scripts with no path prefix that are in CWD.
Without this, using '-i ec2.py' will not work if '.' is not in PATH.
2013-04-05 20:52:59 -07:00
1aa2f9749e ec2_vol: do no work if the instance has a volume mounted at the device. 2013-04-05 19:17:19 -07:00
96cbd61d5e ec2_vol: update docs to match default device_name values for Unix/Windows. 2013-04-05 19:17:12 -07:00
94d189bc7f Make this example make sense :) 2013-04-05 19:11:37 -04:00
f585c4cde7 Upgraded variable support met with upgraded conditional support, see examples/playbooks/upgraded_vars.yml
for details!
2013-04-05 19:10:32 -04:00
38c2b14339 Undefined Jinja2 statements are returned as they originally are so you can tell there are things to
correct.
2013-04-05 17:36:53 -04:00
b82cda646d Fixup authorized key doc formatting 2013-04-05 15:33:21 -04:00
110d2b6ec5 Fixup ec2 doc formatting and use complex args format to break up long lines. 2013-04-05 15:30:36 -04:00
aebe1030dc Add version added info for s3 module. 2013-04-05 15:18:31 -04:00
9ca7d52364 Merge pull request #2554 from magnusart/s3-overwrite-param
New try: s3 overwrite and checksum support
2013-04-05 12:12:37 -07:00
c624577145 Merge pull request #2550 from joelsemar/devel
adds private_ip param to ec2 module
2013-04-05 12:12:06 -07:00
49d28b9a44 This SELinux commit is too strict and we should only fail if trying to read/tweak SELinux attributes else
python-selinux can't be installed w/ the yum module when missing.

Revert "Added an extra check for target nodes with selinux but without libselinux-python package installed"

This reverts commit 550986b6a1.
2013-04-05 14:54:11 -04:00
2c881e2b3d Merge pull request #2578 from arrfab/selinux-fix-2
Added an extra check for target nodes with selinux but without libselinux-python package installed
2013-04-05 11:52:14 -07:00
ee4e2dfbfc Fixup module docs. 2013-04-05 14:51:08 -04:00
3694e4ef80 Merge branch 'devel' of git://github.com/gregswift/ansible into devel 2013-04-05 14:50:35 -04:00
d9fd175b8b update changelog 2013-04-05 14:50:15 -04:00
9073aa17ab Chroot also needs args/kwargs. 2013-04-05 14:50:15 -04:00
3d25b4a7c0 Standardize args/kwargs on connection plugins. 2013-04-05 14:50:15 -04:00
d5d26bab9b Make private key customizable per host using ansible_ssh_private_key_file configurable as variable
This fixes issue #1026 for @toshywoshy together with ansible_ssh_user and ansible_ssh_port.
2013-04-05 14:50:15 -04:00
550986b6a1 Added an extra check for target nodes with selinux but without libselinux-python package installed 2013-04-05 20:37:58 +02:00
98e4b1f4b8 Merge pull request #2575 from gw0/docs-lookup
Improved Lookup plugins documentation
2013-04-05 11:29:38 -07:00
3263356bf4 Merge pull request #2446 from b6d/postgresql_db-module-extension
postgresql_db: add args lc_collate, lc_ctype
2013-04-05 11:14:06 -07:00
8c859f6f61 Merge pull request #2570 from skvidal/devel
simple fix for issue 2564
2013-04-05 11:07:22 -07:00
6df4c486e9 organize changelog 2013-04-05 13:59:10 -04:00
550bf47636 Merge pull request #2565 from willthames/default_exec
Added DEFAULT_EXECUTABLE as a constant
2013-04-05 10:56:56 -07:00
0440c48fe0 Merge pull request #2559 from mavimo/feature/documentation-vagrant
vagrant module documentation
2013-04-05 10:51:37 -07:00
f7a53d24e7 Merge pull request #2558 from jochu/mysql-password
mysql_db: use --password= instead of -p in dump/import
2013-04-05 10:50:35 -07:00
34e190d89b Merge pull request #2557 from bcoca/deb_make_reqs
small doc fix for 'make deb'
2013-04-05 10:50:02 -07:00
3f89a3ba1c Merge pull request #2552 from lwade/ec2docs
Updated and improved the documentation (examples)
2013-04-05 10:43:29 -07:00
307c9d132c Merge pull request #2571 from Tinche/service
Service module changed to terminate early if only enabled specified
2013-04-05 10:41:33 -07:00
9c4d747194 update changelog 2013-04-05 13:25:51 -04:00
ee6d64774a Work in progress. 2013-04-05 13:25:51 -04:00
7ea6fcfd64 Changelog update 2013-04-05 13:25:51 -04:00
75316656de Merge pull request #2542 from chrishoffman/npm
Adding npm module
2013-04-05 10:25:02 -07:00
f4eb02ce16 Merge pull request #2537 from j2sol/rax
Provide functionality to work with Rackspace's public cloud
2013-04-05 10:20:49 -07:00
5815fcbd49 Update changelog 2013-04-05 13:14:58 -04:00
7116c83c4a Standardize test output 2013-04-05 13:13:33 -04:00
2c783c7145 Disable a test temporarily 2013-04-05 13:12:46 -04:00
f37da4fdd7 Merge branch 'ssh_config_user_overrides' of git://github.com/bcoca/ansible into devel 2013-04-05 13:09:38 -04:00
b67cd6bbda Merge branch 'any-errors-fatal' of git://github.com/junegunn/ansible into devel 2013-04-05 13:07:23 -04:00
gw0
80a4e02372 Improved Lookup plugins documentation 2013-04-05 20:00:23 +03:00
c4442ad804 Documented executable setting for ansible.cfg 2013-04-05 09:39:22 +10:00
tin
b528ca7c80 Additional example in service documentation. 2013-04-04 21:03:15 +02:00
tin
7d1ff1bd38 Changed the service module to terminate early if only changing the enabled state.
Expanded the documentation slightly.
2013-04-04 21:00:47 +02:00
b25d445324 Updating version added, tweaking instantiation 2013-04-04 14:59:57 -04:00
2796b5ee2a simple fix for issue 2564
when we encounter a group we've not seen before - we need
to make sure we make it a subgroup of 'all', no matter what
2013-04-04 12:44:39 -04:00
8d99ef7113 Merge pull request #2563 from gw0/fix-lineinfile
Improved backrefs example in lineinfile.
2013-04-04 06:45:07 -07:00
cbeda6dbfb Fix typo in message. 2013-04-04 08:31:26 -04:00
e55e123c01 Added DEFAULT_EXECUTABLE as a constant
Use DEFAULT_EXECUTABLE when no executable is passed to
_low_level_command_exec

Works as a standard constant - can be overridden in all the normal ways
and defaults to /bin/sh

Motiviation is for a user that only has /bin/bash in /etc/sudoers
2013-04-04 13:32:23 +10:00
acd5426094 Improved backrefs example in lineinfile. 2013-04-04 05:19:39 +02:00
a8f966cd06 Moved choises in the right place 2013-04-03 21:29:57 +02:00
e102d8807a moved dependencies in the right place 2013-04-03 21:29:05 +02:00
50fa0898db mysql_db: use --password= instead of -p in dump/import 2013-04-03 09:58:58 -07:00
386b736ec1 added missing build deps for debian/ubuntu to readme
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-04-03 12:27:18 -04:00
4bef5dd08b Update README.md 2013-04-03 12:51:55 -03:00
d23f35f550 Update README.md 2013-04-03 12:51:33 -03:00
efc74da9c9 Update README.md 2013-04-03 12:51:21 -03:00
cdaa2085ee Preliminary ability to use Jinja2 {{ }} to replace ${foo.bar} in playbooks. Can't use both at the same time per line. 2013-04-03 01:04:16 -04:00
aa4ad80bda Update release version. 2013-04-02 20:48:30 -04:00
455fd612d3 Added functionality for md5 checksum together with a new overwrite param
to indicate that remote file should be overwritten if a file with the
same filename exists.
2013-04-02 19:19:11 +02:00
2233a4a6f3 Updated and improved the documentation (examples) 2013-04-02 11:44:59 +01:00
d9c2dcf7de adds private_ip param to ec2 module 2013-04-02 00:31:31 -05:00
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
2580adaeaa Adding npm module 2013-03-31 23:35:39 -04: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
34e585024c Fix up docs and add ability to insert files
Files can be inserted during server creation (like a fully formed
authorized_keys file). This code allows that to happen.

Docs were updated for formatting, location, and to add the new entry for
files.
2013-03-31 00:05:14 -07:00
c47fd199bd Initial commit of rax inventory plugin
The rax inventory plugin provides a way to discovery inventory in the
Rackspace Public Cloud by way of pyrax, the official SDK. Grouping will
be done if a group:name is found in the instance metadata. When a single
host is queried all the instance details are returned with a rax_
prefix.

Because inventory plugins cannot take extra arguments, ENV variables
must be set to point to the pyrax compatible credentials file and the
region to query against.
2013-03-30 23:04:07 -07:00
9027a9b021 Initial commit of rax library
This library provides functionality for the Rackspace Public Cloud by
way of the official pyrax SDK (https://github.com/rackspace/pyrax). At
this time only the cloudservers service is functional. Instances can be
created or deleted. Idempotency is provided on matching instances with
the same name, flavor, image, and metadata values within a given
region.

pyrax usage does require a credentials file written out to hold username
and API key.  See pyrax documentation for details
(https://github.com/rackspace/pyrax/blob/master/docs/pyrax_doc.md)
2013-03-30 23:04:07 -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
b874027b36 compare the number of available hosts before and after running each task 2013-03-29 13:13:22 +09: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
20a48c6bdf terminate immediately on a failure 2013-03-28 15:17:01 +09:00
82c3b4e685 now ssh connection plugin will only pass user as an option to ssh if it is
differnt from the current user. This should enable overrides for user in
.ssh/config w/o breaking any current functionality.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-27 16:41:54 -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
34a38a74b1 Extend authorized_keys module for use with alternate AuthorizedKeysFile configurations 2013-03-26 10:12:09 -05: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
b7f3d6ac92 postgresql_db: add args lc_collate, lc_ctype
Allow the specification of additional locale settings (lc_collate and lc_ctype) when creating a new database (state=present).

Fail if the specified database already exists with different locale/encoding settings. (These settings can't be changed for existing databases as far as I know, and failing seems better than suggesting that no change was necessary by returning changed=False)
2013-03-25 12:34:59 +01: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
a10d74f703 Improve Linux network facts incl. bridges, ppp, wwan devices
This patch adds all interfaces (even inactive ones) to setup output.
2013-03-22 12:31:27 +01: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
bcc2e84a4b Fix reference to parameter group name 2013-03-13 16:51:43 -04:00
dd2d0dd175 Add basic inventory support for RDS instances 2013-03-13 16:43:26 -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
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
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
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
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
435 changed files with 49726 additions and 9764 deletions

18
.gitignore vendored
View File

@ -1,6 +1,7 @@
# build products...
*.py[co]
build
AUTHORS.TXT
# Emacs backup files...
*~
.\#*
@ -13,6 +14,8 @@ rpm-build
.pydevproject
# PyCharm stuff...
.idea
#IntelliJ IDEA stuff..
*.iml
# Mac OS X stuff...
.DS_Store
# manpage build stuff...
@ -21,10 +24,15 @@ docs/man/man3/*
*.sublime-project
*.sublime-workspace
# docsite stuff...
docsite/rst/modules
docsite/*.html
docsite/_static/*.gif
docsite/_static/*.png
docsite/_static/websupport.js
docsite/latest/rst/modules
docsite/latest/*.html
docsite/latest/_static/*.gif
docsite/latest/_static/*.png
docsite/latest/_static/websupport.js
docsite/latest/searchindex.js
docsite/latest/htmlout
# deb building stuff...
debian/
# Vim swap files
*.swp
*.swo

View File

@ -1,7 +1,627 @@
Ansible Changes By Release
==========================
0.8 "Cathedral" -- release pending
1.4 "Could This Be Magic" - Release pending!
Highlighted new features:
* TBA
New modules:
* TBA
Misc changes:
* TBA
1.3.2 "Top of the World" (reprise) - September 19th, 2013
* The ControlPath variable for ssh connections is now configurable in the ansible.cfg (and via the environment variable ANSIBLE_SSH_CONTROL_PATH).
* Added a -vvvv level, which will show SSH client debugging information in the event of a failure.
* Fixed bug in apt_repository module where the repository cache was not being updated.
* Fixed bug where "too many open files" errors would be encountered due to pseudo TTY's not being closed properly.
1.3.1 "Top of the World" (reprise) - September 16th, 2013
* Fixing a bug in accelerate mode whereby the gather_facts step would always be run via sudo regardless of the play settings.
1.3 "Top of the World" - September 13th, 2013
Highlighted new features:
* accelerated mode: An enhanced fireball mode that requires zero bootstrapping and fewer requirements plus adds capabilities like sudo commands.
* role defaults: Allows roles to define a set of variables at the lowest priority. These variables can be overridden by any other variable.
* new /etc/ansible/facts.d allows JSON or INI-style facts to be provided from the remote node, and supports executable fact programs in this dir. Files must end in *.fact.
* added the ability to make undefined template variables raise errors (see ansible.cfg)
* (DOCS PENDING) sudo: True/False and sudo_user: True/False can be set at include and role level
* added changed_when: (expression) which allows overriding whether a result is changed or not and can work with registered expressions
* --extra-vars can now take a file as input, e.g., "-e @filename" and can also be formatted as YAML
* external inventory scripts may now return host variables in one pass, which allows them to be much more efficient for large numbers of hosts
* if --forks exceeds the numbers of hosts, it will be automatically reduced. Set forks to 0 and you get "as many forks as I have hosts" out of the box.
* enabled error_on_undefined_vars by default, which will make errors in playbooks more obvious
* role dependencies -- one role can now pull in another, with parameters of its own.
* added the ability to have tasks execute even during a check run (always_run).
* added the ability to set the maximum failure percentage for a group of hosts.
New modules:
* notifications: datadog_event -- send data to datadog
* cloud: digital_ocean -- module for DigitalOcean provisioning that also includes inventory support
* cloud: rds -- Amazon Relational Database Service
* cloud: linode -- modules for Linode provisioning that also includes inventory support
* cloud: route53 -- manage Amazon DNS entries
* cloud: ec2_ami -- manages (and creates!) ec2 AMIs
* database: mysql_replication -- manages mysql replication settings for masters/slaves
* database: mysql_variables -- manages mysql runtime variables
* database: redis -- manages redis databases (slave mode and flushing data)
* net_infrastructure: arista_interface
* net_infrastructure: arista_lag
* net_infrastructure: arista_l2interface
* net_infrastructure: arista_vlan
* system: stat -- reports on stat(istics) of remote files, for use with 'register'
* web_infrastructure: htpasswd -- manipulate htpasswd files
* packaging: rpm_key -- adds or removes RPM signing keys
* packaging: apt_repository -- rewritten to remove dependencies
* monitoring: boundary_meter -- adds or removes boundary.com meters
* net_infrastructure: dnsmadeeasy - manipulate DNS Made Easy records
* files: xattr -- manages extended attributes on files
Misc changes:
* return 3 when there are hosts that were unreachable during a run
* the yum module now supports wildcard values for the enablerepo argument
* added an inventory script to pull host information from Zabbix
* async mode no longer allows with_* lookup plugins due to incompatibilities
* Added OpenRC support (Gentoo) to the service module
* ansible_ssh_user value is available to templates
* added placement_group parameter to ec2 module
* new sha256sum parameter added to get_url module for checksum validation
* search for mount binaries in system path and sbin vs assuming path
* allowed inventory file to be read from a pipe
* added Solaris distribution facts
* fixed bug along error path in quantum_network module
* user password update mode is controllable in user module now (at creation vs. every time)
* added check mode support to the OpenBSD package module
* Fix for MySQL 5.6 compatibility
* HP UX virtualization facts
* fixed some executable bits in git
* made rhn_register module compatible with EL5
* fix for setup module epoch time on Solaris
* sudo_user is now expanded later, allowing it to be set at inventory scope
* mongodb_user module changed to also support MongoDB 2.2
* new state=hard option added to the file module for hardlinks vs softlinks
* fixes to apt module purging option behavior
* fixes for device facts with multiple PCI domains
* added "with_inventory_hostnames" lookup plugin, which can take a pattern and loop over hostnames matching the pattern and is great for use with delegate_to and so on
* ec2 module supports adding to multiple security groups
* cloudformation module includes fixes for the error path, and the 'wait_for' parameter was removed
* added --only-if-changed to ansible-pull, which runs only if the repo has changes (not default)
* added 'mandatory', a Jinja2 filter that checks if a variable is defined: {{ foo|mandatory }}
* added support for multiple size formats to the lvol module
* timing reporting on wait_for module now includes the delay time
* IRC module can now send a server password
* "~" now expanded on each component of configured plugin paths
* fix for easy_install module when dealing with virtualenv
* rackspace module now explicitly indicates rackspace vs vanilla openstack
* add_host module does not report changed=True any longer
* explanatory error message when using fireball with sudo has been improved
* git module now automatically pulls down git submodules
* negated patterns do not require "all:!foo", you can just say "!foo" now to select all not foos
* fix for Debian services always reporting changed when toggling enablement bit
* roles files now tolerate files named 'main.yaml' and 'main' in addition to main.yml
* some help cleanup to command line flags on scripts
* force option reinstated for file module so it can create symlinks to non-existent files, etc.
* added termination support to ec2 module
* --ask-sudo-pass or --sudo-user does not enable all options to use sudo in ansible-playbook
* include/role conditionals are added ahead of task conditionals so they can short circuit properly
* added pipes.quote in various places so paths with spaces are better tolerated
* error handling while executing Jinja2 filters has been improved
* upgrades to atomic replacement logic when copying files across partitions/etc
* mysql user module can try to login before requiring explicit password
* various additional options added to supervisorctl module
* only add non unique parameter on group creation when required
* allow rabbitmq_plugin to specify a non-standard RabbitMQ path
* authentication fixes to keystone_user module
* added IAM role support to EC2 module
* fixes for OpenBSD package module to avoid shell expansion
* git module upgrades to allow --depth and --version to be used together
* new lookup plugin, "with_flattened"
* extra vars (-e) variables can be used in playbook include paths
* improved reporting for invalid sudo passwords
* improved reporting for inability to find a suitable tmp location
* require libselinux-python to perform file operations if SELinux is operational
* ZFS module fixes for byte display constants and handling paths with spaces
* setup module more tolerant of gathering facts against things it does not have permission to read
* can specify name=* state=latest to update all yum modules
* major speedups to the yum module for default cases
* ec2_facts module will now run in check mode
* sleep option on service module for sleeping between stop/restart
* fix for IPv6 facts on BSD
* added Jinja2 filters: skipped, whether a result was skipped
* added Jinja2 filters: quote, quotes a string if it needs to be quoted
* allow force=yes to affect apt upgrades
* fix for saving conditionals in variable names
* support for multiple host ranges in INI inventory, e.g., db[01:10:3]node-[01:10]
* fixes/improvements to cron module
* add user_install=no option to gem module to install gems system wide
* added raw=yes to allow copying without python on remote machines
* added with_indexed_items lookup plugin
* Linode inventory plugin now significantly faster
* added recurse=yes parameter to pacman module for package removal
* apt_key module can now target specific keyrings (keyring=filename)
* ec2 module change reporting improved
* hg module now expands user paths (~)
* SSH connection type known host checking now can process hashed known_host files
* lvg module now checks for executables in more correct locations
* copy module now works correctly with sudo_user
* region parameter added to ec2_elb module
* better default XMPP module message types
* fixed conditional tests against raw booleans
* mysql module grant removal is now smarter
* apt-remove is now forced to be non-interactive
* support ; comments in INI file module
* fixes to callbacks WRT async output (fire and forget tasks now trigger callbacks!)
* folder support for s3 module
* added new example inventory plugin for Red Hat OpenShift
* and other misc. bugfixes
1.2.3 "Hear About It Later" (reprise) -- Aug 21, 2013
* Local security fixes for predictable file locations for ControlPersist and retry file paths on shared machines
on operating systems without kernel symlink/hardlink protections.
1.2.2 "Hear About It Later" (reprise) -- July 4, 2013
* Added a configuration file option [paramiko_connection] record_host_keys which allows the code that paramiko uses
to update known_hosts to be disabled. This is done because paramiko can be very slow at doing this if you have a
large number of hosts and some folks may not want this behavior. This can be toggled independently of host key checking
and does not affect the ssh transport plugin. Use of the ssh transport plugin is preferred if you have ControlPersist
capability, and Ansible by default in 1.2.1 and later will autodetect.
1.2.1 "Hear About It Later" -- July 4, 2013
* Connection default is now "smart", which discovers if the system openssh can support ControlPersist, and uses
it if so, if not falls back to paramiko.
* Host key checking is on by default. Disable it if you like by adding host_key_checking=False in the [default]
section of /etc/ansible/ansible.cfg or ~/ansible.cfg or by exporting ANSIBLE_HOST_KEY_CHECKING=False
* Paramiko now records host keys it was in contact with host key checking is on. It is somewhat sluggish when doing this,
so switch to the 'ssh' transport if this concerns you.
1.2 "Right Now" -- June 10, 2013
Core Features:
* capability to set 'all_errors_fatal: True' in a playbook to force any error to stop execution versus
a whole group or serial block needing to fail
usable, without breaking the ability to override in ansible
* ability to use variables from {{ }} syntax in mainline playbooks, new 'when' conditional, as detailed
in documentation. Can disable old style replacements in ansible.cfg if so desired, but are still active
by default.
* can set ansible_ssh_private_key_file as an inventory variable (similar to ansible_ssh_host, etc)
* 'when' statement can be affixed to task includes to auto-affix the conditional to each task therein
* cosmetic: "*****" banners in ansible-playbook output are now constant width
* --limit can now be given a filename (--limit @filename) to constrain a run to a host list on disk
* failed playbook runs will create a retry file in /var/tmp/ansible usable with --limit
* roles allow easy arrangement of reusable tasks/handlers/files/templates
* pre_tasks and post_tasks allow for separating tasks into blocks where handlers will fire around them automatically
* "meta: flush_handler" task capability added for when you really need to force handlers to run
* new --start-at-task option to ansible playbook allows starting at a specific task name in a long playbook
* added a log file for ansible/ansible-playbook, set 'log_path' in the configuration file or ANSIBLE_LOG_PATH in environment
* debug mode always outputs debug in playbooks, without needing to specify -v
* external inventory script added for Spacewalk / Red Hat Satellite servers
* It is now possible to feed JSON structures to --extra-vars. Pass in a JSON dictionary/hash to feed in complex data.
* group_vars/ and host_vars/ directories can now be kept alongside the playbook as well as inventory (or both!)
* more filters: ability to say {{ foo|success }} and {{ foo|failed }} and when: foo|success and when: foo|failed
* more filters: {{ path|basename }} and {{ path|dirname }}
* lookup plugins now use the basedir of the file they have included from, avoiding needs of ../../../ in places and
increasing the ease at which things can be reorganized.
Modules added:
* cloud: rax: module for creating instances in the rackspace cloud (uses pyrax)
* packages: npm: node.js package management
* packages: pkgng: next-gen package manager for FreeBSD
* packages: redhat_subscription: manage Red Hat subscription usage
* packages: rhn_register: basic RHN registration
* packages: zypper (SuSE)
* database: postgresql_priv: manages postgresql priveledges
* networking: bigip_pool: load balancing with F5s
* networking: ec2_elb: add and remove machines from ec2 elastic load balancers
* notification: hipchat: send notification events to hipchat
* notification: flowdock: send messages to flowdock during playbook runs
* notification: campfire: send messages to campfire during playbook runs
* notification: mqtt: send messages to the Mosquitto message bus
* notification: irc: send messages to IRC channels
* notification: filesystem - a wrapper around mkfs
* notification: jabber: send jabber chat messages
* notification: osx_say: make OS X say things out loud
* openstack: keystone_user
* openstack: glance_image
* openstack: nova_compute
* openstack: nova_keypair
* openstack: quantum_floating_ip
* openstack: quantum_floating_ip_associate
* openstack: quantum_network
* openstack: quantum_router
* openstack: quantum_router_gateway
* openstack: quantum_router_interface
* openstack: quantum_subnet
* monitoring: newrelic_deployment: notifies newrelic of new deployments
* monitoring: airbrake_deployment - notify airbrake of new deployments
* monitoring: pingdom
* monitoring: pagerduty
* monitoring: monit
* utility: set_fact: sets a variable, which can be the result of a template evaluation
Modules removed
* vagrant -- can't be compatible with both versions at once, just run things though the vagrant provisioner in vagrant core
Bugfixes and Misc Changes:
* service module happier if only enabled=yes|no specified and no state
* mysql_db: use --password= instead of -p in dump/import so it doesn't go interactive if no pass set
* when using -c ssh and the ansible user is the current user, don't pass a -o to allow SSH config to be
* overwrite parameter added to the s3 module
* private_ip parameter added to the ec2 module
* $FILE and $PIPE now tolerate unicode
* various plugin loading operations have been made more efficient
* hostname now uses platform.node versus socket.gethostname to be more consistant with Unix 'hostname'
* fix for SELinux operations on Unicode path names
* inventory directory locations now ignore files with .ini extensions, making hybrid inventory easier
* copy module in check-mode now reports back correct changed status when used with force=no
* added avail. zone to ec2 module
* fixes to the hash variable merging logic if so enabled in the main settings file (default is to replace, not merge hashes)
* group_vars and host_vars files can now end in a .yaml or .yml extension, (previously required no extension, still favored)
* ec2vol module improvements
* if the user module is told to generate the ssh key, the key generated is now returned in the results
* misc fixes to the Riak module
* make template module slightly more efficient
* base64encode / decode filters are now available to templates
* libvirt module can now work with multiple different libvirt connecton URIs
* fix for postgresql password escaping
* unicode fix for shlex.split in some cases
* apt module upgrade logic improved
* URI module now can follow redirects
* yum module can now install off http URLs
* sudo password now defaults to ssh password if you ask for both and just hit enter on the second prompt
* validate feature on copy and template module, for example, running visudo prior to copying the file over
* network facts upgraded to return advanced configs (bonding, etc)
* region support added to ec2 module
* riak module gets a wait for ring option
* improved check mode support in the file module
* exception handling added to handle scenario when attempt to log to systemd journal fails
* fix for upstart handling when toggling the enablement and running bits at the same time
* when registering a task with a conditional attached, and the task is skipped by the conditional,
the variable is still registered for the host, with the attribute skipped: True.
* delegate_to tasks can look up ansible_ssh_private_key_file variable from inventory correctly now
* s3 module takes a 'dest' parameter to change the destination for uploads
* apt module gets a cache_valid_time option to avoid redundant cache updates
* ec2 module better understands security groups
* fix for postgresql codec usage
* setup module now tolerant of OpenVZ interfaces
* check mode reporting improved for files and directories
* doc system now reports on module requirements
* group_by module can now also make use of globally scoped variables
* localhost and 127.0.0.1 are now fuzzy matched in inventory (are now more or less interchangeable)
* AIX improvements/fixes for users, groups, facts
* lineinfile now does atomic file replacements
* fix to not pass PasswordAuthentication=no in the config file unneccessarily for SSH connection type
* for for authorized_key on Debian Squeeze
* fixes for apt_repository module reporting changed incorrectly on certain repository types
* allow the virtualenv argument to the pip module to be a pathname
* service pattern argument now correctly read for BSD services
* fetch location can now be controlled more directly via the 'flat' parameter.
* added basename and dirname as Jinja2 filters available to all templates
* pip works better when sudoing from unpriveledged users
* fix for user creation with groups specification reporting 'changed' incorrectly in some cases
* fix for some unicode encoding errors in outputing some data in verbose mode
* improved FreeBSD, NetBSD and Solaris facts
* debug module always outputs data without having to specify -v
* fix for sysctl module creating new keys (must specify checks=none)
* NetBSD and OpenBSD support for the user and groups modules
* Add encrypted password support to password lookup
1.1 "Mean Street" -- 4/2/2013
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_dir' 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 separate 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:
@ -12,7 +632,7 @@ Highlighted Core Changes:
Other Core Changes:
* ansible config file can also go in '.ansible.cfg' in cwd in addition to ~/.ansible.cfg and /etc/ansible/ansible.cfg
* 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
@ -31,6 +651,7 @@ Other Core Changes:
* 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:
@ -46,6 +667,8 @@ Highlighted playbook changes:
* 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:
@ -92,6 +715,8 @@ Other module Changes, Upgrades, and Fixes:
* 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
@ -167,13 +792,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:
@ -232,7 +857,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

View File

@ -49,11 +49,25 @@ We're not too strict on style considerations, but we require:
* 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.
copyright license to all users and developers of the project, present and future, pursuant to the license of the project.

View File

@ -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
@ -47,23 +52,28 @@ endif
# RPM build parameters
RPMSPECDIR= packaging/rpm
RPMSPEC = $(RPMSPECDIR)/ansible.spec
RPMDIST = $(shell rpm --eval '%dist')
RPMDIST = $(shell rpm --eval '%{?dist}')
RPMRELEASE = 1
ifeq ($(OFFICIAL),)
RPMRELEASE = 0.git$(DATE)
endif
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
NOSETESTS := nosetests
########################################################
all: clean python
tests:
PYTHONPATH=./lib nosetests -d -v
PYTHONPATH=./lib $(NOSETESTS) -d -v
# To force a rebuild of the docs run 'touch VERSION && make docs'
docs: $(MANPAGES) modulepages
authors:
sh hacking/authors.sh
# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
# recently than %.1.asciidoc.
%.1.asciidoc: %.1.asciidoc.in
@ -109,15 +119,17 @@ clean:
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 docs
python setup.py sdist -t MANIFEST.in
$(PYTHON) setup.py sdist -t MANIFEST.in
rpmcommon: sdist
@mkdir -p rpm-build
@ -145,7 +157,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 "#############################################"
@ -164,19 +177,10 @@ deb: debian
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
modulepages:
hacking/module_formatter.py -A $(VERSION) -t man -o docs/man/man3/ --module-dir=library --template-dir=hacking/templates
modulejson:
mkdir -p docs/json
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
hacking/module_formatter.py -A $(VERSION) -t js -o docs/js --module-dir=docs/json --template-dir=hacking/templates
PYTHONPATH=./lib $(PYTHON) hacking/module_formatter.py -A $(VERSION) -t man -o docs/man/man3/ --module-dir=library --template-dir=hacking/templates # --verbose
# 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)
(cd docsite/latest; make docs)

View File

@ -4,7 +4,11 @@ Ansible
Ansible is a radically simple configuration-management, deployment, task-execution, and
multinode orchestration framework.
Read the documentation and more at http://ansible.cc
Read the documentation and more at http://ansibleworks.com/
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://ansibleworks.com/docs/gettingstarted.html for a variety of platforms. If you want a tarball of the last release, go to
http://ansibleworks.com/releases/ and you can also install with pip (though that will bring in some optional binary dependencies you normally do not need).
Design Principles
=================
@ -21,7 +25,7 @@ Design Principles
Get Involved
============
* [ansible-project mailing list](http://groups.google.com/group/ansible-project)
* [ansible-project mailing list](http://groups.google.com/group/ansible-project), rss: [here](https://groups.google.com/group/ansible-project/feed/rss_v2_0_msgs.xml?num=50&pli=1)
* irc.freenode.net: #ansible
Branch Info
@ -35,8 +39,6 @@ Branch Info
Author
======
Michael DeHaan -- michael.dehaan@gmail.com
[http://michaeldehaan.net](http://michaeldehaan.net/)
Michael DeHaan -- michael@ansibleworks.com
[AnsibleWorks](http://ansibleworks.com)

View File

@ -1,13 +1,22 @@
Ansible Releases at a Glance
============================
0.8 "Cathedral" ------- pending
0.7 "Panama" ---------- 9-06-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
0.0.2 Untitled
0.0.1 Untitled
1.4 "Could This Be Magic?" - active development
1.3 "Top of the World" ----- 09-13-2013
1.2.3 "Hear About It Later" -- 08-21-2013
1.2.2 "Hear About It Later" -- 07-05-2013
1.2.1 "Hear About It Later" -- 07-04-2013
1.2 "Right Now" ------------ 06-10-2013
1.1 "Mean Street" ---------- 04-02-2013
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.8
1.3.2

View File

@ -20,7 +20,6 @@
########################################################
import sys
import getpass
from ansible.runner import Runner
import ansible.constants as C
@ -28,7 +27,6 @@ from ansible import utils
from ansible import errors
from ansible import callbacks
from ansible import inventory
########################################################
class Cli(object):
@ -45,13 +43,24 @@ 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)
options, args = parser.parse_args()
self.callbacks.options = options
@ -68,19 +77,32 @@ 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"
callbacks.display("No hosts matched", stderr=True)
sys.exit(1)
if options.listhosts:
for host in hosts:
callbacks.display(' %s' % host)
sys.exit(0)
if ((options.module_name == 'command' or options.module_name == 'shell')
and not options.module_args):
callbacks.display("No argument passed to %s module" % options.module_name, color='red', stderr=True)
sys.exit(1)
sshpass = None
sudopass = None
if options.ask_pass:
sshpass = getpass.getpass(prompt="SSH password: ")
if options.ask_sudo_pass:
sudopass = getpass.getpass(prompt="sudo password: ")
options.sudo = True
if options.sudo_user:
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
# Never ask for an SSH password when we run with local connection
if options.connection == "local":
options.ask_pass = False
options.ask_sudo_pass = options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
(sshpass, sudopass) = utils.ask_passwords(ask_pass=options.ask_pass, ask_sudo_pass=options.ask_sudo_pass)
if options.sudo_user or options.ask_sudo_pass:
options.sudo = True
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
if options.tree:
@ -96,11 +118,13 @@ 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:
print "background launch...\n\n"
callbacks.display("background launch...\n\n", color='cyan')
results, poller = runner.run_async(options.seconds)
results = self.poll_while_needed(poller, options)
else:
@ -123,6 +147,10 @@ class Cli(object):
########################################################
if __name__ == '__main__':
callbacks.display("", log_only=True)
callbacks.display(" ".join(sys.argv), log_only=True)
callbacks.display("", log_only=True)
cli = Cli()
(options, args) = cli.parse()
try:
@ -131,9 +159,9 @@ if __name__ == '__main__':
if 'failed' in result or result.get('rc', 0) != 0:
sys.exit(2)
if results['dark']:
sys.exit(2)
sys.exit(3)
except errors.AnsibleError, e:
# Generic handler for ansible specific errors
print "ERROR: %s" % str(e)
callbacks.display("ERROR: %s" % str(e), stderr=True, color='red')
sys.exit(1)

233
bin/ansible-doc Executable file
View File

@ -0,0 +1,233 @@
#!/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 'requirements' in doc and doc['requirements'] is not None and len(doc['requirements']) > 0:
req = ", ".join(doc['requirements'])
print "Requirements:%s\n" % textwrap.fill(tty_ify(req), 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)
if os.path.isdir(filename):
continue
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()
def print_paths(finder):
''' Returns a string suitable for printing of the search path '''
# Uses a list to get the order right
ret = []
for i in finder._get_paths():
if i not in ret:
ret.append(i)
return os.pathsep.join(ret)
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,
print_paths(utils.plugins.module_finder)))
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,49 +18,63 @@
#######################################################
import os
import sys
import getpass
import os
import ansible.playbook
import ansible.constants as C
import ansible.utils.template
from ansible import errors
from ansible import callbacks
from ansible import utils
from ansible.color import ANSIBLE_COLOR, stringc
from ansible.callbacks import display
def colorize(lead, num, color):
""" Print 'lead' = 'num' in 'color' """
if num != 0 and ANSIBLE_COLOR:
if num != 0 and ANSIBLE_COLOR and color is not None:
return "%s%s%-15s" % (stringc(lead, color), stringc("=", color), stringc(str(num), color))
else:
return "%s=%-4s" % (lead, str(num))
def hostcolor(host, stats):
if ANSIBLE_COLOR:
def hostcolor(host, stats, color=True):
if ANSIBLE_COLOR and color:
if stats['failures'] != 0 or stats['unreachable'] != 0:
return "%-41s" % stringc(host, 'red')
return "%-37s" % stringc(host, 'red')
elif stats['changed'] != 0:
return "%-41s" % stringc(host, 'yellow')
return "%-37s" % stringc(host, 'yellow')
else:
return "%-41s" % stringc(host, 'green')
return "%-30s" % host
return "%-37s" % stringc(host, 'green')
return "%-26s" % host
def main(args):
''' run ansible-playbook operations '''
# 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.add_option('-e', '--extra-vars', dest="extra_vars", default=None,
help="set additional key=value variables from the CLI")
parser = utils.base_parser(
constants=C,
usage = "%prog playbook.yml",
connect_opts=True,
runas_opts=True,
subset_opts=True,
check_opts=True,
diff_opts=True
)
parser.add_option('-e', '--extra-vars', dest="extra_vars", action="append",
help="set additional variables as key=value or YAML/JSON", default=[])
parser.add_option('-t', '--tags', dest='tags', default='all',
help="only run plays and tasks tagged with these values")
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('--skip-tags', dest='skip_tags',
help="only run plays and tasks whose tags do not match these values")
parser.add_option('--syntax-check', dest='syntax', action='store_true',
help="do a playbook syntax check on the playbook, do not execute the playbook")
help="perform a syntax check on the playbook, but do not execute it")
parser.add_option('--list-tasks', dest='listtasks', action='store_true',
help="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")
parser.add_option('--start-at-task', dest='start_at',
help="start the playbook at the task matching this name")
options, args = parser.parse_args(args)
@ -68,31 +82,63 @@ 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 options.ask_pass:
sshpass = getpass.getpass(prompt="SSH password: ")
if options.ask_sudo_pass:
sudopass = getpass.getpass(prompt="sudo password: ")
options.sudo = True
if options.sudo_user:
options.sudo = True
if not options.listhosts and not options.syntax and not options.listtasks:
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
# Never ask for an SSH password when we run with local connection
if options.connection == "local":
options.ask_pass = False
options.ask_sudo_pass = options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
(sshpass, sudopass) = utils.ask_passwords(ask_pass=options.ask_pass, ask_sudo_pass=options.ask_sudo_pass)
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
extra_vars = utils.parse_kv(options.extra_vars)
extra_vars = {}
for extra_vars_opt in options.extra_vars:
if extra_vars_opt.startswith("@"):
# Argument is a YAML file (JSON is a subset of YAML)
extra_vars = utils.combine_vars(extra_vars, utils.parse_yaml_from_file(extra_vars_opt[1:]))
elif extra_vars_opt and extra_vars_opt[0] in '[{':
# Arguments as YAML
extra_vars = utils.combine_vars(extra_vars, utils.parse_yaml(extra_vars_opt))
else:
# Arguments as Key-value
extra_vars = utils.combine_vars(extra_vars, utils.parse_kv(extra_vars_opt))
only_tags = options.tags.split(",")
skip_tags = options.skip_tags
if options.skip_tags is not None:
skip_tags = options.skip_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:
# let inventory know which playbooks are using so it can know the basedirs
inventory.set_playbook_basedir(os.path.dirname(playbook))
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
if options.step:
playbook_cb.step = options.step
if options.start_at:
playbook_cb.start_at = options.start_at
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,
@ -107,62 +153,120 @@ def main(args):
extra_vars=extra_vars,
private_key_file=options.private_key_file,
only_tags=only_tags,
subset=options.subset,
skip_tags=skip_tags,
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'
return 0
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)
# Remove skipped tasks
matched_tags = matched_tags - set(pb.skip_tags)
unmatched_tags.discard('all')
unknown_tags = ((set(pb.only_tags) | set(pb.skip_tags)) -
(matched_tags | unmatched_tags))
if unknown_tags:
continue
print ' play #%d (%s):' % (playnum, label)
for task in play.tasks():
if (set(task.tags).intersection(pb.only_tags) and not
set(task.tags).intersection(pb.skip_tags)):
if getattr(task, 'name', None) is not None:
# meta tasks have no names
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
failed_hosts = []
unreachable_hosts = []
try:
pb.run()
hosts = sorted(pb.stats.processed.keys())
print callbacks.banner("PLAY RECAP")
display(callbacks.banner("PLAY RECAP"))
playbook_cb.on_stats(pb.stats)
for h in hosts:
t = pb.stats.summarize(h)
print "%-30s : %s %s %s %s " % (
if t['failures'] > 0:
failed_hosts.append(h)
if t['unreachable'] > 0:
unreachable_hosts.append(h)
retries = failed_hosts + unreachable_hosts
if len(retries) > 0:
filename = pb.generate_retry_inventory(retries)
if filename:
display(" to retry, use: --limit @%s\n" % filename)
for h in hosts:
t = pb.stats.summarize(h)
display("%s : %s %s %s %s" % (
hostcolor(h, t),
colorize('ok', t['ok'], 'green'),
colorize('changed', t['changed'], 'yellow'),
colorize('unreachable', t['unreachable'], 'red'),
colorize('failed', t['failures'], 'red'))
colorize('failed', t['failures'], 'red')),
screen_only=True
)
print "\n"
for h in hosts:
stats = pb.stats.summarize(h)
if stats['failures'] != 0 or stats['unreachable'] != 0:
return 2
display("%s : %s %s %s %s" % (
hostcolor(h, t, False),
colorize('ok', t['ok'], None),
colorize('changed', t['changed'], None),
colorize('unreachable', t['unreachable'], None),
colorize('failed', t['failures'], None)),
log_only=True
)
print ""
if len(failed_hosts) > 0:
return 2
if len(unreachable_hosts) > 0:
return 3
except errors.AnsibleError, e:
print >>sys.stderr, "ERROR: %s" % e
display("ERROR: %s" % e, color='red')
return 1
return 0
if __name__ == "__main__":
display(" ", log_only=True)
display(" ".join(sys.argv), log_only=True)
display(" ", log_only=True)
try:
sys.exit(main(sys.argv[1:]))
except errors.AnsibleError, e:
print >>sys.stderr, "ERROR: %s" % e
display("ERROR: %s" % e, color='red', stderr=True)
sys.exit(1)

View File

@ -14,8 +14,9 @@
#
# 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
# after checking out a playbooks directory from source repo. There is an
# example playbook to bootstrap this script in the examples/ dir which
# installs ansible and sets it up to run on cron.
@ -27,14 +28,14 @@
# 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
# location underneath the workdir and then searches the source 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.
# the source repo must contain at least one of these playbooks.
import os
import shutil
@ -42,11 +43,13 @@ import subprocess
import sys
import datetime
import socket
from optparse import OptionParser
from ansible import utils
DEFAULT_REPO_TYPE = 'git'
DEFAULT_PLAYBOOK = 'local.yml'
PLAYBOOK_ERRORS = { 1: 'File does not exist',
2: 'File is not readable' }
PLAYBOOK_ERRORS = {1: 'File does not exist',
2: 'File is not readable'}
def _run(cmd):
print >>sys.stderr, "Running: '%s'" % cmd
@ -56,7 +59,8 @@ def _run(cmd):
print out
if cmd.returncode != 0:
print >>sys.stderr, err
return cmd.returncode
return cmd.returncode, out
def try_playbook(path):
if not os.path.exists(path):
@ -65,6 +69,7 @@ def try_playbook(path):
return 2
return 0
def select_playbook(path, args):
playbook = None
if len(args) > 0 and args[0] is not None:
@ -89,37 +94,62 @@ def select_playbook(path, args):
print >>sys.stderr, "\n".join(errors)
return playbook
def main(args):
""" Set up and run a local playbook """
usage = "%prog [options] [playbook.yml]"
parser = OptionParser(usage=usage)
parser = utils.SortedOptParser(usage=usage)
parser.add_option('--purge', default=False, action='store_true',
help='Purge git checkout after playbook run')
help='purge checkout after playbook run')
parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
help='only run the playbook if the repository has been updated')
parser.add_option('-d', '--directory', dest='dest', default=None,
help='Directory to clone git repository to')
help='directory to checkout repository to')
parser.add_option('-U', '--url', dest='url', default=None,
help='URL of git repository')
help='URL of the playbook repository')
parser.add_option('-C', '--checkout', dest='checkout',
default="HEAD",
help='Branch/Tag/Commit to checkout. Defaults to HEAD.')
help='branch/tag/commit to checkout. '
'Defaults to behavior of repository module.')
parser.add_option('-i', '--inventory-file', dest='inventory',
help="location of the inventory host file")
parser.add_option('-m', '--module-name', dest='module_name',
default=DEFAULT_REPO_TYPE,
help='Module name used to check out repository. '
'Default is %s.' % DEFAULT_REPO_TYPE)
options, args = parser.parse_args(args)
if not options.dest:
parser.error("Missing required directory argument")
return 1
options.dest = os.path.abspath(options.dest)
if not options.url:
parser.error("URL for git repo not specified, use -h for help")
parser.error("URL for repository not specified, use -h for help")
return 1
now = datetime.datetime.now()
print >>sys.stderr, now.strftime("Starting ansible-pull at %F %T")
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
rc = _run(cmd)
inv_opts = 'localhost,'
limit_opts = 'localhost:%s:127.0.0.1' % socket.getfqdn()
base_opts = '-c local --limit "%s"' % limit_opts
repo_opts = "name=%s dest=%s" % (options.url, options.dest)
if options.checkout:
repo_opts += ' version=%s' % options.checkout
path = utils.plugins.module_finder.find_plugin(options.module_name)
if path is None:
sys.stderr.write("module '%s' not found.\n" % options.module_name)
return 1
cmd = 'ansible all -i "%s" %s -m %s -a "%s"' % (
inv_opts, base_opts, options.module_name, repo_opts
)
rc, out = _run(cmd)
if rc != 0:
return rc
elif options.ifchanged and '"changed": true' not in out:
print "Repository has not changed, quitting."
return 0
playbook = select_playbook(options.dest, args)
@ -127,9 +157,11 @@ def main(args):
print >>sys.stderr, "Could not find a playbook to run."
return 1
cmd = 'ansible-playbook -c local %s' % playbook
cmd = 'ansible-playbook %s %s' % (base_opts, playbook)
if options.inventory:
cmd += ' -i "%s"' % options.inventory
os.chdir(options.dest)
rc = _run(cmd)
rc, out = _run(cmd)
if options.purge:
os.chdir('/')

View File

@ -1,83 +0,0 @@
Ansible Resources
=================
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 pull request!
Ansible Modules
===============
Ansible modules are a way of adding new client-side logic to ansible. They can be written in any language.
* [Official "core" ansible modules](http://ansible.cc/docs/modules.html) - various
* [mercurial](https://github.com/bradobro/ansible-module-mercurial) - bradobro
* [zypper (bash module example)](https://github.com/jpmens/ansible-zypp) - jp_mens
* [homebrew](https://gist.github.com/3170079) - swehack
* [network_facts](https://github.com/dagwieers/ansible-network-facts) - dagwieers
* [vsphere_boot](https://github.com/dagwieers/ansible-vsphere-boot) - dagwieers
Python modules using 0.6 and later can use the common "AnsibleModule" class to dramatically reduce
the amount of boilerplate code required. Not all modules above yet 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-contrib/tree/master/playbooks/hadoop_jkleint) - jkleint
* [LAMP](https://github.com/fourkitchens/server-playbooks) - [Four Kitchens](http://fourkitchens.com)
* [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
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
Blogs & 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
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.

View File

@ -0,0 +1,66 @@
'\" t
.\" Title: ansible-doc
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 09/19/2013
.\" Manual: System administration commands
.\" Source: Ansible 1.3.2
.\" Language: English
.\"
.TH "ANSIBLE\-DOC" "1" "09/19/2013" "Ansible 1\&.3\&.2" "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 '
.\" -----------------------------------------------------------------
.\" * 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), \fBansible\-pull\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

@ -1,13 +1,22 @@
'\" t
.\" Title: ansible-playbook
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 10/12/2012
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 09/19/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.8
.\" Source: Ansible 1.3.2
.\" Language: English
.\"
.TH "ANSIBLE\-PLAYBOOK" "1" "10/12/2012" "Ansible 0\&.8" "System administration commands"
.TH "ANSIBLE\-PLAYBOOK" "1" "09/19/2013" "Ansible 1\&.3\&.2" "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 '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -51,13 +60,13 @@ to the inventory hosts file, which defaults to
.RS 4
The
\fIDIRECTORY\fR
to load modules from\&. The default is
\fI/usr/share/ansible\fR\&.
search path to load modules from\&. The default is
\fI/usr/share/ansible\fR\&. This can also be set with the ANSIBLE_LIBRARY environment variable\&.
.RE
.PP
\fB\-e\fR \fIVARS\fR, \fB\-\-extra\-vars=\fR\fIVARS\fR
.RS 4
Extra variables to inject into a playbook, in key=value key=value format\&.
Extra variables to inject into a playbook, in key=value key=value format or as quoted JSON (hashes and arrays)\&.
.RE
.PP
\fB\-f\fR \fINUM\fR, \fB\-\-forks=\fR\fINUM\fR
@ -82,6 +91,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
@ -126,9 +155,9 @@ ANSIBLE_LIBRARY \(em Override the default ansible module library path
.sp
/usr/share/ansible/ \(em Default module library
.sp
/etc/ansible/ansible\&.conf \(em Config file, used if present
/etc/ansible/ansible\&.cfg \(em Config file, used if present
.sp
~/\&.ansible\&.config \(em User config file, overrides the default config if present
~/\&.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\&.
@ -139,6 +168,6 @@ Copyright \(co 2012, Michael DeHaan
Ansible is released under the terms of the GPLv3 License\&.
.SH "SEE ALSO"
.sp
\fBansible\fR(1), \fBansible\-pull\fR(1)
\fBansible\fR(1), \fBansible\-pull\fR(1), \fBansible\-doc\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

@ -47,11 +47,14 @@ The 'PATH' to the inventory hosts file, which defaults to
*-M* 'DIRECTORY', *--module-path=*'DIRECTORY'::
The 'DIRECTORY' to load modules from. The default is '/usr/share/ansible'.
The 'DIRECTORY' search path to load modules from. The default is
'/usr/share/ansible'. This can also be set with the ANSIBLE_LIBRARY
environment variable.
*-e* 'VARS', *--extra-vars=*'VARS'::
Extra variables to inject into a playbook, in key=value key=value format.
Extra variables to inject into a playbook, in key=value key=value format or
as quoted JSON (hashes and arrays).
*-f* 'NUM', *--forks=*'NUM'::
@ -73,6 +76,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'.
@ -114,9 +136,9 @@ FILES
/usr/share/ansible/ -- Default module library
/etc/ansible/ansible.conf -- Config file, used if present
/etc/ansible/ansible.cfg -- Config file, used if present
~/.ansible.config -- User config file, overrides the default config if present
~/.ansible.cfg -- User config file, overrides the default config if present
AUTHOR
------
@ -136,7 +158,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,13 +1,22 @@
'\" t
.\" Title: ansible
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 09/06/2012
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 09/19/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.8
.\" Source: Ansible 1.3.2
.\" Language: English
.\"
.TH "ANSIBLE" "1" "09/06/2012" "Ansible 0\&.8" "System administration commands"
.TH "ANSIBLE" "1" "09/19/2013" "Ansible 1\&.3\&.2" "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 '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -22,32 +31,55 @@
ansible-pull \- set up a remote copy of ansible on each managed node
.SH "SYNOPSIS"
.sp
ansible \-d DEST \-U URL [ \-C CHECKOUT ]
ansible \-d DEST \-U URL [options] [ <filename\&.yml> ]
.SH "DESCRIPTION"
.sp
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \'remote things\' over SSH\&.
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq 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\&.
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 a source repository\&. This inverts the default \fBpush\fR architecture of ansible into a \fBpull\fR architecture, which has near\-limitless scaling potential\&.
.sp
The setup playbook can be tuned to change the cron frequency, logging locations, and parameters to ansible\-pull\&.
.sp
This is useful both for extreme scale\-out as well as periodic remediation\&. Usage of the \fIfetch\fR module to retrieve logs from ansible\-pull runs would be an excellent way to gather and analyze remote logs from ansible\-pull\&.
.SH "OPTIONAL ARGUMENT"
.PP
\fBfilename\&.yml\fR
.RS 4
The name of one the YAML format files to run as an ansible playbook\&. This can be a relative path within the checkout\&. If not provided, ansible\-pull will look for a playbook based on the host\(cqs fully\-qualified domain name and finally a playbook named
\fBlocal\&.yml\fR\&.
.RE
.SH "OPTIONS"
.PP
\fB\-d\fR \fIDEST\fR, \fB\-\-directory=\fR\fIDEST\fR
.RS 4
Directory to checkout git repository into\&.
Directory to checkout repository into\&.
.RE
.PP
\fB\-U\fR \fIURL\fR, \fB\-\-url=\fR\fIURL\fR
.RS 4
URL of git repository to clone\&.
URL of the playbook repository to checkout\&.
.RE
.PP
\fB\-C\fR \fICHECKOUT\fR, \fB\-\-checkout=\fR\fICHECKOUT\fR
.RS 4
Branch/Tag/Commit to checkout\&. Defaults to
\fIHEAD\fR\&.
Branch/Tag/Commit to checkout\&. If not provided, uses default behavior of module used to check out playbook repository\&.
.RE
.PP
\fB\-i\fR \fIPATH\fR, \fB\-\-inventory=\fR\fIPATH\fR
.RS 4
The
\fIPATH\fR
to the inventory hosts file\&. This can be a relative path within the checkout\&.
.RE
.PP
\fB\-\-purge\fR
.RS 4
Purge the checkout after the playbook is run\&.
.RE
.PP
\fB\-m\fR \fINAME\fR, \fB\-\-module\-name=\fR\fINAME\fR
.RS 4
Module used to checkout playbook repository\&. Defaults to git\&.
.RE
.SH "AUTHOR"
.sp
@ -59,6 +91,6 @@ Copyright \(co 2012, Michael DeHaan
Ansible is released under the terms of the GPLv3 License\&.
.SH "SEE ALSO"
.sp
\fBansible\fR(1), \fBansible\-playbook\fR(1)
\fBansible\fR(1), \fBansible\-playbook\fR(1), \fBansible\-doc\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

@ -12,7 +12,7 @@ ansible-pull - set up a remote copy of ansible on each managed node
SYNOPSIS
--------
ansible -d DEST -U URL [ -C CHECKOUT ]
ansible -d DEST -U URL [options] [ <filename.yml> ]
DESCRIPTION
@ -23,8 +23,9 @@ SSH.
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 *push* architecture of ansible into a
*pull* architecture, which has near-limitless scaling potential.
a source repository. This inverts the default *push* architecture of
ansible into a *pull* architecture, which has near-limitless scaling
potential.
The setup playbook can be tuned to change the cron frequency, logging
locations, and parameters to ansible-pull.
@ -35,21 +36,45 @@ ansible-pull runs would be an excellent way to gather and analyze
remote logs from ansible-pull.
OPTIONAL ARGUMENT
-----------------
*filename.yml*::
The name of one the YAML format files to run as an ansible playbook. This can
be a relative path within the checkout. If not provided, ansible-pull
will look for a playbook based on the host's fully-qualified domain name and
finally a playbook named *local.yml*.
OPTIONS
-------
*-d* 'DEST', *--directory=*'DEST'::
Directory to checkout git repository into.
Directory to checkout repository into.
*-U* 'URL', *--url=*'URL'::
URL of git repository to clone.
URL of the playbook repository to checkout.
*-C* 'CHECKOUT', *--checkout=*'CHECKOUT'::
Branch/Tag/Commit to checkout. Defaults to 'HEAD'.
Branch/Tag/Commit to checkout. If not provided, uses default behavior
of module used to check out playbook repository.
*-i* 'PATH', *--inventory=*'PATH'::
The 'PATH' to the inventory hosts file. This can be a relative path within
the checkout.
*--purge*::
Purge the checkout after the playbook is run.
*-m* 'NAME', *--module-name=*'NAME'::
Module used to checkout playbook repository. Defaults to git.
AUTHOR
@ -70,7 +95,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

@ -1,13 +1,22 @@
'\" t
.\" Title: ansible
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 10/12/2012
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 09/19/2013
.\" Manual: System administration commands
.\" Source: Ansible 0.8
.\" Source: Ansible 1.3.2
.\" Language: English
.\"
.TH "ANSIBLE" "1" "10/12/2012" "Ansible 0\&.8" "System administration commands"
.TH "ANSIBLE" "1" "09/19/2013" "Ansible 1\&.3\&.2" "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 '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -25,7 +34,7 @@ ansible \- run a command somewhere else
ansible <host\-pattern> [\-f forks] [\-m module_name] [\-a args]
.SH "DESCRIPTION"
.sp
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \'remote things\' over SSH\&.
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq over SSH\&.
.SH "ARGUMENTS"
.PP
\fBhost\-pattern\fR
@ -69,11 +78,11 @@ Execute the module called
.RS 4
The
\fIDIRECTORY\fR
to load modules from\&. The default is
\fI/usr/share/ansible\fR\&.
search path to load modules from\&. The default is
\fI/usr/share/ansible\fR\&. This can also be set with the ANSIBLE_LIBRARY environment variable\&.
.RE
.PP
\fB\-a\fR \'\fIARGUMENTS\fR\', \fB\-\-args=\fR\'\fIARGUMENTS\fR\'
\fB\-a\fR \*(Aq\fIARGUMENTS\fR\*(Aq, \fB\-\-args=\fR\*(Aq\fIARGUMENTS\fR\*(Aq
.RS 4
The
\fIARGUMENTS\fR
@ -131,7 +140,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
@ -156,6 +165,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\&.
@ -167,9 +181,9 @@ Ranges of hosts are also supported\&. For more information and additional option
.sp
/usr/share/ansible/ \(em Default module library
.sp
/etc/ansible/ansible\&.conf \(em Config file, used if present
/etc/ansible/ansible\&.cfg \(em Config file, used if present
.sp
~/\&.ansible\&.config \(em User config file, overrides the default config if present
~/\&.ansible\&.cfg \(em User config file, overrides the default config if present
.SH "ENVIRONMENT"
.sp
The following environment variables may specified\&.
@ -177,6 +191,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\&.
@ -187,6 +203,6 @@ Copyright \(co 2012, Michael DeHaan
Ansible is released under the terms of the GPLv3 License\&.
.SH "SEE ALSO"
.sp
\fBansible\-playbook\fR(1), \fBansible\-pull\fR(1)
\fBansible\-playbook\fR(1), \fBansible\-pull\fR(1), \fBansible\-doc\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

@ -60,8 +60,9 @@ Execute the module called 'NAME'.
*-M* 'DIRECTORY', *--module-path=*'DIRECTORY'::
The 'DIRECTORY' to load modules from. The default is '/usr/share/ansible'.
The 'DIRECTORY' search path to load modules from. The default is
'/usr/share/ansible'. This can also be set with the ANSIBLE_LIBRARY
environment variable.
*-a* \'_ARGUMENTS_', *--args=*\'_ARGUMENTS_'::
@ -102,7 +103,7 @@ 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'::
@ -117,6 +118,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
---------
@ -135,9 +140,9 @@ FILES
/usr/share/ansible/ -- Default module library
/etc/ansible/ansible.conf -- Config file, used if present
/etc/ansible/ansible.cfg -- Config file, used if present
~/.ansible.config -- User config file, overrides the default config if present
~/.ansible.cfg -- User config file, overrides the default config if present
ENVIRONMENT
-----------
@ -148,6 +153,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 +174,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/>

View File

@ -1 +0,0 @@
../examples/DOCUMENTATION.yaml

View File

@ -1,23 +0,0 @@
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

@ -1,6 +1,6 @@
#!/usr/bin/make
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
FORMATTER=../hacking/module_formatter.py
FORMATTER=../../hacking/module_formatter.py
all: clean docs
@ -11,9 +11,10 @@ viewdocs: clean
./build-site.py view
htmldocs:
./build-site.py rst
./build-site.py rst
clean:
-rm -rf htmlout
-rm -f .buildinfo
-rm -f *.inv
-rm -rf *.doctrees
@ -25,7 +26,7 @@ clean:
.PHONEY: docs clean
modules: $(FORMATTER) ../hacking/templates/rst.j2
$(FORMATTER) -t rst --template-dir=../hacking/templates --module-dir=../library -o rst/modules/ --includes-file=rst/modules/_list.rst
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

29
docsite/latest/README.md Normal file
View File

@ -0,0 +1,29 @@
Homepage and documentation source for Ansible
=============================================
This project hosts the source behind [ansibleworks.com/docs](http://www.ansibleworks.com/docs/)
Contributions to the documentation are welcome. To make changes, submit a pull request
that changes the reStructuredText files in the "rst/" directory only, and Michael can
do a docs build and push the static files. If you wish to verify output from the markup
such as link references, you may [install Sphinx] and build the documentation by running
`make viewdocs` from the `ansible/docsite/latest` directory.
If you do not want to learn the reStructuredText format, you can also [file issues] about
documentation problems on the Ansible GitHub project.
Note that module documentation can actually be [generated from a DOCUMENTATION docstring][module-docs]
in the modules directory, so corrections to modules written as such need to be made
in the module source, rather than in docsite source.
Author
======
Michael DeHaan -- michael.dehaan@gmail.com
[http://michaeldehaan.net](http://michaeldehaan.net/)
[install Sphinx]: http://sphinx-doc.org/install.html
[file issues]: https://github.com/ansible/ansible/issues
[module-docs]: http://www.ansibleworks.com/docs/moduledev.html#documenting-your-module

View File

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

View File

@ -543,10 +543,12 @@ code, pre {
-moz-border-radius: 3px;
border-radius: 3px;
}
.module {
font-family: Monaco, Andale Mono, Courier New, monospace;
font-size: 12px;
}
code {
background-color: #fee9cc;
color: rgba(0, 0, 0, 0.75);
padding: 1px 3px;
}
pre {
background-color: #f5f5f5;

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 392 B

View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View File

@ -0,0 +1,49 @@
<?php
require('../wp-blog-header.php');
get_header();
?>
<div class="row">
<div class="container">
<?php if (function_exists('bootstrapwp_breadcrumbs')) bootstrapwp_breadcrumbs(); ?>
</div><!--/.container -->
</div><!--/.row -->
{% macro navBar() %}
<div id="left-sidebar" class="span3 sidebar">
<div class="side-nav sidebar-block left-side-nav">
<ul><li><a href="/docs/"><strong>Documentation Home</strong></a></li></ul>
{% if title == "Ansible Documentation Index" %}
{{ toctree(maxdepth=1) }}
{% else %}
{{ toc }}
{% endif %}
<hr />
<div class="qsButton pagination-centered" />
<a href="/quickstart"><button class="btn btn-primary" type="button">Quick Start Video</button></a>
</div>
</div>
</div>
{% endmacro %}
{# Silence the sidebar's, relbar's #}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{%- block content %}
<div class="container doc-content">
<div class="row clear-both">
<!-- BEGIN LEFT-SIDEBAR -->
{% block header %}{{ navBar() }}{% endblock %}
<!-- END LEFT-SIDEBAR -->
<!-- BEGIN ARTICLE CONTENT AREA -->
<div class="span8 main-column two-columns-left">
{% block body %} {% endblock %}
</div><!-- END ARTICLE CONTENT AREA -->
</div> <!-- class=row -->
</div> <!-- class=container -->
{%- endblock %}
<?php get_footer('home'); ?>

View File

@ -1,13 +1,13 @@
{% 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'] + css_files %}
{% 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>
<!-- <a class="brand" href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a> -->
<ul class="nav">
{% block sidebartoc %}
<li><a href="/">Home</A>
@ -97,6 +97,20 @@
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 %}
@ -120,6 +134,8 @@ s.parentNode.insertBefore(ga, s);
{%- 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') %}
@ -133,6 +149,7 @@ s.parentNode.insertBefore(ga, s);
{%- endif %}
</p>
</div>
</center>
</footer>
{%- endblock %}

View File

@ -1,5 +1,5 @@
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">{{ _('Page') }}</a>
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

@ -543,10 +543,12 @@ code, pre {
-moz-border-radius: 3px;
border-radius: 3px;
}
.module {
font-family: Monaco, Andale Mono, Courier New, monospace;
font-size: 12px;
}
code {
background-color: #fee9cc;
color: rgba(0, 0, 0, 0.75);
padding: 1px 3px;
}
pre {
background-color: #f5f5f5;

View File

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

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

View File

@ -21,7 +21,13 @@ __docformat__ = 'restructuredtext'
import os
import sys
import traceback
from sphinx.application import Sphinx
try:
from sphinx.application import Sphinx
except ImportError:
print "#################################"
print "Dependency missing: Python Sphinx"
print "#################################"
sys.exit(1)
import os
@ -39,7 +45,7 @@ class SphinxBuilder(object):
try:
buildername = 'html'
outdir = os.path.abspath(os.getcwd())
outdir = os.path.abspath(os.path.join(os.getcwd(), "htmlout"))
# Create the output directory if it doesn't exist
if not os.access(outdir, os.F_OK):
os.mkdir(outdir)

View File

@ -25,7 +25,7 @@ sys.path.insert(0, os.path.join('ansible', 'lib'))
sys.path.append(os.path.abspath('_themes'))
VERSION='0.01'
AUTHOR='Michael DeHaan'
AUTHOR='AnsibleWorks'
# General configuration
@ -50,8 +50,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General substitutions.
project = 'Ansible Documentation'
copyright = "2012 Michael DeHaan"
project = 'Ansible 1.2 Documentation'
copyright = "2013 AnsibleWorks"
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
@ -101,7 +101,7 @@ pygments_style = 'sphinx'
# -----------------------
html_theme_path = ['_themes']
html_theme = 'bootstrap'
html_theme = 'aworks'
html_short_title = 'Ansible Documentation'
# The style sheet to use for HTML and HTML Help pages. A file of that name
@ -111,7 +111,7 @@ 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'
html_title = 'Ansible 1.2 Documentation'
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
@ -123,7 +123,7 @@ html_title = 'Ansible Documentation'
# 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'
#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,
@ -182,7 +182,7 @@ htmlhelp_basename = 'Poseidodoc'
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
('index', 'ansible.tex', 'Ansible Documentation',
('index', 'ansible.tex', 'Ansible 1.2 Documentation',
AUTHOR, 'manual'),
]

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -0,0 +1,106 @@
angular.module('ansibleApp', []).filter('moduleVersion', function() {
return function(modules, version) {
var parseVersionString = function (str) {
if (typeof(str) != 'string') { return false; }
var x = str.split('.');
// parse from string or default to 0 if can't parse
var maj = parseInt(x[0]) || 0;
var min = parseInt(x[1]) || 0;
var pat = parseInt(x[2]) || 0;
return {
major: maj,
minor: min,
patch: pat
}
}
var vMinMet = function(vmin, vcurrent) {
minimum = parseVersionString(vmin);
running = parseVersionString(vcurrent);
if (running.major != minimum.major)
return (running.major > minimum.major);
else {
if (running.minor != minimum.minor)
return (running.minor > minimum.minor);
else {
if (running.patch != minimum.patch)
return (running.patch > minimum.patch);
else
return true;
}
}
};
var result = [];
if (!version) {
return modules;
}
for (var i = 0; i < modules.length; i++) {
if (vMinMet(modules[i].version_added, version)) {
result[result.length] = modules[i];
}
}
return result;
};
}).filter('uniqueVersion', function() {
return function(modules) {
var result = [];
var inArray = function (needle, haystack) {
var length = haystack.length;
for(var i = 0; i < length; i++) {
if(haystack[i] == needle) return true;
}
return false;
}
var parseVersionString = function (str) {
if (typeof(str) != 'string') { return false; }
var x = str.split('.');
// parse from string or default to 0 if can't parse
var maj = parseInt(x[0]) || 0;
var min = parseInt(x[1]) || 0;
var pat = parseInt(x[2]) || 0;
return {
major: maj,
minor: min,
patch: pat
}
}
for (var i = 0; i < modules.length; i++) {
if (!inArray(modules[i].version_added, result)) {
// Some module do not define version
if (modules[i].version_added) {
result[result.length] = "" + modules[i].version_added;
}
}
}
result.sort(
function (a, b) {
ao = parseVersionString(a);
bo = parseVersionString(b);
if (ao.major == bo.major) {
if (ao.minor == bo.minor) {
if (ao.patch == bo.patch) {
return 0;
}
else {
return (ao.patch > bo.patch) ? 1 : -1;
}
}
else {
return (ao.minor > bo.minor) ? 1 : -1;
}
}
else {
return (ao.major > bo.major) ? 1 : -1;
}
});
return result;
};
});

View File

@ -0,0 +1,5 @@
function AnsibleModules($scope) {
$scope.modules = [];
$scope.orderProp = "module";
}

View File

@ -4,9 +4,9 @@ YAML Syntax
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.
We use YAML because it is easier for humans to read and write than other common
data formats like XML or JSON. Further, there are libraries available in most
programming languages for working with YAML.
You may also wish to read :doc:`playbooks` at the same time to see how this
is used in practice.
@ -15,14 +15,14 @@ is used in practice.
YAML Basics
-----------
For `ansible`, nearly every YAML file starts with a list.
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".
Ansible or not) should begin with ``---``. This is part of the YAML
format and indicates the start of a document.
All members of a list are lines beginning at the same indentation level starting
with a ``-`` (dash) character::
@ -38,7 +38,7 @@ A dictionary is represented in a simple ``key:`` and ``value`` form::
---
# An employee record
name: John Eckersberg
name: Example Developer
job: Developer
skill: Elite
@ -46,7 +46,7 @@ Dictionaries can also be represented in an abbreviated form if you really want t
---
# An employee record
{name: John Eckersberg, job: Developer, skill: Elite}
{name: Example Developer, job: Developer, skill: Elite}
.. _truthiness:
@ -54,16 +54,18 @@ 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
Let's combine what we learned so far in an arbitrary YAML example. This really
has nothing to do with Ansible, but will give you a feel for the format::
---
# An employee record
name: John Eckersberg
name: Example Developer
job: Developer
skill: Elite
employed: True
@ -74,12 +76,31 @@ has nothing to do with Ansible, but will give you a feel for the format::
- Mango
languages:
ruby: Elite
python: Elite
dotnet: Lame
python: Elite
dotnet: Lame
That's all you really need to know about YAML to get started writing
That's all you really need to know about YAML to start writing
`Ansible` playbooks.
Gotchas
-------
While YAML is generally friendly, the following is going to result in 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.
Further, Ansible uses "{{ var }}" for variables. If a value after a colon starts
with a "{", YAML will think it is a dictionary, so you must quote it, like so::
foo: "{{ variable }}"
.. seealso::
:doc:`playbooks`

View File

@ -0,0 +1,158 @@
Amazon Web Services
===================
.. contents::
:depth: 2
Introduction
````````````
Ansible contains a number of core modules for interacting with Amazon Web Services (AWS) and other API compatible private clouds, such as Eucalyptus. (There are other supported cloud systems, but this documentation is about AWS ones). This page illustrates some use cases for provisioning and managing hosts EC2 resources.
Requirements for the AWS modules are minimal. All of the modules require and are tested against boto 2.5 or higher. You'll need this Python module installed on the execution host. If you are using Red Hat Enterprise Linux or CentOS, install boto from `EPEL <http://fedoraproject.org/wiki/EPEL>`_:
.. code-block:: bash
$ yum install python-boto
Provisioning
````````````
The ec2 module provides the ability to provision instance(s) within EC2. Typically the provisioning task will be performed against your Ansible master server as a local_action.
.. note::
Authentication with the AWS-related modules is handled by either
specifying your access and secret key as ENV variables or passing
them as module arguments.
.. note::
To talk to specific endpoints, the environmental variable EC2_URL
can be set. This is useful if using a private cloud like Eucalyptus,
exporting the variable as EC2_URL=https://myhost:8773/services/Eucalyptus.
This can be set using the 'environment' keyword in Ansible if you like.
Provisioning a number of instances in ad-hoc mode mode:
.. code-block:: bash
# ansible localhost -m ec2 -a "image=ami-6e649707 instance_type=m1.large keypair=mykey group=webservers wait=yes"
In a play, this might look like (assuming the parameters are held as vars)::
tasks:
- name: Provision a set of instances
local_action: ec2 keypair={{mykeypair}} group={{security_group}} instance_type={{instance_type}} image={{image}} wait=true count={{number}}
register: ec2
By registering the return its then possible to dynamically create a host group consisting of these new instances. This facilitates performing configuration actions on the hosts immediately in a subsequent play::
tasks:
- name: Add all instance public IPs to host group
local_action: add_host hostname={{ item.public_ip }} groupname=ec2hosts
with_items: ec2.instances
With the host group now created, the second play in your provision playbook might now have some configuration steps::
- name: Configuration play
hosts: ec2hosts
user: ec2-user
gather_facts: true
tasks:
- name: Check NTP service
action: service name=ntpd state=started
The method above ties the configuration of a host with the provisioning step. This isn't always ideal and leads us onto the next section.
Advanced Usage
``````````````
Host Inventory
++++++++++++++
Once your nodes are spun up, you'll probably want to talk to them again. The best way to handle his is to use the ec2 inventory plugin.
Even for larger environments, you might have nodes spun up from Cloud Formations or other tooling. You don't have to use Ansible to spin up guests. Once these are created and you wish to configure them, the EC2 API can be used to return system grouping with the help of the EC2 inventory script. This script can be used to group resources by their security group or tags. Tagging is highly recommended in EC2 and can provide an easy way to sort between host groups and roles. The inventory script is documented `in the API chapter <http://www.ansibleworks.com/docs/api.html#external-inventory-scripts>`_.
You may wish to schedule a regular refresh of the inventory cache to accommodate for frequent changes in resources:
.. code-block:: bash
# ./ec2.py --refresh-cache
Put this into a crontab as appropriate to make calls from your Ansible master server to the EC2 API endpoints and gather host information. The aim is to keep the view of hosts as up-to-date as possible, so schedule accordingly. Playbook calls could then also be scheduled to act on the refreshed hosts inventory after each refresh. This approach means that machine images can remain "raw", containing no payload and OS-only. Configuration of the workload is handled entirely by Ansible.
Pull Configuration
++++++++++++++++++
For some the delay between refreshing host information and acting on that host information (i.e. running Ansible tasks against the hosts) may be too long. This may be the case in such scenarios where EC2 AutoScaling is being used to scale the number of instances as a result of a particular event. Such an event may require that hosts come online and are configured as soon as possible (even a 1 minute delay may be undesirable). Its possible to pre-bake machine images which contain the necessary ansible-pull script and components to pull and run a playbook via git. The machine images could be configured to run ansible-pull upon boot as part of the bootstrapping procedure.
More information on pull-mode playbooks can be found `here <http://www.ansibleworks.com/docs/playbooks2.html#pull-mode-playbooks>`_.
(Various developments around Ansible are also going to make this easier in the near future. Stay tuned!)
Use Cases
`````````
This section covers some usage examples built around a specific use case.
Example 1
+++++++++
Example 1: I'm using CloudFormation to deploy a specific infrastructure stack. I'd like to manage configuration of the instances with Ansible.
Provision instances with your tool of choice and consider using the inventory plugin to group hosts based on particular tags or security group. Consider tagging instances you wish to managed with Ansible with a suitably unique key=value tag.
Example 2
+++++++++
Example 2: I'm using AutoScaling to dynamically scale up and scale down the number of instances. This means the number of hosts is constantly fluctuating but I'm letting EC2 automatically handle the provisioning of these instances. I don't want to fully bake a machine image, I'd like to use Ansible to configure the hosts.
There are two approaches to this use case. The first is to use the inventory plugin to regularly refresh host information and then target hosts based on the latest inventory data. The second is to use ansible-pull triggered by a user-data script (specified in the launch configuration) which would then mean that each instance would fetch Ansible and the latest playbook from a git repository and run locally to configure itself.
Example 3
+++++++++
Example 3: I don't want to use Ansible to manage my instances but I'd like to consider using Ansible to build my fully-baked machine images.
There's nothing to stop you doing this. If you like working with Ansible's playbook format then writing a playbook to create an image; create an image file with dd, give it a filesystem and then install packages and finally chroot into it for further configuration. Ansible has the 'chroot' plugin for this purpose, just add the following to your inventory file::
/chroot/path ansible_connection=chroot
And in your playbook::
hosts: /chroot/path
Pending Information
```````````````````
In the future look here for more topics.
Using Ansible's S3 module
+++++++++++++++++++++++++
these modules are documented on the module page, more walk throughs coming soon
Using Ansible's Elastic Load Balancer Support
+++++++++++++++++++++++++++++++++++++++++++++
these modules are documented on the module page, more walk throughs coming soon
Using Ansible's Cloud Formation Module
++++++++++++++++++++++++++++++++++++++
these modules are documented on the module page, more walk throughs coming soon
.. 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

View File

@ -8,13 +8,12 @@ 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.
are implemented.
It's pretty simple::
@ -35,7 +34,7 @@ expressed in the 'ansible-modules' documentation.::
{
"dark" : {
"web1.example.com" : "failure message"
}
},
"contacted" : {
"web2.example.com" : 1
}
@ -82,8 +81,8 @@ 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 Repository
------------------
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.
@ -91,7 +90,7 @@ 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>`_,
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.
@ -100,24 +99,74 @@ It's possible to write an external inventory script in any language. If you are
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, with a list of each host/IP as the value for each hash/dictionary element, like so::
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' : [ 'host1.example.com', 'host2.example.com' ],
'webservers' : [ 'host2.example.com', 'host3.example.com' ],
'atlanta' : [ 'host1.example.com', 'host4.example.com', 'host5.example.com' ]
"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 list of key/value variables to make available to templates or playbooks. Returning variables is optional,
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'
"favcolor" : "red",
"ntpserver" : "wolf.example.com",
"monitoring" : "pack.example.com"
}
Tuning the External Inventory Script
````````````````````````````````````
.. versionadded:: 1.3
The stock inventory script system detailed above works for all versions of Ansible, but calling
'--host' for every host can be rather expensive, especially if it involves expensive API calls to
a remote subsystemm. In Ansible
1.3 or later, if the inventory script returns a top level element called "_meta", it is possible
to return all of the host variables in one inventory script call. When this meta element contains
a value for "hostvars", the inventory script will not be invoked with "--host" for each host. This
results in a significant performance increase for large numbers of hosts, and also makes client
side caching easier to implement for the inventory script.
The data to be added to the top level JSON dictionary looks like this::
{
# results of inventory script as above go here
# ...
"_meta" : {
"hostvars" : {
"moocow.example.com" : { "asdf" : 1234 },
"llama.example.com" : { "asdf" : 5678 },
}
}
}
Example: The Cobbler External Inventory Script
``````````````````````````````````````````````
@ -183,7 +232,7 @@ You can use this script in one of two ways. The easiest is to use Ansible's ``-i
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`` file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally.
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:
@ -192,8 +241,8 @@ To successfully make an API call to AWS, you will need to configure Boto (the Py
You can test the script by itself to make sure your config is correct
cd examples/scripts
./ec2_external_inventory.py --list
cd plugins/inventory
./ec2.py --list
After a few moments, you should see your entire EC2 inventory across all regions in JSON.
@ -207,7 +256,7 @@ Instance ID
These are groups of one since instance IDs are unique.
e.g.
``i-00112233``
``i-a1b1c1d1``
``i-a1b1c1d1``
Region
A group of all instances in an AWS region.
@ -276,13 +325,14 @@ Both ``ec2_security_group_ids`` and ``ec2_security_group_names`` are comma-separ
To see the complete list of variables available for an instance, run the script by itself::
cd examples/scripts
./ec2_external_inventory.py --host ec2-12-12-12-12.compute-1.amazonaws.com
cd plugins/inventory
./ec2.py --host ec2-12-12-12-12.compute-1.amazonaws.com
Example: OpenStack
``````````````````
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.
Though not detailed here in as much depth as the EC2 module, there's also a OpenStack Compute external inventory source in the plugins directory. It requires the Grizzly release of OpenStack or
later. See the inline comments in the module source for how to use it.
Callback Plugins
----------------
@ -293,11 +343,48 @@ system, or even (yes, really) making sound effects. Some examples are contained
Connection Type Plugins
-----------------------
By default, ansible ships with a 'paramiko' SSH, native ssh (just called 'ssh'), and 'local' connection type, which can be used
By default, ansible ships with a 'paramiko' SSH, native ssh (just called 'ssh'), and 'local' connection type, and 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.
directory. The value of 'smart' for a connection allows selection of paramiko or openssh based on system capabilities, and chooses
'ssh' if OpenSSH supports ControlPersist, in Ansible 1.2.1 an later. Previous versions did not support 'smart'.
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::

View File

@ -0,0 +1,358 @@
Best Practices
==============
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>`_. (NOTE: These may not use all of the features in the latest release just yet).
.. contents::
:depth: 2
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.
(One thing you will definitely want to do though, is use the "roles" organization feature, which is documented as part
of the main playbooks page)
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
roles/
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
foo.sh # <-- script files for use with the script resource
vars/ #
main.yml # <-- variables associated with this role
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 its own NTP servers, so when setting 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
Role Variables
``````````````
Variables that are associated with a given role can be defined in a main.yml file within the "vars" directory for that role. These variables are accessible not only to the role itself, but to all other roles and tasks that are part of the same playbook.::
---
# file: roles/python/vars/main.yml
python_version: "2.7.5"
pip_version: "1.3.1"
Top Level Playbooks Are Separated 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
roles:
- common
- webtier
Task And Handler Organization For A Role
````````````````````````````````````````
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: roles/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=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: roles/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 to know (at least in 1.1 and higher)::
# 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 separate playbooks from the app deployment.
Stage vs Production
+++++++++++++++++++
As also mentioned above, a good way to keep your stage (or testing) and production environments separate is to use a separate inventory file for stage and production. This way you pick with -i what you are targeting. 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 its 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 will 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 that are 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

View File

@ -0,0 +1,109 @@
Ansible Resources
=================
User contributed playbooks, modules, and articles. This is a small
curated list, but growing. Everyone is encouraged to add to this
document, just `edit it on Github <https://github.com/ansible/ansible/blob/devel/docsite/latest/rst/contrib.rst>`_
and send a pull request!
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://www.ansibleworks.com/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
- `apk-tools <http://git.alpinelinux.org/cgit/bpiotrowski/ansible-apk>`_ - Bartłomiej Piotrowski
All python modules (especially all submitted to core) 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://www.ansibleworks.com/docs/playbooks.html>`_ are Ansible's
configuration management language. It should be easy to write your own
from scratch for most applications (we keep the language simple for EXACTLY that reason), but it can
be helpful to look at what others have done for reference and see what is possible.
The ansible-examples repo on github contains some examples of best-practices Ansible content deploying some
full stack workloads:
- `Ansible-Examples <http://github.com/ansible/ansible-examples>`_
And here are some other community-developed playbooks. Feel free to submit a pull request to the docs
to add your own.
- `edX Online <https://github.com/edx/configuration>`_ - `edX Online <http://edx.org>`_
- `Fedora Infrastructure <http://infrastructure.fedoraproject.org/cgit/ansible.git/tree/>`_ - `Fedora <http://fedoraproject.org>`_
- `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
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>`_
- `Various modules, plugins, and scripts <https://github.com/ginsys/ansible-plugins>`_ sergevanginderachter
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
Ansible, always consult `ansibleworks.com <http://www.ansibleworks.com/>`_ and in
particular see `Best Practices <http://www.ansibleworks.com/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.

View File

@ -12,7 +12,6 @@ using `/usr/bin/ansible-playbook` -- the concepts port over directly.
.. contents::
:depth: 2
:backlinks: top
Parallelism and Shell Commands
@ -22,7 +21,7 @@ Let's use ansible's command line tool to reboot all web servers in Atlanta, 10 a
set up SSH-agent so it can remember our credentials::
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa.pub
$ 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
@ -121,22 +120,23 @@ with yum.
Ensure a package is installed, but don't update it::
$ ansible webservers -m yum -a "pkg=acme state=installed"
$ ansible webservers -m yum -a "name=acme state=installed"
Ensure a package is installed to a specific version::
$ ansible webservers -m yum -a "pkg=acme-1.5 state=installed"
$ ansible webservers -m yum -a "name=acme-1.5 state=installed"
Ensure a package is at the latest version::
$ ansible webservers -m yum -a "pkg=acme state=latest"
$ ansible webservers -m yum -a "name=acme state=latest"
Ensure a package is not installed::
$ ansible webservers -m yum -a "pkg=acme state=removed"
$ 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
Ansible has modules for managing packages under many platforms. If your package manager
does not have a module available for it, you can install
for other packages using the command module or (better!) contribute a module
for other package managers. Stop by the mailing list for info/details.
Users and Groups
@ -209,6 +209,17 @@ 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.
Gathering Facts
```````````````
Facts are described in the playbooks section and represent discovered variables about a
system. These can be used to implement conditional execution of tasks but also just to get ad-hoc information about your system. You can see all facts via::
$ ansible all -m setup
Its also possible to filter this output to just export certain facts, see the "setup" module documentation for details.
Limiting Selected Hosts
```````````````````````
@ -226,6 +237,8 @@ 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"
@ -245,8 +258,8 @@ Ansible has an optional configuration file that can be used to tune settings and
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``
2. ``~/.ansible.cfg``
3. ``ansible.cfg`` in the current working directory. (version 0.8 and up)
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.

176
docsite/latest/rst/faq.rst Normal file
View File

@ -0,0 +1,176 @@
Frequently Asked Questions
==========================
Here are some commonly-asked questions and their answers.
.. contents::
:depth: 2
How do I handle different machines needing different user accounts or ports to log in with?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Setting inventory variables in the inventory file is the easiest way.
For instance, suppose these hosts have different usernames and ports::
[webservers]
asdf.example.com ansible_ssh_port=5000 ansible_ssh_user=alice
jkl.example.com ansible_ssh_port=5001 ansible_ssh_user=bob
You can also dictate the connection type to be used, if you want::
[testcluster]
localhost ansible_connection=local
/path/to/chroot1 ansible_connection=chroot
foo.example.com
bar.example.com
You may also wish to keep these in group variables instead, or file in them in a group_vars/<groupname> file.
See the rest of the documentation for more information about how to organize variables.
How do I get ansible to reuse connections, enable Kerberized SSH, or have Ansible pay attention to my local SSH config file?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Switch your default connection type in the configuration file to 'ssh', or use '-c ssh' to use
Native OpenSSH for connections instead of the python paramiko library. In Ansible 1.2.1 and later, 'ssh' will be used
by default if OpenSSH is new enough to support ControlPersist as an option.
Paramiko is great for starting out, but the OpenSSH type offers many advanced options. You will want to run Ansible
from a machine new enough to support ControlPersist, if you are using this connection type. You can still manage
older clients. If you are using RHEL 6, CentOS 6, SLES 10 or SLES 11 the version of OpenSSH is still a bit old, so
consider managing from a Fedora or openSUSE client even though you are managing older nodes, or just use paramiko.
We keep paramiko as the default as if you are first installing Ansible on an EL box, it offers a better experience
for new users.
How do I speed up management inside EC2?
++++++++++++++++++++++++++++++++++++++++
Don't try to manage a fleet of EC2 machines from your laptop. Connect to a management node inside EC2 first
and run Ansible from there.
How do I handle python pathing not having a Python 2.X in /usr/bin/python on a remote machine?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
While you can write ansible modules in any language, most ansible modules are written in Python, and some of these
are important core ones.
By default Ansible assumes it can find a /usr/bin/python on your remote system that is a 2.X version of Python, specifically
2.4 or higher.
Setting of an inventory variable 'ansible_python_interpreter' on any host will allow Ansible to auto-replace the interpreter
used when executing python modules. Thus, you can point to any python you want on the system if /usr/bin/python on your
system does not point to a Python 2.X interpreter.
Some Linux operating systems, such as Arch, may only have Python 3 installed by default. This is not sufficient and you will
get syntax errors trying to run modules with Python 3. Python 3 is essentially not the same
language as Python 2. Ansible modules currently need to support older Pythons for users that still have Enterprise Linux 5 deployed, so they are not yet ported to run under Python 3.0. This is not a problem though as you can just install Python 2 also on a managed host.
Python 3.0 support will likely be addressed at a later point in time when usage becomes more mainstream.
Do not replace the shebang lines of your python modules. Ansible will do this for you automatically at deploy time.
What is the best way to make content reusable/redistributable?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If you have not done so already, read all about "Roles" in the playbooks documentation. This helps you make playbook content
self contained, and works will with things like git submodules for sharing content with others.
If some of these plugin types look strange to you, see the API documentation for more details about ways Ansible can be extended.
Where does the configuration file live and what can I configure in it?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Technically ansible doesn't need a configuration file, but OS packages are likely to include a default one in /etc/ansible/ansible.cfg
that you may customize. You can also install your own copy in ~/.ansible.cfg or keep a copy in a directory relative to your playbook named "ansible.cfg".
For what values you can use in this file, see `the configuration file on github <https://github.com/ansible/ansible/blob/devel/examples/ansible.cfg>`_.
Generally you would configure the default module path or connection type here, among other things, though the defaults are usually
good enough for starting out.
How do I disable cowsay?
++++++++++++++++++++++++
If cowsay is installed, Ansible takes it upon itself to make your day happier when running playbooks. If you decide
that you would like to work in a professional cow-free environment, you can either uninstall cowsay, or set an environment variable::
export ANSIBLE_NOCOWS=1
How do I see a list of all of the ansible\_ variables?
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ansible by default gathers "facts" about the machines under management, and these facts can be accessed in Playbooks and in templates. To see a list of all of the facts that are available about a machine, you can run the "setup" module as an ad-hoc action::
ansible -m setup hostname
This will print out a dictionary of all of the facts that are available for that particular host.
How do I loop over a list of hosts in a group, inside of a template?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A pretty common pattern is to iterate over a list of hosts inside of a host group, perhaps to populate a template configuration
file with a list of servers. To do this, you can just access the "$groups" dictionary in your template, like this::
{% for host in groups['db_servers'] %}
{{ host }}
{% endfor %}
If you need to access facts about these hosts, for instance, the IP address of each hostname, you need to make sure that the facts have been populated. For example, make sure you have a play that talks to db_servers::
- hosts: db_servers
tasks:
- # doesn't matter what you do, just that they were talked to previously.
Then you can use the facts inside your template, like this::
{% for host in groups['db_servers'] %}
{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}
{% endfor %}
How do I copy files recursively onto a target host?
+++++++++++++++++++++++++++++++++++++++++++++++++++
The "copy" module doesn't handle recursive copies of directories. A common solution to do this is to use a local action to call 'rsync' to recursively copy files to the managed servers.
Here is an example::
---
# ...
tasks:
- name: recursively copy files from management server to target
local_action: command rsync -a /path/to/files $inventory_hostname:/path/to/target/
Note that you'll need passphrase-less SSH or ssh-agent set up to let rsync copy without prompting for a passphase or password.
How do I access shell environment variables?
++++++++++++++++++++++++++++++++++++++++++++
If you just need to access existing variables, use the 'env' lookup plugin. For example, to access the value of the HOME
environment variable on management machine::
---
# ...
vars:
local_home: "{{ lookup('env','HOME') }}"
If you need to set environment variables, see the Advanced Playbooks section about environments.
Can I get training on Ansible or find commercial support?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yes! See `AnsibleWorks.com <http://ansibleworks.com>`_ or email `info@ansibleworks.com <mailto:info@ansibleworks.com>`_.
How do I submit a change to the documentation?
++++++++++++++++++++++++++++++++++++++++++++++
Great question! Documentation for Ansible is kept in the main project git repository, and complete instructions for contributing can be found in the docs README `viewable on GitHub <https://github.com/ansible/ansible/tree/devel/docsite/latest#readme>`_. Thanks!
I don't see my question here
++++++++++++++++++++++++++++
See the "Resources" section of the documentation for a link to the IRC and Google Group.

View File

@ -0,0 +1,383 @@
Getting Started
===============
.. contents::
:depth: 2
Requirements
````````````
Requirements for Ansible are extremely minimal.
For the central Ansible machine, you will need an environment with Python 2.6 or greater installed. If you are running Python 2.5 on an "Enterprise Linux 5" variant, we'll show you how to add 2.6 to your distribution, but most platforms already have a new enough Python. (Note that Windows is not supported as the Ansible control machine.)
You will also 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::
If you have SELinux enabled on remote nodes, you will also want to install
libselinux-python on them before using any copy/file/template related functions in
Ansible. You can of course still use the yum module in Ansible to install this package on
remote systems that do not have it.
.. 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 (see :doc:`patterns`) 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 usually about two months long. Due to this
short release cycle, minor 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 will want to install the dependencies needed by Ansible with pip if going from a checkout::
# on Ubuntu, for example:
apt-get install python-dev python-pip
pip install PyYAML Jinja2 paramiko
Once running the env-setup script you'll be running from checkout and the default inventory file
will be /etc/ansible/hosts. 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
things like 'fireball' mode that you might not need::
$ 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. RPMs for openSUSE can be found via the
`openSUSE Software Portal <http://software.opensuse.org/package/ansible>`_
(in the systemsmanagement Project) for all currently supported
openSUSE and SLES 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
For openSUSE and SUSE Linux Enterprise, add the `systemsmanagement repository <http://download.opensuse.org/repositories/systemsmanagement/>`_
for your distribution:
.. code-block:: bash
# replace $dist with the correct distribution found here: http://download.opensuse.org/repositories/systemsmanagement/
$ sudo zypper ar -f http://download.opensuse.org/repositories/systemsmanagement/$dist/systemsmanagement.repo
$ sudo zypper 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
Via MacPorts on OS X
++++++++++++++++++++
Ansible is easily run or installed from source, but you can also use MacPorts.
To install the stable version of Ansible from MacPorts, 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>`_.
Once configured,
.. code-block:: bash
$ sudo apt-get install ansible
Debian/Ubuntu packages can also be built from the source checkout, run:
.. code-block:: bash
$ make debian
You may also wish to run from source to get the latest, which is covered above.
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 (see :doc:`patterns`) 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 ansibleworks.com page.
* `Ansible/downloads <http://ansibleworks.com/releases>`_
These releases are also tagged in the git repository with the release version.
Choosing Between Paramiko and Native SSH
````````````````````````````````````````
By default, ansible 1.3 and later will try to use native SSH for remote communication when possible.
This is done when ControlPersist support is available. Paramiko is however reasonably fast and makes
a good default on versions of Enterprise Linux where ControlPersist is not available. However, Paramiko
does not support some advanced SSH features that folks will want to use. In Ansible 1.2 and before,
the default was strictly paramiko and native SSH had to be explicitly selected with -c ssh or set in the
configuration file.
.. 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 ansible'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
soon going to be 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!
A note about Connection (Transport) Modes
`````````````````````````````````````````
Ansible has two major forms of SSH transport implemented, 'ssh' (OpenSSH) and 'paramiko'. Paramiko is a python
SSH implementation and 'ssh' simply calls OpenSSH behind the scenes. There are additionally 'fireball' (an accelerated
remote transport), 'local', and 'chroot' connection modes in Ansible that don't use SSH, but connecting by one of the two
SSH transports is the most common way to manage systems. It is useful to understand the difference between the 'ssh'
and 'paramiko' modes.
Paramiko is provided because older Enterprise Linux operating systems do not have an efficient OpenSSH that support
ControlPersist technology, and in those cases, 'paramiko' is faster than 'ssh'. Thus, until EL6 backports a newer
SSH, 'paramiko' is the faster option on that platform.
However, if you have a newer 'ssh' that supports ControlPersist, usage of the 'ssh' transport unlocks additional
configurability, including the option to use Kerberos. For instance, the latest Fedora and Ubuntu releases
all offer a sufficiently new OpenSSH. With ControlPersist available, 'ssh' is usually about as fast as paramiko.
If you'd like even more speed, read about 'fireball' in the Advanced Playbooks section.
Starting with Ansible 1.2.1, the default transport mode for Ansible is 'smart', which means it will detect
if OpenSSH supports ControlPersist, and will select 'ssh' if available, and otherwise pick 'paramiko'.
Previous versions of Ansible defaulted to 'paramiko'.
A note about Host Key Checking
``````````````````````````````
Ansible 1.2.1 and later have host key checking enabled by default.
If a host is reinstalled and has a different key in 'known_hosts', this will result in a error message until
corrected. If a host is not initially in 'known_hosts' this will result in prompting for confirmation of the key,
which results in a interactive experience if using Ansible, from say, cron.
If you wish to disable this behavior and understand the implications, you can do so by editing /etc/ansible/ansible.cfg or ~/.ansible.cfg::
[defaults]
host_key_checking = False
Alternatively this can be set by an environment variable:
$ export ANSIBLE_HOST_KEY_CHECKING=False
Also note that host key checking in paramiko mode is reasonably slow, therefore switching to 'ssh' is also recommended when using this
feature.
.. 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

View File

@ -0,0 +1,429 @@
Glossary
========
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 the terms in context, but this should be a good resource
to check your knowledge of Ansible's components and understand how they fit together. It's something you might wish to read for review or
when a term comes up on the mailing list.
Action
++++++
An action is a part of a task that specifies which of the modules to run and the 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 perform 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 can be accomplished 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 results from Ansible and do something with them. Some supplied examples
in the GitHub project perform custom logging, send email, or even play sound effects.
Check Mode
++++++++++
Refers to running Ansible with the --check option, which does not make any changes on the remote systems, but only outputs the changes that
might occur if the command ran without this flag. This is analogous to so-called "dry run" modes in other systems, though the user should
be warned that this does not take into account unexpected command failures or cascade effects (which is true of similar modes in other
systems). Use this to get an idea of what might happen, but it is not a substitute for a good staging environment.
Connection Type, Connection Plugin
++++++++++++++++++++++++++++++++++
By default, Ansible talks to remote machines through pluggable libraries. Ansible supports native OpenSSH ('ssh'), or a Python
implementation called 'paramiko'. OpenSSH is preferred if you are using a recent version, and also enables some features
like Kerberos and jump hosts. This is covered in the getting started section.
There are also other connection types like 'fireball' mode, which must be bootstrapped
over one of the SSH-based connection types 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 '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 automatically discovered by Ansible when running plays by executing 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 the convenience of users who are switching from other configuration management 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, respectively.
Filter Plugin
+++++++++++++
A filter plugin is something that most users will never need to understand. These allow for the creation of new Jinja2 filters, which
are more or 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 or native OpenSSH, a common alternative. (Ansible tries to use
'ssh' by default if possible in Ansible 1.2.1 and later, but previously defaulted to paramiko). Some users
may want to execute operations even faster though, and they can if they opt to run their tasks using an ephemeral 'fireball' message bus. What happens in this mode is that Ansible
will start talking to a node over SSH, and then set up a secure, temporary message bus that authenticates only a single machine, and 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 and 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 when running a multi-play playbook, it is desirable to have some plays that don't bother with fact
computation if they aren't going to need to utilize any of these values. 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 wildcards, 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 conveniently targeted 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 convenient place to put variables that will be provided to a given group, especially complex data structures, 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 playbook (see Tasks), but are only run if the Task contains a "notify" directive and
also indicates that it changed something. For example, if a config file is changed then the task referencing the config file templating
operation may notify a service restart handler. 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 Ansible 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 are 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 convenient 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 data structures that can't be represented in the
inventory file.
Lazy Evaluation
+++++++++++++++
In general, Ansible evaluates any variables in playbook content at the last possible second, which means that if you define a data structure
that data structure 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", a basic looping plugin, are implemented,
but there are also lookup plugins like "with_file" which loads data from a file, and even ones for querying environment variables,
DNS text records, or key value stores. Lookup plugins can also be accessed in templates, e.g., ``{{ lookup('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 from 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 way 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 lists 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 that 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 Ansible'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 deprecated form of the "when:" statement. It should no longer be used.
Library
+++++++
A collection of modules made available 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 passing "-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 targeting remote machines means that the given step will actually occur on the 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 speeding 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 necessary to touch systems in particular orders,
often to simulate rolling updates or to 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, emails may need to be sent or web services contacted. Ansible
orchestration is all about modelling that kind of process.
paramiko
++++++++
By default, Ansible manages machines over SSH. The library that Ansible uses by default to do this is a Python-powered library called
paramiko. The paramiko library is generally fast and easy to manage, though users desiring Kerberos or Jump Host support may wish to switch
to a native SSH binary such as OpenSSH 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 selected by a host specifier (usually chosen by groups, but sometimes by hostname
globs) and the tasks which run on those hosts to define the role that those systems will perform. There
can be one or many plays in a playbook.
Pull Mode
+++++++++
By default, Ansible runs in push mode, which allows it very fine-grained control over when it talks to each system. 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 pull mode 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 through 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 define the variable is called 'register', taking its 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
and ensure that the attributes of that resource match a particular model. As an example, we might wish to change the owner of /etc/motd
to 'root' if it is not already set to root, or set its mode to '0644' if it is 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.
Roles
+++++
Roles are units of organization in Ansible. Assigning a role to a group of hosts (or a set of groups, or host patterns, etc.) implies that they should implement a specific behavior. A role
may include applying certain variable values, certain tasks, and certain handlers -- or just one or more of these things. Because of the file structure associated with a role, roles become
redistributable units that allow you to share behavior among playbooks -- or even with other users.
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 do so 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 password-less and password-based sudo. Some operations that don't normally work with sudo (like scp
file transfer) can be achieved with Ansible's copy, template, and fetch modules while running in sudo mode.
SSH (Native)
++++++++++++
Native OpenSSH as an Ansible transport 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 using SSH jump hosts, etc. In 1.2.1, 'ssh' will be used by default if the OpenSSH binary
on the control machine is sufficiently new. Previously, Ansible selected 'paramiko' as a default.
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 is a good choice. Ansible will warn you if it doesn't detect ControlMaster/ControlPersist capability.
Tags
++++
Ansible allows tagging resources in a playbook with arbitrary keywords, and then running only the parts of the playbook that
correspond to those keywords. For instance, it is possible to have an entire OS configuration, and have certain steps
labeled "ntp", and then run just the "ntp" steps to reconfigure the time server information on a remote host.
Tasks
+++++
Playbooks exist to run tasks. Tasks combine an action (a module and its arguments) 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 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, SSH (using OpenSSH), fireball (an SSH-bootstrapped accelerated connection plugin), and local.
When
++++
An optional conditional statement attached to a task that is used to determine if the task should run or not. If the expression following the "when:" keyword evaluates to false, the task will be ignored.
Van Halen
+++++++++
For no particular reason, other than the fact that Michael really likes them, all Ansible releases are codenamed 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 that there will ever be a Jump release, but a Van Halen III codename release is possible. 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 system's 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.).

View File

@ -0,0 +1,87 @@
Ansible Documentation Index
```````````````````````````
Welcome to the Ansible documentation. This documentation covers the current released
version of Ansible (1.2) and may also reference some development version features.
For the previous released version, see `Ansible 1.1 Docs <http://ansibleworks.com/docs/released/1.1>`_ instead.
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://www.ansibleworks.com/wp-content/uploads/2013/06/ANSIBLE_DIAGRAM.jpg
:alt: ansible architecture diagram
:width: 788px
:height: 436px
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>
Specific Solutions
``````````````````
A chance to dive into some more topics in depth:
.. toctree::
:maxdepth: 1
amazon_web_services
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
faq
contrib
glossary

View File

@ -5,11 +5,10 @@ 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_PATH` or the ``--module-path`` command line option.
by `ANSIBLE_LIBRARY` or the ``--module-path`` command line option.
.. contents::
:depth: 2
:backlinks: top
Tutorial
@ -175,7 +174,7 @@ Let's test that module::
This should return something like::
{"changed": True, "time": "2012-03-14 12:23:00.000307"}
{"changed": true, "time": "2012-03-14 12:23:00.000307"}
Module Provided 'Facts'
```````````````````````
@ -249,6 +248,32 @@ 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
```````````````
@ -270,8 +295,8 @@ 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/Recomendations
``````````````````````````
Conventions/Recommendations
```````````````````````````
As a reminder from the example code above, here are some basic conventions
and guidelines:
@ -322,15 +347,10 @@ 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:
To print a basic documentation string, run ``./hacking/module_formatter.py -G``.
.. literalinclude:: ../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.
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::
@ -342,11 +362,28 @@ Include it in your module file like this::
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``, and ``notes``
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 must 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 (deprecated) ``examples`` you may have in the
YAML ``DOCUMENTATION`` string.
Building & Testing
++++++++++++++++++
@ -376,18 +413,10 @@ output formats available:
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::
Sharing Your Module
```````````````````
If you think your module is generally useful to others, a good place to share it
is in `Ansible Resources <https://github.com/ansible/ansible/tree/devel/contrib>`_. This is maintained
as a simple repo with pointers to other github projects.
Contrib modules here can be implemented in a variety of languages.
We would like to build up as many of these as possible in as many languages as possible.
`Ansible Mailing List <http://groups.google.com/group/ansible-project>`_
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
`````````````````````````````
@ -402,7 +431,7 @@ the program. Stop by the mailing list to inquire about requirements.
:doc:`modules`
Learn about available modules
`Ansible Resources <https://github.com/ansible/ansible/tree/devel/contrib>`_
:doc:`contrib`
User contributed playbooks, modules, and articles
`Github modules directory <https://github.com/ansible/ansible/tree/devel/library>`_
Browse source of core modules

View File

@ -2,8 +2,7 @@ Ansible Modules
===============
.. contents::
:depth: 2
:backlinks: top
:depth: 3
Introduction
````````````
@ -30,6 +29,11 @@ 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
@ -39,17 +43,19 @@ Modules are `idempotent`, meaning they will seek to avoid changes to the system
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
Additional Contrib Modules
``````````````````````````
In addition to the following built-in modules, community modules are available at `Ansible Resources <http://github.com/ansible/ansible-resources>`_.
Writing your own modules
````````````````````````
@ -57,7 +63,7 @@ See :doc:`moduledev`.
.. seealso::
`Ansible Resources (Contrib) <https://github.com/ansible/ansible-resources>`_
:doc:`contrib`
User contributed playbooks, modules, and articles
:doc:`examples`
Examples of using modules in /usr/bin/ansible

View File

@ -7,9 +7,8 @@ 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`
.. contents::
:depth: 2
:backlinks: top
.. _inventoryformat:
@ -33,16 +32,76 @@ 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.
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::
four.example.com:5309
badwolf.example.com:5309
In 0.6 and later, if you have a lot of hosts following similar patterns you can do this rather than listing each hostname::
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
Leading zeros can be included or removed, as desired, and the ranges are inclusive.
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.
List of Reserved Inventory Parameters
+++++++++++++++++++++++++++++++++++++
As a summary, you can set these parameters as host inventory variables. (Some we have already
mentioned).
ansible_ssh_host
The name of the host to connect to, if different from the alias you wish to give to it.
ansible_ssh_port
The ssh port number, if not 22
ansible_ssh_user
The default ssh user name to use.
ansible_ssh_pass
The ssh password to use (this is insecure, we strongly recommend using --ask-pass or SSH keys)
ansible_connection
Connection type of the host. Candidates are local, ssh or paramiko. The default is paramiko before Ansible 1.2, and 'smart' afterwards which detects whether usage of 'ssh' would be feasible based on whether ControlPersist is supported.
ansible_ssh_private_key_file
Private key file used by ssh. Useful if using multiple keys and you don't want to use SSH agent.
ansible_syslog_facility
The syslog facility to log to.
ansible_python_interpreter
The target host python path. This is userful for systems with more
than one Python or not located at "/usr/bin/python" such as \*BSD, or where /usr/bin/python
is not a 2.X series Python.
ansible\_\*\_interpreter
Works for anything such as ruby or perl and works just like ansible_python_interpreter.
This replaces shebang of modules which will run on that host.
Examples from a host file::
some_host ansible_ssh_port=2222 ansible_ssh_user=manager
aws_host ansible_ssh_private_key_file=/home/example/.ssh/aws.pem
freebsd_host ansible_python_interpreter=/usr/local/bin/python
ruby_module_host ansible_ruby_interpreter=/usr/bin/ruby.1.9.3
Selecting Targets
+++++++++++++++++
@ -50,7 +109,7 @@ 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"
@ -63,7 +122,7 @@ 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::
@ -71,7 +130,7 @@ Basically 'all' is an alias for '*'. It is also possible to address a specific
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::
@ -82,7 +141,19 @@ You can exclude groups as well, for instance, all webservers not in Phoenix::
webservers:!phoenix
Individual host names (or IPs), but not groups, can also be referenced using
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
@ -92,13 +163,17 @@ It's also ok to mix wildcard patterns and groups at the same time::
one*.com:dbservers
And if the pattern starts with a '~' it is treated as a regular expression::
~(web|db).*\.example\.com
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
@ -149,7 +224,7 @@ variables to groups. These variables can be used by /usr/bin/ansible-playbook,
southeast
If you need to store lists or hash data, or prefer to keep host and group specific variables
seperate from the inventory file, see the next section.
separate from the inventory file, see the next section.
Splitting Out Host and Group Specific Data
++++++++++++++++++++++++++++++++++++++++++
@ -181,27 +256,18 @@ the 'raleigh' group might look like::
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)
Tip: In Ansible 1.2 or later the group_vars/ and host_vars/ directories can exist in either
the playbook directory OR the inventory directory. If both paths exist, variables in the playbook
directory will be loaded second.
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, set a
variable called 'ansible_python_interpreter' to the Python
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.
YAML Inventory
++++++++++++++
.. deprecated:: 0.7
Ansible's YAML inventory format is deprecated and will be removed in
Ansible 0.7. Ansible 0.6 includes a `conversion script
<https://github.com/ansible/ansible/blob/devel/examples/scripts/yaml_to_ini.py>`_.
Usage::
yaml_to_ini.py /etc/ansible/hosts
.. seealso::
:doc:`examples`

View File

@ -3,7 +3,6 @@ Playbooks
.. contents::
:depth: 2
:backlinks: top
Introduction
````````````
@ -27,14 +26,17 @@ 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
The goal of a play is to map a group of hosts to some well defined roles, represented by
things ansible calls tasks. At a 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
@ -52,16 +54,16 @@ For starters, here's a playbook that contains just one play::
user: root
tasks:
- name: ensure apache is at the latest version
action: yum pkg=httpd state=latest
yum: pkg=httpd state=latest
- name: write the apache config file
action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running
action: service name=httpd state=started
service: name=httpd state=started
handlers:
- name: restart apache
action: service name=httpd state=restarted
service: name=httpd state=restarted
Below, we'll break down what the various features of the playbook language are.
@ -88,14 +90,24 @@ Support for running things from sudo is also available::
---
- hosts: webservers
user: yourname
sudo: True
sudo: yes
You can also use sudo on a particular task instead of the whole play::
---
- hosts: webservers
user: yourname
tasks:
- service: name=nginx state=started
sudo: yes
You can also login as you, and then sudo to different users than root::
---
- hosts: webservers
user: yourname
sudo: True
sudo: yes
sudo_user: postgres
If you need to specify a password to sudo, run `ansible-playbook` with ``--ask-sudo-pass`` (`-K`).
@ -128,37 +140,44 @@ The `vars` section contains a list of variables and values that can be used in t
van_halen_port: 5150
other: 'magic'
.. note::
You can also keep variables in separate files and include them alongside inline `vars` with a `vars_files` declaration
in the play. See the `Advanced Playbooks chapter <http://www.ansibleworks.com/docs/playbooks2.html#variable-file-separation>`_
for more info.
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.
Variables are passed through the Jinja2 templating engine. Any valid Jinja2
expression can be used between the curly braces, including the use of filters
to modify the variable (for example, `{{ varname|int }}` ensures the variable is
interpreted as an integer).
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_``.
Jinja2 expressions are very similar to Python and even if you are not working
with Python you should feel comfortable with them. See the `Jinja2 documentation
<http://jinja.pocoo.org/docs/templates/>`_ to learn more about the syntax.
Please note that Jinja2 loops and conditionals are only useful in Ansible
templates, not in playbooks. Use the 'when' and 'with' keywords for
conditionals and loops in Ansible playbooks.
So for instance, if I wanted
to write the hostname into the /etc/motd file, I could say::
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', which 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_``. These add extra dependencies and are only there for ease of users
porting over from those other configuration systems. Finally, it's possible to drop files
on to the remote systems that provide additional sources of fact data, see "Facts.d" as documented
in the Advanced Playbooks section.
How about an example. 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
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.
But we're getting ahead of ourselves, as that just showed a task in a playbook ahead of schedule. Let's talk about tasks.
Tasks list
++++++++++
@ -176,7 +195,7 @@ 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
again, they will make only the changes they must in order 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.
@ -192,12 +211,17 @@ 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.
Tasks can be declared using the legacy "action: module options" format, but
it is recommeded that you use the more conventional "module: options" format.
This recommended format is used throughout the documentation, but you may
encounter the older format in some playbooks.
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
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
@ -205,27 +229,58 @@ them work just like you would expect. Simple::
tasks:
- name: disable selinux
action: command /sbin/setenforce 0
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::
whose 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
shell: /usr/bin/somecommand || /bin/true
Or this::
tasks:
- name: run this command and ignore the result
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
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
- name: create a virtual host file for {{ vhost }}
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
Ansible prefers listing modules like this in 0.8 and later::
template: src=templates/foo.j2 dest=/etc/foo.conf
You will notice in earlier versions, this was only available as::
action: template src=templates/foo.j2 dest=/etc/foo.conf
The old form continues to work in newer versions without any plan of deprecation.
Running Operations On Change
````````````````````````````
@ -233,15 +288,18 @@ 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.
These 'notify' actions are triggered at the end of each block of tasks in a playbook, and will only be
triggered once even if notified by multiple different tasks.
For instance, multiple resources may indicate
that apache needs to be restarted because they have changed a config file,
but apache will only be bounced once to avoid unneccessary restarts.
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
template: src=template.j2 dest=/etc/foo.conf
notify:
- restart memcached
- restart apache
@ -259,9 +317,9 @@ Here's an example handlers section::
handlers:
- name: restart memcached
action: service name=memcached state=restarted
service: name=memcached state=restarted
- name: restart apache
action: service name=apache state=restarted
service: name=apache state=restarted
Handlers are best used to restart services and trigger reboots. You probably
won't need them for much else.
@ -269,9 +327,22 @@ won't need them for much else.
.. note::
Notify handlers are always run in the order written.
Roles are described later on. It's worthwhile to point out that handlers are
automatically processed between 'pre_tasks', 'roles', 'tasks', and 'post_tasks'
sections. If you ever want to flush all the handler commands immediately though,
in 1.2 and later, you can::
Include Files And Encouraging Reuse
```````````````````````````````````
tasks:
- shell: some tasks go here
- meta: flush_handlers
- shell: some other tasks
In the above example any queued up handlers would be processed early when the 'meta'
statement was reached. This is a bit of a niche case but can come in handy from
time to time.
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
@ -283,9 +354,9 @@ 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
command: /bin/foo
- name: placeholder bar
action: command /bin/bar
command: /bin/bar
Include directives look like this, and can be mixed in with regular tasks in a playbook::
@ -304,24 +375,39 @@ contain all of my wordpress tasks in a single wordpress.yml file, and use it lik
Variables passed in can then be used in the included files. You can reference them like this::
$user
{{ user }}
(In addition to the explicitly passed in parameters, all variables from
(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::
Task include statements are only usable one-level deep.
This means task includes can not include other
task includes. This may change in a later release.
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
service: name=apache state=restarted
And in your main playbook file, just include it like so, at the bottom
of a play::
@ -342,7 +428,7 @@ For example::
tasks:
- name: say hi
tags: foo
action: shell echo "hi..."
shell: echo "hi..."
- include: load_balancers.yml
- include: webservers.yml
@ -352,15 +438,189 @@ 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
play are going to get the same tasks. ('*when*' provides some
ability for hosts to conditionally skip tasks).
.. _roles:
Roles
`````
.. versionadded:: 1.2
Now that you have learned about vars_files, tasks, and handlers, what is the best way to organize your playbooks?
The short answer is to use roles! Roles are ways of automatically loading certain vars_files, tasks, and
handlers based on a known file structure. Grouping content by roles also allows easy sharing of roles with other users.
Roles are just automation around 'include' directives as redescribed above, and really don't contain much
additional magic beyond some improvements to search path handling for referenced files. However, that can be a big thing!
Example project structure::
site.yml
webservers.yml
fooservers.yml
roles/
common/
files/
templates/
tasks/
handlers/
vars/
meta/
webservers/
files/
templates/
tasks/
handlers/
vars/
meta/
In a playbook, it would look like this::
---
- hosts: webservers
roles:
- common
- webservers
This designates the following behaviors, for each role 'x':
- If roles/x/tasks/main.yml exists, tasks listed therein will be added to the play
- If roles/x/handlers/main.yml exists, handlers listed therein will be added to the play
- If roles/x/vars/main.yml exists, variables listed therein will be added to the play
- If roles/x/meta/main.yml exists, any role dependencies listed therein will be added to the list of roles (1.3 and later)
- Any copy tasks can reference files in roles/x/files/ without having to path them relatively or absolutely
- Any script tasks can reference scripts in roles/x/files/ without having to path them relatively or absolutely
- Any template tasks can reference files in roles/x/templates/ without having to path them relatively or absolutely
.. note::
Role dependencies are discussed below.
If any files are not present, they are just ignored. So it's ok to not have a 'vars/' subdirectory for the role,
for instance.
Note, you are still allowed to list tasks, vars_files, and handlers "loose" in playbooks without using roles,
but roles are a good organizational feature and are highly recommended. if there are loose things in the playbook,
the roles are evaluated first.
Also, should you wish to parameterize roles, by adding variables, you can do so, like this::
---
- hosts: webservers
roles:
- common
- { role: foo_app_instance, dir: '/opt/a', port: 5000 }
- { role: foo_app_instance, dir: '/opt/b', port: 5001 }
While it's probably not something you should do often, you can also conditionally apply roles like so::
---
- hosts: webservers
roles:
- { role: some_role, when: "ansible_os_family == 'RedHat'" }
This works by applying the conditional to every task in the role. Conditionals are covered later on in
the documentation.
Finally, you may wish to assign tags to the roles you specify. You can do so inline:::
---
- hosts: webservers
roles:
- { role: foo, tags: ["bar", "baz"] }
If the play still has a 'tasks' section, those tasks are executed after roles are applied.
If you want to define certain tasks to happen before AND after roles are applied, you can do this::
---
- hosts: webservers
pre_tasks:
- shell: echo 'hello'
roles:
- { role: some_role }
tasks:
- shell: echo 'still busy'
post_tasks:
- shell: echo 'goodbye'
.. note::
If using tags with tasks (described later as a means of only running part of a playbook),
be sure to also tag your pre_tasks and post_tasks and pass those along as well, especially if the pre
and post tasks are used for monitoring outage window control or load balancing.
Role Default Variables
``````````````````````
.. versionadded:: 1.3
Role default variables allow you to set default variables for included or dependedent roles (see below). To create
defaults, simply add a `defaults/main.yml` file in your role directory. These variables will have the lowest priority
of any variables available, and can be easily overridden by any other variable, including inventory variables.
Role Dependencies
`````````````````
.. versionadded:: 1.3
Role dependencies allow you to automatically pull in other roles when using a role. Role dependencies are stored in the
`meta/main.yml` file contained within the role directory. This file should contain
a list of roles and parameters to insert before the specified role, such as the following in an example
`roles/myapp/meta/main.yml`::
---
dependencies:
- { role: common, some_parameter: 3 }
- { role: apache, port: 80 }
- { role: postgres, dbname: blarg, other_parameter: 12 }
Role dependencies can also be specified as a full path, just like top level roles::
---
dependencies:
- { role: '/path/to/common/roles/foo', x: 1 }
Roles dependencies are always executed before the role that includes them, and are recursive. By default,
roles can also only be added as a dependency once - if another role also lists it as a dependency it will
not be run again. This behavior can be overridden by adding `allow_duplicates: yes` to the `meta/main.yml` file.
For example, a role named 'car' could add a role named 'wheel' to its dependencies as follows::
---
dependencies:
- { role: wheel, n: 1 }
- { role: wheel, n: 2 }
- { role: wheel, n: 3 }
- { role: wheel, n: 4 }
And the `meta/main.yml` for wheel contained the following::
---
allow_duplicates: yes
dependencies:
- { role: tire }
- { role: brake }
The resulting order of execution would be as follows::
tire(n=1)
brake(n=1)
wheel(n=1)
tire(n=2)
brake(n=2)
wheel(n=2)
...
car
.. note::
Variable inheritance and scope are detailed in the Advanced Playbook section.
Executing A Playbook
````````````````````
@ -372,9 +632,9 @@ Let's run a playbook using a parallelism level of 10::
Tips and Tricks
```````````````
Look at the bottom of the playbook execution for a summary of the nodes that were executed
Look at the bottom of the playbook execution for a summary of the nodes that were targeted
and how they performed. General failures and fatal "unreachable" communication attempts are
kept seperate in the counts.
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.

File diff suppressed because it is too large Load Diff

View File

@ -1,143 +0,0 @@
Best Practices
==============
Here are some tips for making the most of Ansible.
.. contents::
:depth: 2
:backlinks: top
Always Mention 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.
Directory Organization
++++++++++++++++++++++
Playbooks should be organized like this::
# root of source control repository
├── acme/
│ ├── setup.yml
│ └── stop.yml
├── files/
│ └── some_file_path_foo.conf
├── handlers/
│ └── main.yml
├── tasks/
│ ├── setup.yml
│ └── stop.yml
├── templates/
│ ├── etc_acme_conf_acme.conf
│ └── etc_other_conf_other.conf
├── vars/
│ └── main.yml
└── global_vars.yml
Any directories or files not needed can be omitted. Not all modules
may require 'vars' or 'files' sections, though most will require
'handlers', 'tasks', and 'templates'. To review what each of
these sections do, see :doc:`playbooks` and :doc:`playbooks2`.
The acme/setup.yml playbook would be as simple as::
---
- hosts: webservers
user: root
vars_files:
- ../global_vars.yml
- vars/main.yml
tasks:
- include: tasks/setup.yml
handlers:
- include: handlers/main.yml
The tasks are individually broken out in 'acme/tasks/setup.yml', and handlers, which are common to all task files,
are contained in 'acme/handlers/main.yml'. As a reminder, handlers are mostly just used to notify services to restart
when things change, and these are described in :doc:`playbooks`.
Including more than one setup file or more than one handlers file is of course legal.
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.
Miscellaneous Tips
++++++++++++++++++
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.
Optimize for readability. Whitespace between sections of YAML
documents and in between tasks is strongly encouraged, as is usage of
YAML comments, which start with '#'. It is also useful to comment
at the top of each file the purpose of the individual file and the
author, including email address.
It is possible to leave off the 'name' for a given task, though it
is recommended to provide a descriptive comment about why something is
being done instead.
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.
Resist the urge to write the same playbooks and configuration files
for heterogeneous distributions. While lots of software packages
claim to make this easy on you, the configuration files are often
quite different, to the point where it would be easier to treat them
as different playbooks. This is why, for example, Ansible has a
separate 'yum' and 'apt' module. Yum and apt have different
capabilities, and we don't want to code for the least common
denominator.
Use variables for user tunable settings versus having constants in the
tasks file or templates, so that it is easy to reconfigure a playbook.
Think about this as exposing the knobs to things you would like to
tweak.
Since a system can be in more than one group, if you have multiple
datacenters or sites, consider putting systems into groups by role,
but also different groups by geography. This allows you to assign
different variables to different geographies.
.. 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

View File

@ -1,247 +0,0 @@
Getting Started
===============
.. 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,
your distribution can easily install 2.6 (see instructions in the next section). Newer versions
of Linux and OS X should already have 2.6.
In additon to Python 2.6, you will want the following packages:
* ``paramiko``
* ``PyYAML``
* ``python-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 copy module -- some of the most basic features in
ansible -- 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.)
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. If you have not already done so, `configure EPEL
<http://fedoraproject.org/wiki/EPEL>`_
.. code-block:: bash
$ yum install python26 python26-PyYAML python26-paramiko python26-jinja2
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
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 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.
.. 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:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/ansible-*.noarch.rpm
Debian, Gentoo, Arch, Others
++++++++++++++++++++++++++++
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 eBuilds are available `on github here <https://github.com/uu/ubuilds>`_
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
If you would like to package Ansible for Homebrew, BSD, or others,
please stop by the mailing list and say hi!
Tagged Releases
+++++++++++++++
Tagged releases are available as tar.gz files from the Ansible github
project page:
* `Ansible/downloads <https://github.com/ansible/ansible/downloads>`_
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-file option to specify a pem file instead)
Now ping all your nodes:
.. code-block:: bash
$ ansible all -m ping
In Ansible 0.7 and later, ansible will attempt to remote connect to the machines using your current
user name, just like SSH would. In 0.6 and before, this actually defaults to 'root' (we liked the current
user behavior better). 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
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

View File

@ -1,18 +0,0 @@
Contents
````````
.. toctree::
:maxdepth: 1
gettingstarted
patterns
examples
modules
YAMLSyntax
playbooks
playbooks2
bestpractices
api
moduledev

View File

@ -1,572 +0,0 @@
Advanced Playbooks
==================
Here are some advanced features of the playbooks language. Using all of these features
are not neccessary, but many of them will prove useful. If a feature doesn't seem immediately
relevant, feel free to skip it. For many people, the features documented in `playbooks` will
be 90% or more of what they use in Ansible.
.. contents::
:depth: 2
:backlinks: top
Tags
````
.. versionadded:: 0.6
If you have a large playbook it may become useful to be able to run a
specific part of the configuration. Both plays and tasks support a
"tags:" attribute for this reason.
Example::
tasks:
- action: yum name=$item state=installed
with_items:
- httpd
- memcached
tags:
- packages
- action: template src=templates/src.j2 dest=/etc/foo.conf
tags:
- configuration
If you wanted to just run the "configuration" and "packages" part of a very long playbook, you could do this::
ansible-playbook example.yml --tags "configuration,packages"
Playbooks Including Playbooks
`````````````````````````````
.. versionadded:: 0.6
To further advance the concept of include files, playbook files can
include other playbook files. Suppose you define the behavior of all
your webservers in "webservers.yml" and all your database servers in
"dbservers.yml". You can create a "site.yml" that would reconfigure
all of your systems like this::
----
- include: playbooks/webservers.yml
- include: playbooks/dbservers.yml
This concept works great with tags to rapidly select exactly what plays you want to run, and exactly
what parts of those plays.
Ignoring Failed Commands
````````````````````````
.. deprecated:: 0.6
Generally playbooks will stop executing any more steps on a host that
has a failure. Sometimes, though, you want to continue on. To do so,
write a task that looks like this::
- name: this will not be counted as a failure
action: command /bin/false
ignore_errors: True
Accessing Complex Variable Data
```````````````````````````````
Some provided facts, like networking information, are made available as nested data structures. To access
them a simple '$foo' is not sufficient, but it is still easy to do. Here's how we get an IP address::
${ansible_eth0.ipv4.address}
It is also possible to access variables whose elements are arrays::
${somelist[0]}
And the array and hash reference syntaxes can be mixed.
In templates, the simple access form still holds, but they can also be accessed from Jinja2 in more Python-native ways if
that is preferred::
{{ ansible_eth0["ipv4"]["address"] }}
Accessing Information About Other Hosts
```````````````````````````````````````
If your database server wants to check the value of a 'fact' from another node, or an inventory variable
assigned to another node, it's easy to do so within a template or even an action line::
${hostvars.hostname.factname}
.. note::
No database or other complex system is required to exchange data
between hosts. The hosts that you want to reference data from must
be included in either the current play or any previous play.
Additionally, *group_names* is a list (array) of all the groups the current host is in. This can be used in templates using Jinja2 syntax to make template source files that vary based on the group membership (or role) of the host::
{% if 'webserver' in group_names %}
# some part of a configuration file that only applies to webservers
{% endif %}
*groups* is a list of all the groups (and hosts) in the inventory. This can be used to enumerate all hosts within a group.
For example::
{% for host in groups['app_servers'] %}
# something that applies to all app servers.
{% endfor %}
Use cases include pointing a frontend proxy server to all of the app servers, setting up the correct firewall rules between servers, etc.
*inventory_hostname* is the name of the hostname as configured in Ansible's inventory host file. This can
be useful for when you don't want to rely on the discovered hostname `ansible_hostname` or for other mysterious
reasons. If you have a long FQDN, *inventory_hostname_short* (in Ansible 0.6) also contains the part up to the first
period.
Don't worry about any of this unless you think you need it. You'll know when you do.
Variable File Seperation
````````````````````````
It's a great idea to keep your playbooks under source control, but
you may wish to make the playbook source public while keeping certain
important variables private. Similarly, sometimes you may just
want to keep certain information in different files, away from
the main playbook.
You can do this by using an external variables file, or files, just like this::
---
- hosts: all
user: root
vars:
favcolor: blue
vars_files:
- /vars/external_vars.yml
tasks:
- name: this is just a placeholder
action: command /bin/echo foo
This removes the risk of sharing sensitive data with others when
sharing your playbook source with them.
The contents of each variables file is a simple YAML dictionary, like this::
---
# in the above example, this would be vars/external_vars.yml
somevar: somevalue
password: magic
.. note::
It's also possible to keep per-host and per-group variables in very
similar files, this is covered in :ref:`patterns`.
Prompting For Sensitive Data
````````````````````````````
You may wish to prompt the user for certain input, and can
do so with the similarly named 'vars_prompt' section. This has uses
beyond security, for instance, you may use the same playbook for all
software releases and would prompt for a particular release version
in a push-script::
---
- hosts: all
user: root
vars:
from: "camelot"
vars_prompt:
name: "what is your name?"
quest: "what is your quest?"
favcolor: "what is your favorite color?"
There are full examples of both of these items in the github examples/playbooks directory.
An alternative form of vars_prompt allows for hiding input from the user, and may later support
some other options, but otherwise works equivalently::
vars_prompt:
- name: "some_password"
prompt: "Enter password"
private: True
- name: "release_version"
prompt: "Product release version"
private: False
Passing Variables On The Command Line
`````````````````````````````````````
In addition to `vars_prompt` and `vars_files`, it is possible to send variables over
the ansible command line. This is particularly useful when writing a generic release playbook
where you may want to pass in the version of the application to deploy::
ansible-playbook release.yml --extra-vars "version=1.23.45 other_variable=foo"
This is useful, for, among other things, setting the hosts group or the user for the playbook.
Example::
-----
- user: $user
hosts: $hosts
tasks:
- ...
ansible-playbook release.yml --extra-vars "hosts=vipers user=starbuck"
Conditional Execution
`````````````````````
Sometimes you will want to skip a particular step on a particular host. This could be something
as simple as not installing a certain package if the operating system is a particular version,
or it could be something like performing some cleanup steps if a filesystem is getting full.
This is easy to do in Ansible, with the `only_if` clause, which actually is a Python expression.
Don't panic -- it's actually pretty simple::
vars:
favcolor: blue
is_favcolor_blue: "'$favcolor' == 'blue'"
is_centos: "'$facter_operatingsystem' == 'CentOS'"
tasks:
- name: "shutdown if my favorite color is blue"
action: command /sbin/shutdown -t now
only_if: '$is_favcolor_blue'
Variables from tools like `facter` and `ohai` can be used here, if installed, or you can
use variables that bubble up from ansible, which many are provided by the :ref:`setup` module. As a reminder,
these variables are prefixed, so it's `$facter_operatingsystem`, not `$operatingsystem`. Ansible's
built in variables are prefixed with `ansible_`.
The only_if expression is actually a tiny small bit of Python, so be sure to quote variables and make something
that evaluates to `True` or `False`. It is a good idea to use 'vars_files' instead of 'vars' to define
all of your conditional expressions in a way that makes them very easy to reuse between plays
and playbooks.
You cannot use live checks here, like 'os.path.exists', so don't try.
It's also easy to provide your own facts if you want, which is covered in :doc:`moduledev`. To run them, just
make a call to your own custom fact gathering module at the top of your list of tasks, and variables returned
there will be accessible to future tasks::
tasks:
- name: gather site specific fact data
action: site_facts
- action: command echo ${my_custom_fact_can_be_used_now}
Conditional Imports
```````````````````
Sometimes you will want to do certain things differently in a playbook based on certain criteria.
Having one playbook that works on multiple platforms and OS versions is a good example.
As an example, the name of the Apache package may be different between CentOS and Debian,
but it is easily handled with a minimum of syntax in an Ansible Playbook::
---
- hosts: all
user: root
vars_files:
- "vars/common.yml"
- [ "vars/$facter_operatingsystem.yml", "vars/os_defaults.yml" ]
tasks:
- name: make sure apache is running
action: service name=$apache state=running
.. note::
The variable (`$facter_operatingsystem`) is being interpolated into
the list of filenames being defined for vars_files.
As a reminder, the various YAML files contain just keys and values::
---
# for vars/CentOS.yml
apache: httpd
somethingelse: 42
How does this work? If the operating system was 'CentOS', the first file Ansible would try to import
would be 'vars/CentOS.yml', followed up by '/vars/os_defaults.yml' if that file
did not exist. If no files in the list were found, an error would be raised.
On Debian, it would instead first look towards 'vars/Debian.yml' instead of 'vars/CentOS.yml', before
falling back on 'vars/os_defaults.yml'. Pretty simple.
To use this conditional import feature, you'll need facter or ohai installed prior to running the playbook, but
you can of course push this out with Ansible if you like::
# for facter
ansible -m yum -a "pkg=facter ensure=installed"
ansible -m yum -a "pkg=ruby-json ensure=installed"
# for ohai
ansible -m yum -a "pkg=ohai ensure=installed"
Ansible's approach to configuration -- seperating variables from tasks, keeps your playbooks
from turning into arbitrary code with ugly nested ifs, conditionals, and so on - and results
in more streamlined & auditable configuration rules -- especially because there are a
minimum of decision points to track.
Loops
`````
To save some typing, repeated tasks can be written in short-hand like so::
- name: add user $item
action: user name=$item state=present groups=wheel
with_items:
- testuser1
- testuser2
If you have defined a YAML list in a variables file, or the 'vars' section, you can also do::
with_items: $somelist
The above would be the equivalent of::
- name: add user testuser1
action: user name=testuser1 state=present groups=wheel
- name: add user testuser2
action: user name=testuser2 state=present groups=wheel
The yum and apt modules use with_items to execute fewer package manager transactions.
Selecting Files And Templates Based On Variables
````````````````````````````````````````````````
Sometimes a configuration file you want to copy, or a template you will use may depend on a variable.
The following construct selects the first available file appropriate for the variables of a given host,
which is often much cleaner than putting a lot of if conditionals in a template.
The following example shows how to template out a configuration file that was very different between, say,
CentOS and Debian::
- name: template a file
action: template src=$item dest=/etc/myapp/foo.conf
first_available_file:
- /srv/templates/myapp/${ansible_distribution}.conf
- /srv/templates/myapp/default.conf
Asynchronous Actions and Polling
````````````````````````````````
By default tasks in playbooks block, meaning the connections stay open
until the task is done on each node. If executing playbooks with
a small parallelism value (aka ``--forks``), you may wish that long
running operations can go faster. The easiest way to do this is
to kick them off all at once and then poll until they are done.
You will also want to use asynchronous mode on very long running
operations that might be subject to timeout.
To launch a task asynchronously, specify its maximum runtime
and how frequently you would like to poll for status. The default
poll value is 10 seconds if you do not specify a value for `poll`::
---
- hosts: all
user: root
tasks:
- name: simulate long running op (15 sec), wait for up to 45, poll every 5
action: command /bin/sleep 15
async: 45
poll: 5
.. note::
There is no default for the async time limit. If you leave off the
'async' keyword, the task runs synchronously, which is Ansible's
default.
Alternatively, if you do not need to wait on the task to complete, you may
"fire and forget" by specifying a poll value of 0::
---
- hosts: all
user: root
tasks:
- name: simulate long running op, allow to run for 45, fire and forget
action: command /bin/sleep 15
async: 45
poll: 0
.. note::
You shouldn't "fire and forget" with operations that require
exclusive locks, such as yum transactions, if you expect to run other
commands later in the playbook against those same resources.
.. note::
Using a higher value for ``--forks`` will result in kicking off asynchronous
tasks even faster. This also increases the efficiency of polling.
Local Playbooks
```````````````
It may be useful to use a playbook locally, rather than by connecting over SSH. This can be useful
for assuring the configuration of a system by putting a playbook on a crontab. This may also be used
to run a playbook inside a OS installer, such as an Anaconda kickstart.
To run an entire playbook locally, just set the "hosts:" line to "hosts:127.0.0.1" and then run the playbook like so::
ansible-playbook playbook.yml --connection=local
Alternatively, a local connection can be used in a single playbook play, even if other plays in the playbook
use the default remote connection type::
hosts: 127.0.0.1
connection: local
Turning Off Facts
`````````````````
If you know you don't need any fact data about your hosts, and know everything about your systems centrally, you
can turn off fact gathering. This has advantages in scaling ansible in push mode with very large numbers of
systems, mainly, or if you are using Ansible on experimental platforms. In any play, just do this::
- hosts: whatever
gather_facts: False
Pull-Mode Playbooks
```````````````````
The use of playbooks in local mode (above) is made extremely powerful with the addition of `ansible-pull`.
A script for setting up ansible-pull is provided in the examples/playbooks directory of the source
checkout.
The basic idea is to use Ansible 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 interverts the default push architecture of ansible into a pull
architecture, which has near-limitless scaling potential. The setup playbook can be tuned to change
the cron frequency, logging locations, and parameters to ansible-pull.
This is useful both for extreme scale-out as well as periodic remediation. Usage of the 'fetch' module to retrieve
logs from ansible-pull runs would be an excellent way to gather and analyze remote logs from ansible-pull.
Register Variables
``````````````````
.. versionadded:: 0.7
Often in a playbook it may be useful to store the result of a given command in a variable and access
it later. Use of the command module in this way can in many ways eliminate the need to write site specific facts, for
instance, you could test for the existance of a particular program.
The 'register' keyword decides what variable to save a result in. The resulting variables can be used in templates, action lines, or only_if statements. It looks like this (in an obviously trivial example)::
- name: test play
hosts: all
tasks:
- action: shell cat /etc/motd
register: motd_contents
- action: shell echo "motd contains the word hi"
only_if: "'${motd_contents.stdout}'.find('hi') != -1"
Rolling Updates
```````````````
.. versionadded:: 0.7
By default ansible will try to manage all of the machines referenced in a play in parallel. For a rolling updates
use case, you can define how many hosts ansible should manage at a single time by using the ''serial'' keyword::
- name: test play
hosts: webservers
serial: 3
In the above example, if we had 100 hosts, 3 hosts in the group 'webservers'
would complete the play completely before moving on to the next 3 hosts.
Delegation
``````````
.. versionadded:: 0.7
If you want to perform a task on one host with reference to other hosts, use the 'delegate_to' keyword on a task.
This is ideal for placing nodes in a load balanced pool, or removing them. It is also very useful for controlling
outage windows. Using this with the 'serial' keyword to control the number of hosts executing at one time is also
a good idea::
---
- hosts: webservers
serial: 5
tasks:
- name: take out of load balancer pool
action: command /usr/bin/take_out_of_pool $inventory_hostname
delegate_to: 127.0.0.1
- name: actual steps would go here
action: yum name=acme-web-stack state=latest
- name: add back to load balancer pool
action: command /usr/bin/add_back_to_pool $inventory_hostname
delegate_to: 127.0.0.1
Here is the same playbook as above, but using the shorthand syntax,
'local_action', for delegating to 127.0.0.1::
---
# ...
tasks:
- name: take out of load balancer pool
local_action: command /usr/bin/take_out_of_pool $inventory_hostname
# ...
- name: add back to load balancer pool
local_action: command /usr/bin/add_back_to_pool $inventory_hostname
Understanding Variable Precedence
`````````````````````````````````
You have already learned about inventory host and group variables, 'vars', and 'vars_files'.
If a variable name is defined in more than one place with the same name, priority is as follows
to determine which place sets the value of the variable.
1. Variables loaded from YAML files mentioned in 'vars_files' in a playbook.
2. 'vars' as defined in the playbook.
3. facts, whether built in or custom, or variables assigned from the 'register' keyword.
4. variables passed to parameterized task include statements.
5. Host variables from inventory.
6. Group variables from inventory, in order of least specific group to most specific.
Therefore, if you want to set a default value for something you wish to override somewhere else, the best
place to set such a default is in a group variable.
Style Points
````````````
Ansible playbooks are colorized. If you do not like this, set the ANSIBLE_NOCOLOR=1 environment variable.
Ansible playbooks also look more impressive with cowsay installed, and we encourage installing this package.
.. seealso::
:doc:`YAMLSyntax`
Learn about YAML syntax
:doc:`playbooks`
Review the basic playbook features
:doc:`bestpractices`
Various tips about 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

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ short_description: This is a sentence describing the module
description:
- Longer description of the module
- You might include instructions
version_added: 0.X
version_added: "X.Y"
author: Your AWESOME name here
notes:
- Other things consumers of your module should know
@ -26,8 +26,4 @@ options:
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
version_added: 1.X

View File

@ -1,89 +1,127 @@
# config file for ansible -- http://ansible.github.com
# nearly all parameters can be overridden in ansible-playbook or with command line flags
# ansible will read ~/.ansible.cfg or /etc/ansible/ansible.cfg, whichever it finds first
# config file for ansible -- http://ansibleworks.com/
# ==================================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ~/.ansible.cfg,
# ansible.cfg in the current working directory or
# /etc/ansible/ansible.cfg, whichever it finds first
[defaults]
# location of inventory file, eliminates need to specify -i
# some basic default values...
hostfile = /etc/ansible/hosts
hostfile = /etc/ansible/hosts
library = /usr/share/ansible
remote_tmp = $HOME/.ansible/tmp
pattern = *
forks = 5
poll_interval = 15
sudo_user = root
#ask_sudo_pass = True
#ask_pass = True
transport = smart
remote_port = 22
# location of ansible library, eliminates need to specify --module-path
# uncomment this to disable SSH key host checking
#host_key_checking = False
library = /usr/share/ansible
# change this for alternative sudo implementations
sudo_exe = sudo
# default module name used in /usr/bin/ansible when -m is not specified
# what flags to pass to sudo
#sudo_flags = -H
module_name = command
# SSH timeout
timeout = 10
# home directory where temp files are stored on remote systems. Should
# almost always contain $HOME or be a directory writeable by all users
# default user to use for playbooks if user is not specified
# (/usr/bin/ansible will use current user as default)
#remote_user = root
remote_tmp = $HOME/.ansible/tmp
# logging is off by default unless this path is defined
# if so defined, consider logrotate
#log_path = /var/log/ansible.log
# the default pattern for ansible-playbooks ("hosts:")
# default module name for /usr/bin/ansible
#module_name = command
pattern = *
# use this shell for commands executed under sudo
# you may need to change this to bin/bash in rare instances
# if sudo is constrained
#executable = /bin/sh
# the default number of forks (parallelism) to be used. Usually you
# can crank this up.
# if inventory variables overlap, does the higher precedence one win
# or are hash values merged together? The default is 'replace' but
# this can also be set to 'merge'.
#hash_behaviour = replace
forks=5
# How to handle variable replacement - as of 1.2, Jinja2 variable syntax is
# preferred, but we still support the old $variable replacement too.
# Turn off ${old_style} variables here if you like.
#legacy_playbook_variables = yes
# the timeout used by various connection types. Usually this corresponds
# to an SSH timeout
# list any Jinja2 extensions to enable here:
#jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n
timeout=10
# if set, always use this private key file for authentication, same as
# if passing --private-key to ansible or ansible-playbook
#private_key_file = /path/to/file
# when using --poll or "poll:" in an ansible playbook, and not specifying
# an explicit poll interval, use this interval
poll_interval=15
# when specifying --sudo to /usr/bin/ansible or "sudo:" in a playbook,
# and not specifying "--sudo-user" or "sudo_user" respectively, sudo
# to this user account
sudo_user=root
# connection to use when -c <connection_type> is not specified
transport=paramiko
# remote SSH port to be used when --port or "port:" or an equivalent inventory
# variable is not specified.
remote_port=22
# if set, always run /usr/bin/ansible commands as this user, and assume this value
# if "user:" is not set in a playbook. If not set, use the current Unix user
# as the default
#remote_user=root
# if set, always use this private key file for authentication, same as if passing
# --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
# format of string {{ ansible_managed }} available within Jinja2
# templates indicates to users editing templates files will be replaced.
# replacing {file}, {host} and {uid} and strftime codes with proper values.
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
# by default (as of 1.3), Ansible will raise errors when attempting to dereference
# Jinja2 variables that are not set in templates or action lines. Uncomment this line
# to revert the behavior to pre-1.3.
#error_on_undefined_vars = False
# set plugin path directories here, seperate with colons
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
# don't like cows? that's unfortunate.
# set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1
#nocows = 1
# don't like colors either?
# set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1
#nocolor = 1
[paramiko_connection]
# nothing to configure yet
# uncomment this line to cause the paramiko connection plugin to not record new host
# keys encountered. Increases performance on new host additions. Setting works independently of the
# host key checking setting above.
#record_host_keys=False
[ssh_connection]
# if uncommented, sets the ansible ssh arguments to the following. Leaving off ControlPersist
# will result in poor performance, so use transport=paramiko on older platforms rather than
# removing it
# ssh arguments to use
# Leaving off ControlPersist will result in poor performance, so use
# paramiko on older platforms rather than removing it
#ssh_args = -o ControlMaster=auto -o ControlPersist=60s
ssh_args=-o PasswordAuthentication=no -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
# The path to use for the ControlPath sockets. This defaults to
# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with
# very long hostnames or very long path names (caused by long user names or
# deeply nested home directories) this can exceed the character limit on
# file socket names (108 characters for most platforms). In that case, you
# may wish to shorten the string below.
#
# Example:
# control_path = %(directory)s/%%h-%%r
#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r
# if True, make ansible use scp if the connection type is ssh
# (default is sftp)
#scp_if_ssh = True
[accelerate]
accelerate_port = 5099

View File

@ -0,0 +1,7 @@
Playbook Examples
=================
Playbook examples have moved.
See [the Ansible-Examples repo](https://github.com/ansible/ansible-examples).

View File

@ -1,56 +0,0 @@
# ansibple-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
# usual push-based operating mode.
#
# This particular pull based mode is ideal for:
#
# (A) massive scale out
# (B) continual system remediation
#
# DO NOT RUN THIS AGAINST YOUR HOSTS WITHOUT CHANGING THE repo_url
# TO SOMETHING YOU HAVE PERSONALLY VERIFIED
#
#
---
- hosts: pull_mode_hosts
user: root
vars:
# 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
# Repository to check out -- YOU MUST CHANGE THIS
# repo must contain a local.yml file at top level
#repo_url: git://github.com/sfromm/ansible-playbooks.git
repo_url: SUPPLY_YOUR_OWN_GIT_URL_HERE
tasks:
- name: Install ansible
action: yum pkg=ansible state=installed
- name: Create local directory to work from
action: file path=$workdir state=directory owner=root group=root mode=0751
- name: Copy ansible inventory file to client
action: copy src=/etc/ansible/hosts dest=/etc/ansible/hosts
owner=root group=root mode=0644
- name: Create crontab entry to clone/pull git repository
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

@ -1,19 +0,0 @@
# ordinarily, without the 'serial' keyword set, ansible will control all of your machines in a play at once, in parallel.
# if you want to perform a rolling update, so that each play completes all the way through on a certain number of hosts
# before moving on to the remaining hosts, use the 'serial' keyword like so:
---
- hosts: all
serial: 3
# now each of the tasks below will complete on 3 hosts before moving on to the next 3, regardless of how many
# hosts are selected by the "hosts:" line
tasks:
- name: ping
action: ping
- name: ping2
action: ping

View File

@ -1,51 +0,0 @@
---
# this is a demo of conditional imports. This is a powerful concept
# and can be used to use the same recipe for different types of hosts,
# based on variables that bubble up from the hosts from tools such
# as ohai or facter.
#
# Here's an example use case:
#
# what to do if the service for apache is named 'httpd' on CentOS
# but is named 'apache' on Debian?
# there is only one play in this playbook, it runs on all hosts
# as root
- hosts: all
user: root
# we have a common list of variables stored in /vars/external_vars.yml
# that we will always import
# next, we want to import files that are different per operating system
# and if no per operating system file is found, load a defaults file.
# for instance, if the OS was "CentOS", we'd try to load vars/CentOS.yml.
# if that was found, we would immediately stop. However if that wasn't
# present, we'd try to load vars/defaults.yml. If that in turn was not
# found, we would fail immediately, because we had gotten to the end of
# the list without importing anything.
vars_files:
- "vars/external_vars.yml"
- [ "vars/$facter_operatingsystem.yml", "vars/defaults.yml" ]
# and this is just a regular task line from a playbook, as we're used to.
# but with variables in it that come from above. Note that the variables
# from above are *also* available in templates
tasks:
- name: ensure apache is latest
action: $packager pkg=$apache state=latest
- name: ensure apache is running
action: service name=$apache state=running
- name: fail
action: command /bin/false

View File

@ -1,47 +0,0 @@
---
# this is a demo of conditional executions using 'only_if', which can skip
# certain tasks on machines/platforms/etc where they do not apply.
- 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:
#
# 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...
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

@ -1,39 +0,0 @@
---
# this is an example of how we can perform actions on a given host on behalf of all the hosts
# in a play.
#
# The two main uses of this would be signalling an outage window for hosts that
# we are going to start upgrading, or to take a machine out of rotation by talking to a load
# balancer.
#
# This example cheats by replacing the load balancer script with the 'echo' command,
# leaving actual communication with the load balancer as an exercise to the reader. In reality,
# you could call anything you want, the main thing is that it should do something with
# $inventory_hostname
# NOTE: see batch_size_control.yml for an example of the 'serial' keyword, which you almost certainly
# want to use in this kind of example. Here we have a mocked up example that does something to
# 5 hosts at a time
- hosts: all
serial: 5
tasks:
- name: take the machine out of rotation
action: command echo taking out of rotation $inventory_hostname
delegate_to: 127.0.0.1
# here's an alternate notation if you are delegating to 127.0.0.1, you can use 'local_action'
# instead of 'action' and leave off the 'delegate_to' part.
#
# - local_action: command echo taking out of rotation $inventory_hostname
- name: do several things on the actual host
action: command echo hi mom $inventory_hostname
- name: put machine back into rotation
action: command echo inserting into rotation $inventory_hostname
delegate_to: 127.0.0.1

View File

@ -1,18 +0,0 @@
---
# This is a demo of how to manage the selinux context using the file module
- hosts: test
user: root
tasks:
- name: Change setype of /etc/exports to non-default value
action: file path=/etc/exports setype=etc_t
- name: Change seuser of /etc/exports to non-default value
action: file path=/etc/exports seuser=unconfined_u
- name: Set selinux context back to default value
action: file path=/etc/exports context=default
- name: Create empty file
action: command /bin/touch /tmp/foo
- name: Change setype of /tmp/foo
action: file path=/tmp/foo setype=default_t
- name: Try to set secontext to default, but this will fail
because of the lack of a default in the policy
action: file path=/tmp/foo context=default

View File

@ -1,16 +0,0 @@
---
- hosts: webservers
vars:
- jquery_directory: /var/www/html/javascript
- person: 'Susie%20Smith'
tasks:
- name: Create directory for jQuery
action: file dest=${jquery_directory} state=directory mode=0755
- name: Grab a bunch of jQuery stuff
action: get_url url=http://code.jquery.com/$item dest=${jquery_directory} mode=0444
with_items:
- jquery.min.js
- mobile/latest/jquery.mobile.min.js
- ui/jquery-ui-git.css
#- name: Pass urlencoded name to CGI
# action: get_url url=http://example.com/name.cgi?name='${person}' dest=/tmp/test

View File

@ -1,18 +0,0 @@
---
# This is a demo of how the group command works.
- hosts: all
user: root
sudo: True
tasks:
# Walk through group creation, modification, and deletion
- name: create a group
action: group name=tset
# You can only modify the group's gid
- action: group name=tset gid=7777
# And finally remove the group
- action: group name=tset state=absent

View File

@ -1,10 +0,0 @@
---
# this is an example to show that handlers can be included from yaml files,
# to promote reuse between different plays or even playbooks. They work
# just like normal handlers.
- name: restart apache
action: service name=httpd state=restarted
- name: restart memcached
action: service name=memcached state=restarted

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