Compare commits

..

69 Commits

Author SHA1 Message Date
cb4b196288 Version bump for 1.6.5 2014-06-25 21:10:25 -05:00
8ed484c544 Additional fixes for safe_eval 2014-06-25 21:07:41 -05:00
cc4129f6a1 Version bump for 1.6.4 2014-06-25 14:20:46 -05:00
c35bbdaa21 Assert the MOCK_CFG exists for the mock-rpm build target 2014-06-25 14:15:31 -05:00
84c40fc111 Add support for rpm builds through mock 2014-06-25 14:15:26 -05:00
2c6c1b99c7 Correct Makefile variable usage 2014-06-25 14:02:58 -05:00
2aa7ce006f Updated DEB build workflow
Updates to Makefile include:
 * add targets: deb-src, deb-src-upload, deb-upload
 * add variables to control DEB building: DEBUILD_OPTS, DPUT_OPTS, DEB_PPA, DEB_DIST, DEB_RELEASE
 * create deb files for all release values in DEB_DIST

Several updates to packaging/debian/*
 * Updated control file
 * Whitespace/formatting of changelog

Add deb-build to .gitignore
2014-06-25 14:02:46 -05:00
b8b96b2109 Change safe_eval to a strict white list 2014-06-25 14:00:49 -05:00
dffea7f877 Version bump and CHANGELOG/RELEASES update for 1.6.3 2014-06-09 14:30:07 -05:00
7059528059 Cleaning up svr4pkg commit fix for #7645 2014-06-09 14:14:13 -05:00
fadf02d0c6 fix for svr4pkg module failure reporting, issue #7645 2014-06-09 14:14:09 -05:00
3ebecdd1ed Fixing mysql master replication boolean
Fixes #7528
2014-06-09 14:14:06 -05:00
58a0bcbe51 Fix issue with symlink path detection
Fixes #7627
Fixes #7664
2014-06-09 14:14:02 -05:00
10074d3622 Fix linking issue to directories in file module
The os.path.isdir() returns True for symlinks that point to directories,
so we also need to check to make sure it's not a symlink too.

Fixes #7657
2014-06-09 14:13:55 -05:00
2625196f5d Fix error passing play vars to an included playbook with empty vars
Fixes #7658
2014-06-09 14:13:50 -05:00
e85a9abe75 Fix order of merging variables for the combined cache
Fixes #7598
2014-06-09 14:13:18 -05:00
b99ea2723a Removing cruft leftover from the deprecation of include+with_items
Also cleaning up integration tests that had checks for the empty item
attribute in certain results.

Fixes #7535
2014-06-09 14:11:21 -05:00
7cb7fdc2a7 fixing problem where ansible would error out because Amazon was saying the group didnt exist yet (needed to wait a few more seconds for amazon to propagate correctly) 2014-06-09 14:11:12 -05:00
936e1de18b Fix error when using os.getlogin() without a tty 2014-06-09 14:11:08 -05:00
c4b6c0ab84 Fix typo in CHANGE MASTER TO syntax 2014-06-09 14:11:05 -05:00
4dd5eeb1c4 Ensure there are no duplicates in the merged/intersected lists 2014-06-09 14:11:01 -05:00
d8c8c0823a Merge and intersect lists without using sets.
Using sets for these operations is dangerous because sets cannot contain
certain object types (such as lists) and their iteration order is
undefined.

Fixes #7596
2014-06-09 14:10:57 -05:00
3801be693b dont mutate inventory vars 2014-06-09 14:10:53 -05:00
75adb3978b Check groupnames for None as well as an empty string in add_host
Fixes #7585
2014-06-09 14:10:48 -05:00
4e4ffa669a Correctly examine path for relative links in file module
Fixes #7515
Fixes #7537
2014-06-09 14:10:44 -05:00
ce80c0b8af Support checking for su user to atomic_move
Fixes #7553
2014-06-09 14:10:40 -05:00
b50a64b0a1 Correct issue of handlers running on all hosts incorrectly
Also adds an integration test to catch this bug in the future.

Fixes #7559
2014-06-09 14:10:35 -05:00
adfbcb8760 now module searches for update-alternatives vs hardcoding it 2014-06-09 14:10:29 -05:00
5128bced6b Don't use listify_ function, when all we want to do is template variables
This was causing a bug in the env module, due to the fact that we now
pass variables for the module through the templating engine combined
with the fact that we split-up the hostvars and setup variables. As a
result, if a variable in the env lookup had the same name as the variable
in Ansible, it would try and template itself over and over again until
the recursion limit would be hit, at which time an empty string was
returned.

Fixes #7396
2014-06-09 14:10:24 -05:00
549f67c0d8 Merge pull request #7527 from hlieberman/release1.6.2
Remove colon which breaks installation of 1.6.2.
2014-05-25 13:06:39 -04:00
d98b6ae8ab Remove colon which breaks installation of 1.6.2.
Rework the description so that it doesn't require the colon, rather
than just wrapping it in quotes.
2014-05-23 20:15:18 -04:00
ce4883bcc5 Version bump for 1.6.2 2014-05-23 15:37:57 -05:00
a75a84b44a Don't re-query inventory when trimming failed/dark hosts
Since the filter list contains hosts, passing that back to list_hosts()
in the inventoy causes issues when the hostname is an IPv6 address
(with :'s interpreted as group unions). Since we already have the list
of hosts, we should not need to pass that back through inventory a
second time.

Fixes #7446
2014-05-23 15:28:42 -05:00
f132e99b2a Adding the capability to proxy the ssl cert check
The ssl cert check will now respect the http and https proxy
environment settings. The url may also have the username/password
embedded, in which case basic auth will be used to connect to the
proxy server.

Fixes #7413
2014-05-23 15:27:05 -05:00
4d0ce5bd41 Make sure dwim'd relative path ends in a "/" if the original does
Fixes #7296
2014-05-23 15:17:43 -05:00
b01da1b780 Ensure the validation string has %s in it 2014-05-21 16:16:48 -05:00
1248d2ce8a Fixing absolute path calculation for file module when linking
Fixes #7403
2014-05-21 15:00:21 -05:00
d72cd70cc8 Also set the environment variables when resetting the locale to C 2014-05-21 15:00:05 -05:00
362626d07c Default use_proxy to True for fetch_url()
Also added some error handling to the fetch_url() call in the
apt_repository module, so that failures to look up the PPA info
are properly handled.

Fixes #7322
2014-05-21 14:59:58 -05:00
a54b8764fa Reset locale to 'C' if the specified one is invalid
Fixes #7448
2014-05-21 14:59:51 -05:00
6b4584d004 Remove erroneous set of status_code causing a traceback in module uri
Fixes #7416
2014-05-21 14:59:43 -05:00
cb0842ab49 docker: fix targetting images by name 2014-05-21 14:59:32 -05:00
2432b45eb1 Fixed extension filtering in InventoryDirectory 2014-05-21 14:59:29 -05:00
d6214c5d56 Check module_path permissions when creating ssh_wrapper for git
If the module directory is not writable/executable to the current user
(most likely because of a sudo to a non-root user), the ssh_wrapper
will be created in the default location for mkstemp() calls. To facilitate
the deletion of these new files, a new mechanism for cleaning up files
created by the module was also added.

Fixes #7375
2014-05-21 14:59:20 -05:00
c5b6d23c63 During vsphere config check attempt cast before marking values missing
Fixes #7385
2014-05-21 14:59:13 -05:00
e83f14200c Fix env splitting in docker module
ENV variable value could contain '=' (for example mysql://host/db?pool=10)
2014-05-21 14:59:05 -05:00
7c0431b1e4 Add missing basedir to Runner in _do_setup_step 2014-05-21 14:58:58 -05:00
1c5055a401 Properly merge role conditionals in with pre-existing conditionals
Fixes #7387
2014-05-21 14:58:49 -05:00
24d885e368 Fix to unescape * was discarded by unescape of @
`decoded_name` was created twice, each from `rset.name`

So, the second call to `.replace(r'\100', '@')` overwrites decoded_name, discarding the result of the call to `.replace(r'\052', '*')`

I had a problem with wildcard domains that was fixed by this patch.
2014-05-21 14:57:23 -05:00
8851ceaa9e Use the existing module_vars during the templating of module_vars
Since some of the vars contained in there may be used in the templating
of other variables. This also reverts e83a494 which originally fixed
issue #6979 but broke some other variable related things.

Fixes #6979
Fixes #7321
Fixes #7332
2014-05-21 14:56:59 -05:00
854bf14222 Evaluate changed_when only if task is not skipped
Fixes #7405
2014-05-21 14:55:45 -05:00
d8526a6c80 Only chown on atomic move if the uid/gid don't match the src/tmp file
This is a corner case for remote file systems that don't support
chown() and where the source and destination for the atomic_move
are on that remote file system.

Fixes #7372
2014-05-21 14:55:39 -05:00
e0fe6ca5d8 Use utils.combine_vars on vars_files data
Fixes #7345
2014-05-21 14:55:35 -05:00
ca2a12aa5b Pass vars_files on to included playbooks too
Fixes #7384
2014-05-21 14:55:29 -05:00
29018cf2a7 Correctly initialize combined_cache for hosts if setup is skipped
Fixes #7364
2014-05-21 14:55:24 -05:00
9d8eee633d Make sure the docker data has a "Names" field before using it
Fixes #7363
2014-05-21 14:55:20 -05:00
8cc71a6eec Do not base synchronize source on the inventory directory 2014-05-21 14:55:01 -05:00
3565249471 Fix: Remove check for Ghost state
This fixed the just committed change handling non existent Ghost state.
2014-05-21 14:53:39 -05:00
595813a1fe Remove check for Ghost state
This doesn't exist anymore and causes ansible to throw a KeyError
2014-05-21 14:53:34 -05:00
0de306574e rds module: Fix undeclared reference to "params" when setting password in
modify mode.
2014-05-21 14:53:28 -05:00
d33486d52a ec2: Fix bug with running/stopped state and wait=yes.
If `get_all_instances` returns multiple reservations, the old wait loop only
dealt with the first reservation. Thus, the wait loop may end before all
instances get to be running/stopped.

Also clean up the code a little.
2014-05-21 14:53:23 -05:00
0dabb37337 Make sure the default ec2_group egress rule is not removed
Upon a second run, the default egress rule will be removed when a
vpc is specified but no other egress rules were set. This patch
corrects that behavior by removing the default egress rule from the
list of unmatched outbound rules.

Fixes #7309
2014-05-21 14:53:18 -05:00
9a930fb481 Add pyc/pyo to ignore list for inventory directories
Fixes #7308
2014-05-21 14:53:09 -05:00
d4e11c5c69 Version bump for 1.6.1 release 2014-05-07 12:33:07 -05:00
08f4984d92 Add integration tests for group_by module. Fixed bug introduced by ansible/ansible#7273 while also fixing issue described in ansible/ansible#6953 2014-05-07 09:12:30 -05:00
7daaabdedb Close fds when running commands from the accelerate daemon
Fixes #7307
2014-05-07 08:26:06 -05:00
9943c50863 Make sure distro variable is set if python-apt is installed
Fixes #7295
2014-05-07 08:25:58 -05:00
ce15813e70 made enabled/disabled checks of apache2_module workable 2014-05-07 08:25:50 -05:00
f05d457560 Updating changlog and releases for 1.6 2014-05-05 16:46:31 -05:00
9265 changed files with 116912 additions and 1180164 deletions

View File

@ -1,25 +0,0 @@
# This configuration file is used for manual execution of coverage
# as well as for tests run through ansible-test.
[run]
branch = True
# Enable concurrency. This also enables parallel mode, which results in
# multiple coverage files being created. Concurrency allows us to collect
# results from multiple tests simultaneously, as well as supporting multiple
# test runs, such as from integration tests.
concurrency = multiprocessing
parallel = True
# When running tests through ansible-test, this option is overridden by
# the COVERAGE_FILE environment variable. This option is present for
# convenience when running coverage manually from this directory.
data_file = test/results/coverage/coverage
# Don't collect or report code coverage from files matching these patterns.
omit =
*/python*/dist-packages/*
*/python*/site-packages/*
*/python*/distutils/*
*/pyshared/*
*/pytest

4
.gitattributes vendored
View File

@ -1,4 +0,0 @@
CHANGELOG.md merge=union
.github/ export-ignore
hacking/ export-ignore
ticket-stubs/ export-ignore

1275
.github/BOTMETA.yml vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
# Community Code of Conduct
Please see the official [Ansible Community Code of Conduct](http://docs.ansible.com/ansible/latest/community.html#community-code-of-conduct).

View File

@ -1,64 +0,0 @@
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and devel branch are affected too.
-->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bug Report
- Feature Idea
- Documentation Report
##### COMPONENT NAME
<!---
Name of the module, plugin, task or feature
Do not include extra details here, e.g. "vyos_command" not "the network module vyos_command" or the full path
-->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
```
##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"
Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->
##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
##### SUMMARY
<!--- Explain the problem briefly -->
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
```
<!--- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
<!--- Paste verbatim command output between quotes below -->
```
```

View File

@ -1,37 +0,0 @@
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
commit message and your description; but you should still explain what
the change does.
-->
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
- New Module Pull Request
- Bugfix Pull Request
- Docs Pull Request
##### COMPONENT NAME
<!--- Name of the module, plugin, module or task -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
```
##### ADDITIONAL INFORMATION
<!---
Include additional information to help people understand the change here.
For bugs that don't have a linked bug report, a step-by-step reproduction
of the problem is helpful.
-->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```
```

73
.gitignore vendored
View File

@ -2,10 +2,9 @@
*.py[co]
build
AUTHORS.TXT
# Emacs backup and autosave files...
# Emacs backup files...
*~
.\#*
\#*
# RPM stuff...
MANIFEST
dist
@ -17,86 +16,38 @@ rpm-build
.idea
#IntelliJ IDEA stuff..
*.iml
#VSCode stuff..
.vscode/
# Mac OS X stuff...
.DS_Store
# manpage build stuff...
docs/man/man1/ansible*.1
docs/man/man1/ansible*.1.asciidoc.in
docs/man/man3/*
# Sublime stuff
*.sublime-project
*.sublime-workspace
# docsite stuff...
docs/api/_build/
docs/api/rst/
docs/docsite/_build
docs/docsite/*.html
docs/docsite/htmlout
docs/docsite/rst/cli/ansible-*.rst
docs/docsite/rst/cli/ansible.rst
docs/docsite/rst/modules/*.rst
docs/docsite/rst/playbooks_directives.rst
docs/docsite/rst/plugins_by_category.rst
docs/docsite/rst/plugins/*/*.rst
docs/docsite/rst/reference_appendices/config.rst
docs/docsite/rst/reference_appendices/playbooks_keywords.rst
docs/docsite/rst_warnings
docs/docsite/searchindex.js
docs/docsite/_static/*.gif
docs/docsite/_static/*.png
docs/docsite/_static/websupport.js
docsite/rst/modules_by_category.rst
docsite/rst/list_of_*.rst
docsite/rst/*_module.rst
docsite/*.html
docsite/_static/*.gif
docsite/_static/*.png
docsite/_static/websupport.js
docsite/searchindex.js
docsite/htmlout
# deb building stuff...
/debian/
debian/
deb-build
# Vim swap files
*.swp
*.swo
credentials.yml
# test output
*.retry
*.out
.tox
.cache
.coverage
results.xml
coverage.xml
/test/units/cover-html
/test/integration/targets/*/backup/
/test/cache/*
# Development
/test/develop
venv
Vagrantfile
.vagrant
ansible.egg-info/
/shippable/
/test/integration/cloud-config-*.*
!/test/integration/cloud-config-*.*.template
# Release directory
packaging/release/ansible_release
/.cache/
/test/results/coverage/*=coverage.*
/test/results/coverage/coverage*
/test/results/reports/coverage*.xml
/test/results/reports/coverage*/
/test/results/bot/*.json
/test/results/junit/*.xml
/test/results/logs/*.log
/test/results/data/*.json
/test/integration/inventory.remote
/test/integration/inventory.networking
/test/integration/inventory.winrm
/test/integration/cloud-config-aws.yml
/test/integration/cloud-config-cs.ini
# python 'rope' stuff
.ropeproject
# local 'ack' config files
.ackrc
# default 'coverage html' results
htmlcov/
# default 'coverage' tool data
.coverage
# ansible-test coverage results
test/units/.coverage.*
/test/integration/cloud-config-azure.yml

View File

@ -1,36 +0,0 @@
Michael DeHaan <michael.dehaan@gmail.com> <michael@ansibleworks.com>
Michael DeHaan <michael.dehaan@gmail.com> Michael DeHaan <michael@ansibleworks.com>
Michael DeHaan <michael.dehaan@gmail.com> <michael@ansible.com>
<bcoca@ansible.com> <brian.coca+git@gmail.com>
<bcoca@ansible.com> <briancoca+ansible@gmail.com>
<bcoca@ansible.com> <briancoca+dev@gmail.com>
<bcoca@ansible.com> <bcoca@tablethotels.com>
<a.badger@gmail.com> <toshio@fedoraproject.org>
James Tanner <tanner.jc@gmail.com>
<jimi@sngx.net> <jcammarata@ansibleworks.com>
Michael Scherer <misc@zarb.org> mscherer <misc@zarb.org>
<misc@zarb.org> <misc@ephaone.org>
<misc@zarb.org> <mscherer@users.noreply.github.com>
James Martin <jmartin@ansible.com> <jmartin@basho.com>
James Laska <jlaska@ansible.com> <jlaska@redhat.com>
James Laska <jlaska@ansible.com> <jlaska@ansibleworks.com>
James Laska <jlaska@ansible.com> <jlaska@James-Laskas-MacBook-Pro.local>
James Laska <jlaska@ansible.com> <jlaska@users.noreply.github.com>
Jason McKerr <mckerrj@gmail.com> <jmckerr@jmckerr-OSX.local>
Chris Houseknecht <chouseknecht@ansible.com>
Chris Houseknecht <chouseknecht@ansible.com> chouseknecht <chouse@ansible.com>
Chris Houseknecht <chouseknecht@ansible.com> Chris Houseknecht <chouse@ansibleworks.com>
Stephen Fromm <sfromm@gmail.com> Stephen Fromm <stephenf@nero.net>
Sandra Wills <docschick@ansible.com> Sandra Wills <swills@ansible.com>
Will Thames <will@thames.id.au> willthames <will@thames.id.au>
Will Thames <will@thames.id.au> Will Thames <willdthames@gmail.com>
Will Thames <will@thames.id.au> willthames <willdthames@gmail.com>
Will Thames <will@thames.id.au> willthames <will@musc.org.uk>
Will Thames <will@thames.id.au> u348095 <will.thames@suncorp.com.au>
Will Thames <will@thames.id.au> willthames <will.thames@suncorp.com.au>
Will Thames <will@thames.id.au> Will Thames <will.thames@xvt.com.au>
nitzmahone <mdavis@ansible.com> Matt Davis <nitzmahone@users.noreply.github.com>
Dag Wieers <dag@wieers.com> Dag Wieërs <dag@wieers.com>
Dag Wieers <dag@wieers.com> Dag Wieers <dag.wieers@gmail.com>
Rene Moser <mail@renemoser.net> René Moser <mail@renemoser.net>
Rene Moser <mail@renemoser.net> Rene Moser <rene.moser@swisstxt.ch>

View File

@ -1 +0,0 @@
test/sanity/yamllint/config/default.yml

1298
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
Per-version CHANGELOGS can be found `here <changelogs/>`_.

View File

@ -1,10 +1,10 @@
Coding Guidelines
=================
Hi! Thanks for your interest in contributing to Ansible.
Hi! Thanks for interest in contributing to Ansible.
Here are some guidelines for contributing code. The purpose of this document is to establish what we're looking for in code contributions, and to make sure
new contributors know some of the conventions that we've been using.
Here are some guidelines for contributing code. The purpose of this document are to establish what we're looking for in code contributions, and to make sure
new contributions know some of the conventions that we've been using.
We don't think much of this should be too strange to readers familiar with contributing to Python projects, though it helps if we all get on the same page.
@ -14,16 +14,16 @@ Language
* While not all components of Ansible must be in Python, core contributions to the Ansible repo must be written in Python. This is to maximize the ability of everyone to contribute.
* If you want to write non-Python ansible modules or inventory scripts, that's fine, but they are not going to get merged in most likely. Sorry!!
PEP 8 and basic style checks
============================
PEP8 and basic style checks
===========================
* [PEP 8](https://www.python.org/dev/peps/pep-0008/) is a great Python style guide, which you should read.
* PEP 8 must not be strictly followed in all aspects, but most of it is good advice.
* The line is limited to 160 characters.
* To run checks for things we care about, use [ansible-test](http://docs.ansible.com/ansible/dev_guide/testing_pep8.html#running-locally).
* Similarly, additional checks can be made with "make pyflakes".
* There is no need to submit code changes for PEP 8 and pyflakes fixes, as these break attribution history. Project leadership will make these periodically.
* Do not submit pull requests that simply adjust whitespace in the code.
* PEP8 is a great Python style guide, which you should read.
* PEP8 must not be strictly followed in all aspects, but most of it is good advice
* In particular, we don't really care about line lengths. Buy a bigger monitor!
* To run checks for things we care about, run "make pep8"
* Similarly, additional checks can be made with "make pyflakes"
* There is no need to submit code changes for pep8 and pyflake fixes, as these break attribution history. Project leadership will make these periodically.
* Do not submit pull requests that simply adjust whitespace in the code
Testing
=======
@ -32,7 +32,7 @@ Testing
* That being said, there are unit tests too!
* Code written must absolutely pass tests (i.e. "make tests")
* You should anticipate any error paths in your code and test down those error paths.
* Additions to tests for core code are welcome, but not always possible. Be sure things are at least well tested manually in that case.
* Additions to tests for core code is welcome, but not always possible. Be sure things are at least well tested manually in that case.
Whitespace
==========
@ -74,7 +74,7 @@ Functions and Methods
Variables
=========
* Use descriptive variable names instead of variables like 'x', unless x is an obvious loop index
* Use descriptive variable names instead of variables like 'x', unless x is a obvious loop index
* Ansible python code uses identifiers like 'ClassesLikeThis and variables_like_this
* Module parameters should also use_underscores and not runtogether
@ -83,7 +83,7 @@ Module Security
* Modules must take steps to avoid passing user input from the shell and always check return codes
* always use module.run_command instead of subprocess or Popen or os.system -- this is mandatory
* if you need to use the shell you must pass use_unsafe_shell=True to module.run_command
* if you use need the shell you must pass use_unsafe_shell=True to module.run_command
* if you do not need the shell, avoid using the shell
* any variables that can come from the user input with use_unsafe_shell=True must be wrapped by pipes.quote(x)
* downloads of https:// resource urls must import module_utils.urls and use the fetch_url method
@ -101,26 +101,26 @@ Use the dict constructor where possible when allocating dictionaries:
# this:
foo = dict(
a=12,
b=34,
a = 12,
b = 34
)
Do not line up variables
Line up variables
# not this
a = 12
foosball = 34
xyz = 'dog'
# this
a = 12
foosball = 34
xyz = 'dog'
# this
a = 12
foosball = 34
xyz = 'dog'
Don't use line continuations:
# no
if (this_is_a_very_long_line and foo and \
if (this_is_a_very_long_line and foo and /
i_am_going_to_continue_it):
bar()
@ -131,13 +131,13 @@ Don't use line continuations:
Spacing:
# no
x = [1,2,3]
x=[1,2,3]
# no
x = [ 1, 2, 3 ]
x = [1,2,3]
# yes
x = [1, 2, 3]
x = [ 1, 2, 3 ]
Spacing continued:
@ -277,8 +277,7 @@ To test if something is a string, consider that it may be unicode.
if type(x) == str:
# yes
from ansible.module_utils.six import string_types
if isinstance(x, string_types):
if isinstance(x, basestring):
Cleverness
==========
@ -294,7 +293,7 @@ Pull requests cannot be accepted that contain merge commits.
Always do "git pull --rebase" and "git rebase" vs "git pull" or "git merge".
Always create a new branch for each pull request to avoid intermingling different features or fixes on the same branch.
Always create a new branch for each pull request to avoid intertwingling different features or fixes on the same branch.
Python Version Compliance
@ -302,7 +301,7 @@ Python Version Compliance
All code in Ansible core must support a minimum version of Python 2.6.
Module code must support a minimum of Python 2.4, with occasional exceptions for modules that require code that themselves require 2.6 and later.
Module code must support a minimum of Python 2.4, with occasional exception for modules that require code that themselves require 2.6 and later.
A quick reminder is that list comprehensions in Python 2.4 are not as fully fleshed out, there are no 'dict' comprehensions, and there is no 'with' statement.
But otherwise it's pretty much all the same.
@ -314,3 +313,7 @@ This was not meant to be a scary document, so we hope it wasn't, but we also hop
If you have questions about this document, please ask on the ansible-devel mailing list.
Thank you!

View File

@ -1,29 +1,224 @@
# WELCOME TO ANSIBLE GITHUB
Ansible Community Information
==============================
Hi! Nice to see you here!
The purpose of the Ansible community is to unite developers, system administrators, operations, and
IT managers to share and build great automation solutions. This document contains all sorts of
information about how to contribute and interact with Ansible. Welcome!
Ways to Interact
================
There are a lot of ways to join and be a part of the Ansible community, such as:
Sharing Ansible with Others
---------------------------
You can help share Ansible with others by telling friends and colleagues, writing a blog post,
or presenting at user groups (like DevOps groups or the local LUG or BUG). You are also
welcome to share slides on speakerdeck, sign up for a free account and tag it “Ansible”. On Twitter,
you can also share things with #ansible and may wish
to follow [@Ansible](https://twitter.com/ansible).
Sharing Content and Tips
------------------------
Join the [Ansible project mailing list](https://groups.google.com/forum/#!forum/ansible-project) and you
can share playbooks you may have written and other interesting implementation stories. Put your Ansible
content up on places like github to share with others.
Sharing A Feature Idea
----------------------
Ideas are very welcome and the best place to share them is the [Ansible project mailing list](https://groups.google.com/forum/#!forum/ansible-project) ([Subscribe](https://groups.google.com/forum/#!forum/ansible-project/join)) or #ansible on irc.freenode.net.
While you can file a feature request on GitHub, pull requests are a much better way to get your feature added than submitting a feature request. Open source is all about itch scratching, and it's less likely that someone else will have the same itches as yourself. We keep code reasonably simple on purpose so it's easy to dive in and make additions, but be sure to read the "Contributing Code" section below too -- as it doesn't hurt to have a discussion about a feature first -- we're inclined to have preferences about how incoming features might be implemented, and that can save confusion later.
Helping with Documentation
--------------------------
Ansible documentation is a community project too! If you would like to help with the
documentation, whether correcting a typo or improving a section, or maybe even
documenting a new feature, submit a github pull request to the code that
lives in the “docsite/rst” subdirectory of the project. Docs are in restructured text
format. If you aren’t comfortable with restructured text, you can also open a ticket on
github about any errors you spot or sections you would like to see added. For more information
on creating pull requests, please refer to the
[github help guide](https://help.github.com/articles/using-pull-requests).
## QUESTIONS ?
Contributing Code (Features or Bugfixes)
----------------------------------------
Please see the [community guide](http://docs.ansible.com/ansible/latest/community/index.html) for information on how to ask questions on the [mailing lists](http://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information) and IRC.
The Ansible project keeps it’s source on github at
[github.com/ansible/ansible](http://github.com/ansible/ansible)
and takes contributions through
[github pull requests](https://help.github.com/articles/using-pull-requests).
The GitHub issue tracker is not the best place for questions for various reasons, but both IRC and the mailing list are very helpful places for those things, as the community page explains best.
It is usually a good idea to join the ansible-devel list to discuss any large features prior to submission, and this especially helps in avoiding duplicate work or efforts where we decide, upon seeing a pull request for the first time, that revisions are needed. (This is not usually needed for module development)
Note that we do keep Ansible to a particular aesthetic, so if you are unclear about whether a feature
is a good fit or not, having the discussion on the development list is often a lot easier than having
to modify a pull request later.
When submitting patches, be sure to run the unit tests first “make tests” and always use
“git rebase” vs “git merge” (aliasing git pull to git pull --rebase is a great idea) to
avoid merge commits in your submissions. There are also integration tests that can be run in the "tests/integration" directory.
In order to keep the history clean and better audit incoming code, we will require resubmission of pull requests that contain merge commits. Use "git pull --rebase" vs "git pull" and "git rebase" vs "git merge". Also be sure to use topic branches to keep your additions on different branches, such that they won't pick up stray commits later.
We’ll then review your contributions and engage with you about questions and so on.
As we have a very large and active community, so it may take awhile to get your contributions
in! See the notes about priorities in a later section for understanding our work queue.
Patches should be made against the 'devel' branch.
Contributions can be for new features like modules, or to fix bugs you or others have found. If you
are interested in writing new modules to be included in the core Ansible distribution, please refer
to the [Module Developers documentation on our website](http://docs.ansible.com/developing_modules.html).
Ansible's aesthetic encourages simple, readable code and consistent, conservatively extending,
backwards-compatible improvements. Code developed for Ansible needs to support Python 2.6+,
while code in modules must run under Python 2.4 or higher. Please also use a 4-space indent
and no tabs.
Tip: To easily run from a checkout, source "./hacking/env-setup" and that's it -- no install
required. You're now live!
## CONTRIBUTING ?
Reporting A Bug
---------------
Please see the [community guide](http://docs.ansible.com/ansible/latest/community/index.html) for information regarding the contribution process. Important license agreement information is also included on that page.
Ansible practices responsible disclosure - if this is a security related bug, email security@ansible.com instead of filing a ticket or posting to the Google Group and you will recieve a prompt response.
Bugs should be reported to [github.com/ansible/ansible](http://github.com/ansible/ansible) after
signing up for a free github account. Before reporting a bug, please use the bug/issue search
to see if the issue has already been reported.
When filing a bug, please use the [issue template](https://raw2.github.com/ansible/ansible/devel/examples/issues/ISSUE_TEMPLATE.md) to provide all relevant information.
Do not use the issue tracker for "how do I do this" type questions. These are great candidates
for IRC or the mailing list instead where things are likely to be more of a discussion.
To be respectful of reviewers time and allow us to help everyone efficiently, please
provide minimal well-reduced and well-commented examples versus sharing your entire production
playbook. Include playbook snippets and output where possible.
Content in the GitHub bug tracker can be indented four spaces to preserve formatting.
For multiple-file content, we encourage use of gist.github.com. Online pastebin content can expire.
If you are not sure if something is a bug yet, you are welcome to ask about something on
the mailing list or IRC first. As we are a very high volume project, if you determine that
you do have a bug, please be sure to open the issue yourself to ensure we have a record of
it. Don’t rely on someone else in the community to file the bug report for you.
It may take some time to get to your report, see "A Note About Priorities" below.
A Note About Priorities
=======================
Ansible was one of the top 5 projects with the most OSS contributors on GitHub in 2013, and well over
600 people have added code to the project. As a result, we have a LOT of incoming activity to process.
In the interest of transparency, we're telling you how we do this.
In our bug tracker you'll notice some labels - P1, P2, P3, P4, and P5. These are our internal
priority orders that we use to sort tickets.
With some exceptions for easy merges (like documentation typos for instance),
we're going to spend most of our time working on P1 and P2 items first, including pull requests.
These usually relate to important
bugs or features affecting large segments of the userbase. So if you see something categorized
"P3 or P4", and it's not appearing to get a lot of immediate attention, this is why.
These labels don't really have definition - they are a simple ordering. However something
affecting a major module (yum, apt, etc) is likely to be prioritized higher than a module
affecting a smaller number of users.
Since we place a strong emphasis on testing and code review, it may take a few months for a minor feature to get merged.
Don't worry though -- we'll also take periodic sweeps through the lower priority queues and give
them some attention as well, particularly in the area of new module changes. So it doesn't neccessarily
mean that we'll be exhausting all of the higher-priority queues before getting to your ticket.
Release Numbering
=================
Releases ending in ".0" are major releases and this is where all new features land. Releases ending
in another integer, like "0.X.1" and "0.X.2" are dot releases, and these are only going to contain
bugfixes. Typically we don't do dot releases for minor releases, but may occasionally decide to cut
dot releases containing a large number of smaller fixes if it's still a fairly long time before
the next release comes out.
Online Resources
================
Documentation
-------------
The main ansible documentation can be found at [docs.ansible.com](http://docs.ansible.com).
As mentioned above this is an open source project, so we accept contributions to the documentation.
You can also find some best practices examples that we recommend reading at
[ansible-examples](http://github.com/ansible/ansible-examples).
Mailing lists
-------------
Ansible has several mailing lists. Your first post to the mailing list will be
moderated (to reduce spam), so please allow a day or less for your first post.
[ansible-announce](https://groups.google.com/forum/#!forum/ansible-announce) is for release
announcements and major news. It is a low traffic read-only list and you should only get a few
emails a month.
[ansible-project](https://groups.google.com/forum/#!forum/ansible-project) is the main list, and is
used for sharing cool projects you may have built, talking about Ansible ideas, and for users to ask
questions or to help other users.
[ansible-devel](https://groups.google.com/forum/#!forum/ansible-devel) is a technical list for
developers working on Ansible and Ansible modules. Join here to discuss how to build modules,
prospective feature implementations, or technical challenges.
To subscribe to a group from a non-google account, you can email the subscription address, for
example ansible-devel+subscribe@googlegroups.com.
IRC
---
Ansible has a general purpose IRC channel available at #ansible on irc.freenode.net.
Use this channel for all types of conversations, including sharing tips, coordinating
development work, or getting help from other users.
Miscellaneous Information
=========================
Staff
-----
Ansible, Inc is a company supporting Ansible and building additional solutions based on
Ansible. We also do services and support for those that are interested. Our most
important task however is enabling all the great things that happen in the Ansible
community, including organizing software releases of Ansible. For more information about
any of these things, contact info@ansible.com
On IRC, you can find us as mdehaan, jimi_c, Tybstar, and others. On the mailing list,
we post with an @ansible.com address.
Community Code of Conduct
-------------------------
Ansible’s community welcomes users of all types, backgrounds, and skill levels. Please
treat others as you expect to be treated, keep discussions positive, and avoid discrimination, profanity, allegations of Cthulhu worship, or engaging in controversial debates (except vi vs emacs is cool).
Posts to mailing lists should remain focused around Ansible and IT automation. Abuse of these community guidelines will not be tolerated and may result in banning from community resources.
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, pursuant
to the license of the project.
## BUG TO REPORT ?
First and foremost, also check the [community guide](http://docs.ansible.com/ansible/latest/community/index.html).
You can report bugs or make enhancement requests at the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new) by filling out the issue template that will be presented.
Also please make sure you are testing on the latest released version of Ansible or the development branch. You can find the latest releases and development branch at:
- https://github.com/ansible/ansible/releases
- https://github.com/ansible/ansible/archive/devel.tar.gz
Thanks!

View File

@ -1,21 +1,8 @@
prune ticket_stubs
prune hacking
include README.rst COPYING
include SYMLINK_CACHE.json
include requirements.txt
include .coveragerc
include .yamllint
include README.md packaging/rpm/ansible.spec COPYING
include examples/hosts
include examples/ansible.cfg
recursive-include lib/ansible/module_utils/powershell *
recursive-include lib/ansible/modules *
recursive-include lib/ansible/galaxy/data *
graft examples/playbooks
include packaging/distutils/setup.py
recursive-include docs *
recursive-include licenses *
recursive-include packaging *
recursive-include test *
recursive-include library *
include Makefile
include MANIFEST.in
include changelogs/*.rst
include contrib/README.md
recursive-include contrib/inventory *

View File

@ -1,3 +0,0 @@
# Module Maintainer Guidelines
The Ansible Module Maintainer Guidelines can now be found in the [official Ansible community guide](http://docs.ansible.com/ansible/latest/community/maintainers.html).

224
Makefile
View File

@ -1,3 +1,4 @@
#!/usr/bin/make
# WARN: gmake syntax
########################################################
# Makefile for Ansible
@ -9,7 +10,7 @@
# make deb-src -------------- produce a DEB source
# make deb ------------------ produce a DEB
# make docs ----------------- rebuild the manpages (results are checked in)
# make tests ---------------- run the tests (see https://docs.ansible.com/ansible/dev_guide/testing_units.html for requirements)
# make tests ---------------- run the tests
# make pyflakes, make pep8 -- source code checks
########################################################
@ -17,46 +18,33 @@
NAME = ansible
OS = $(shell uname -s)
PREFIX ?= '/usr/local'
# 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 ?= $(patsubst %.asciidoc.in,%,$(wildcard ./docs/man/man1/ansible*.1.asciidoc.in))
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1
ifneq ($(shell which a2x 2>/dev/null),)
ASCII2MAN = a2x -L -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -L -D docs/html/man/ -d manpage -f xhtml
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
else
ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
endif
GENERATE_CLI = docs/bin/generate_man.py
PYTHON=python
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
# fetch version from project release.py as single source-of-truth
VERSION := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --raw || echo error)
ifeq ($(findstring error,$(VERSION)), error)
$(error "version_helper failed")
endif
# if a specific release was not requested, set to 0 (RPMs have "fancier" logic for this further down)
RELEASE ?= 1
# VERSION file provides one place to update the software version
VERSION := $(shell cat VERSION)
# Get the branch information from git
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ai")
GIT_HASH := $(shell git log -n 1 --format="%h")
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/[-_.\/]//g')
GITINFO = .$(GIT_HASH).$(GIT_BRANCH)
else
GITINFO = ""
endif
ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD'),1)
DATE := $(shell date -j -r $(shell git log -n 1 --format="%at") +%Y%m%d%H%M)
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
else
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
CPUS ?= $(shell nproc)
endif
# DEB build parameters
@ -64,17 +52,15 @@ DEBUILD_BIN ?= debuild
DEBUILD_OPTS = --source-option="-I"
DPUT_BIN ?= dput
DPUT_OPTS ?=
DEB_DATE := $(shell LC_TIME=C date +"%a, %d %b %Y %T %z")
DEB_VERSION := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debversion)
ifeq ($(OFFICIAL),yes)
DEB_RELEASE := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debrelease)ppa
DEB_RELEASE = 1ppa
# Sign OFFICIAL builds using 'DEBSIGN_KEYID'
# DEBSIGN_KEYID is required when signing
ifneq ($(DEBSIGN_KEYID),)
DEBUILD_OPTS += -k$(DEBSIGN_KEYID)
endif
else
DEB_RELEASE = 100.git$(DATE)$(GITINFO)
DEB_RELEASE = 0.git$(DATE)
# Do not sign unofficial builds
DEBUILD_OPTS += -uc -us
DPUT_OPTS += -u
@ -84,72 +70,29 @@ DEB_PPA ?= ppa
# Choose the desired Ubuntu release: lucid precise saucy trusty
DEB_DIST ?= unstable
# pbuilder parameters
PBUILDER_ARCH ?= amd64
PBUILDER_CACHE_DIR = /var/cache/pbuilder
PBUILDER_BIN ?= pbuilder
PBUILDER_OPTS ?= --debootstrapopts --variant=buildd --architecture $(PBUILDER_ARCH) --debbuildopts -b
# RPM build parameters
RPMSPECDIR= packaging/rpm
RPMSPEC = $(RPMSPECDIR)/ansible.spec
RPMDIST = $(shell rpm --eval '%{?dist}')
ifneq ($(OFFICIAL),yes)
RPMRELEASE = 100.git$(DATE)$(GITINFO)
RPMRELEASE = 1
ifeq ($(OFFICIAL),)
RPMRELEASE = 0.git$(DATE)
endif
ifeq ($(PUBLISH),nightly)
# https://fedoraproject.org/wiki/Packaging:Versioning#Snapshots
RPMRELEASE = $(RELEASE).$(DATE)git.$(GIT_HASH)
endif
RPMVERSION ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --baseversion)
RPMRELEASE ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --rpmrelease)
RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)$(RPMDIST)$(REPOTAG)"
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
# MOCK build parameters
MOCK_BIN ?= mock
MOCK_CFG ?=
# dynamically add repotag define only if specified
ifneq ($(REPOTAG),)
EXTRA_RPM_DEFINES += --define "repotag $(REPOTAG)"
endif
# ansible-test parameters
ANSIBLE_TEST ?= test/runner/ansible-test
TEST_FLAGS ?=
# ansible-test units parameters (make test / make test-py3)
PYTHON_VERSION ?= $(shell python2 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
PYTHON3_VERSION ?= $(shell python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
# ansible-test integration parameters (make integration)
IMAGE ?= centos7
TARGET ?=
NOSETESTS ?= nosetests
########################################################
.PHONY: all
all: clean python
.PHONY: tests
tests:
$(ANSIBLE_TEST) units -v --python $(PYTHON_VERSION) $(TEST_FLAGS)
PYTHONPATH=./lib ANSIBLE_LIBRARY=./library $(NOSETESTS) -d -w test/units -v
.PHONY: tests-py3
tests-py3:
$(ANSIBLE_TEST) units -v --python $(PYTHON3_VERSION) $(TEST_FLAGS)
.PHONY: tests-nonet
tests-nonet:
$(ANSIBLE_TEST) units -v --python $(PYTHON_VERSION) $(TEST_FLAGS) --exclude test/units/modules/network/
.PHONY: integration
integration:
$(ANSIBLE_TEST) integration -v --docker $(IMAGE) $(TARGET) $(TEST_FLAGS)
.PHONY: authors
authors:
sh hacking/authors.sh
@ -158,48 +101,39 @@ authors:
%.1.asciidoc: %.1.asciidoc.in
sed "s/%VERSION%/$(VERSION)/" $< > $@
# Regenerate %.1 if %.1.asciidoc or release.py has been modified more
# Regenerate %.1 if %.1.asciidoc or VERSION has been modified more
# recently than %.1. (Implicitly runs the %.1.asciidoc recipe)
%.1: %.1.asciidoc lib/ansible/release.py
%.1: %.1.asciidoc VERSION
$(ASCII2MAN)
.PHONY: loc
loc:
sloccount lib library bin
.PHONY: pep8
pep8:
$(ANSIBLE_TEST) sanity --test pep8 --python $(PYTHON_VERSION) $(TEST_FLAGS)
@echo "#############################################"
@echo "# Running PEP8 Compliance Tests"
@echo "#############################################"
-pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 lib/ bin/
-pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 --filename "*" library/
.PHONY: pyflakes
pyflakes:
pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*
.PHONY: clean
clean:
@echo "Cleaning up distutils stuff"
rm -rf build
rm -rf dist
rm -rf lib/ansible.egg-info/
@echo "Cleaning up byte compiled python stuff"
find . -type f -regex ".*\.py[co]$$" -delete
find . -type d -name "__pycache__" -delete
@echo "Cleaning up editor backup files"
find . -type f -not -path ./test/units/inventory_test_data/group_vars/noparse/all.yml~ \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
@echo "Cleaning up manpage stuff"
find ./docs/man -type f -name "*.xml" -delete
find ./docs/man -type f -name "*.asciidoc" -delete
find ./docs/man/man3 -type f -name "*.3" -delete
rm -f ./docs/man/man1/*
@echo "Cleaning up output from test runs"
rm -rf test/test_data
rm -rf shippable/
rm -rf logs/
rm -rf .cache/
rm -f test/units/.coverage*
rm -rf test/results/*/*
find test/ -type f -name '*.retry' -delete
@echo "Cleaning up RPM building stuff"
rm -rf MANIFEST rpm-build
@echo "Cleaning up Debian building stuff"
@ -209,70 +143,35 @@ clean:
rm -rf docs/js
@echo "Cleaning up authors file"
rm -f AUTHORS.TXT
@echo "Cleaning up docsite"
$(MAKE) -C docs/docsite clean
$(MAKE) -C docs/api clean
.PHONY: python
python:
$(PYTHON) setup.py build
.PHONY: install
install:
$(PYTHON) setup.py install
install_manpages:
gzip -9 $(wildcard ./docs/man/man1/ansible*.1)
cp $(wildcard ./docs/man/man1/ansible*.1.gz) $(PREFIX)/man/man1/
.PHONY: sdist
sdist: clean docs changelog_aggregate
sdist: clean docs
$(PYTHON) setup.py sdist
.PHONY: sdist_upload
sdist_upload: clean docs
$(PYTHON) setup.py sdist upload 2>&1 |tee upload.log
# TODO: variable-ize major version number usages here
.PHONY: changelog_reno
changelog_reno:
reno -d changelogs/ report --title 'Ansible 2.5 "Kashmir" Release Notes' --collapse-pre-release --no-show-source --earliest-version v2.5.0b1 --output changelogs/CHANGELOG-v2.5.rst
.PHONY: changelog_aggregate
changelog_aggregate:
echo "TODO: unified changelog" > changelogs/CHANGELOG.rst
.PHONY: rpmcommon
rpmcommon: sdist
rpmcommon: $(MANPAGES) sdist
@mkdir -p rpm-build
@cp dist/*.gz rpm-build/
@cp $(RPMSPEC) rpm-build/$(NAME).spec
@sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}#' $(RPMSPEC) >rpm-build/$(NAME).spec
.PHONY: mock-srpm
mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon
$(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --bootstrap-chroot --old-chroot --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/ \
--define "rpmversion $(RPMVERSION)" \
--define "upstream_version $(VERSION)" \
--define "rpmrelease $(RPMRELEASE)" \
$(EXTRA_RPM_DEFINES)
$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/ --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/
@echo "#############################################"
@echo "Ansible SRPM is built:"
@echo rpm-build/*.src.rpm
@echo "#############################################"
.PHONY: mock-rpm
mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm
$(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --bootstrap-chroot --old-chroot --rebuild rpm-build/$(NAME)-*.src.rpm \
--define "rpmversion $(RPMVERSION)" \
--define "upstream_version $(VERSION)" \
--define "rpmrelease $(RPMRELEASE)" \
$(EXTRA_RPM_DEFINES)
$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/ --rebuild rpm-build/$(NAME)-*.src.rpm
@echo "#############################################"
@echo "Ansible RPM is built:"
@echo rpm-build/*.noarch.rpm
@echo "#############################################"
.PHONY: srpm
srpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
@ -280,10 +179,6 @@ srpm: rpmcommon
--define "_srcrpmdir %{_topdir}" \
--define "_specdir $(RPMSPECDIR)" \
--define "_sourcedir %{_topdir}" \
--define "upstream_version $(VERSION)" \
--define "rpmversion $(RPMVERSION)" \
--define "rpmrelease $(RPMRELEASE)" \
$(EXTRA_RPM_DEFINES) \
-bs rpm-build/$(NAME).spec
@rm -f rpm-build/$(NAME).spec
@echo "#############################################"
@ -291,7 +186,6 @@ srpm: rpmcommon
@echo " rpm-build/$(RPMNVR).src.rpm"
@echo "#############################################"
.PHONY: rpm
rpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
@ -299,12 +193,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)`" \
--define "upstream_version $(VERSION)" \
--define "rpmversion $(RPMVERSION)" \
--define "rpmrelease $(RPMRELEASE)" \
$(EXTRA_RPM_DEFINES) \
-ba rpm-build/$(NAME).spec
@rm -f rpm-build/$(NAME).spec
@echo "#############################################"
@ -312,45 +202,25 @@ rpm: rpmcommon
@echo " rpm-build/$(RPMNVR).noarch.rpm"
@echo "#############################################"
.PHONY: debian
debian: sdist
@for DIST in $(DEB_DIST) ; do \
mkdir -p deb-build/$${DIST} ; \
tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ; \
cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ; \
sed -ie "s|%VERSION%|$(DEB_VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
sed -ie "s#^$(NAME) (\([^)]*\)) \([^;]*\);#ansible (\1-$(DEB_RELEASE)~$${DIST}) $${DIST};#" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
done
.PHONY: deb
deb: deb-src
@for DIST in $(DEB_DIST) ; do \
PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \
$(PBUILDER_BIN) create $${PBUILDER_OPTS} --othermirror "deb http://archive.ubuntu.com/ubuntu $${DIST} universe" ; \
$(PBUILDER_BIN) update $${PBUILDER_OPTS} ; \
$(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \
done
@echo "#############################################"
@echo "Ansible DEB artifacts:"
@for DIST in $(DEB_DIST) ; do \
echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
@echo "#############################################"
# Build package outside of pbuilder, with locally installed dependencies.
# Install BuildRequires as noted in packaging/debian/control.
.PHONY: local_deb
local_deb: debian
deb: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \
done
@echo "#############################################"
@echo "Ansible DEB artifacts:"
@for DIST in $(DEB_DIST) ; do \
echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
@echo "#############################################"
.PHONY: deb-src
deb-src: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -S) ; \
@ -362,39 +232,19 @@ deb-src: debian
done
@echo "#############################################"
.PHONY: deb-upload
deb-upload: deb
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
.PHONY: deb-src-upload
deb-src-upload: deb-src
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
done
.PHONY: epub
epub:
(cd docs/docsite/; CPUS=$(CPUS) make epub)
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
.PHONY: webdocs
webdocs:
(cd docs/docsite/; CPUS=$(CPUS) make docs)
.PHONY: generate_asciidoc
generate_asciidoc: lib/ansible/cli/*.py
mkdir -p ./docs/man/man1/ ; \
PYTHONPATH=./lib $(GENERATE_CLI) --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
docs: generate_asciidoc
make $(MANPAGES)
.PHONY: alldocs
alldocs: docs webdocs
version:
@echo $(VERSION)
webdocs: $(MANPAGES)
(cd docsite/; make docs)
docs: $(MANPAGES)

48
README.md Normal file
View File

@ -0,0 +1,48 @@
[![PyPI version](https://badge.fury.io/py/ansible.png)](http://badge.fury.io/py/ansible) [![PyPI downloads](https://pypip.in/d/ansible/badge.png)](https://pypi.python.org/pypi/ansible)
Ansible
=======
Ansible is a radically simple configuration-management, application deployment, task-execution, and multinode orchestration engine.
Read the documentation and more at http://ansible.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 [here](http://docs.ansible.com/intro_getting_started.html) for a variety of platforms. If you want a tarball of the last release, go to [releases.ansible.com](http://releases.ansible.com/ansible) and you can also install with pip.
Design Principles
=================
* Have a dead simple setup process and a minimal learning curve
* Be super fast & parallel by default
* Require no server or client daemons; use existing SSHd
* Use a language that is both machine and human friendly
* Focus on security and easy auditability/review/rewriting of content
* Manage remote machines instantly, without bootstrapping
* Allow module development in any dynamic language, not just Python
* Be usable as non-root
* Be the easiest IT automation system to use, ever.
Get Involved
============
* Read [Contributing.md](https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md) for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
* All code submissions are done through pull requests. Take care to make sure no merge commits are in the submission, and use "git rebase" vs "git merge" for this reason. If submitting a large code change (other than modules), it's probably a good idea to join ansible-devel and talk about what you would like to do or add first and to avoid duplicate efforts. This not only helps everyone know what's going on, it also helps save time and effort if we decide some changes are needed.
* irc.freenode.net: #ansible
Branch Info
===========
* Releases are named after Van Halen songs.
* The devel branch corresponds to the release actively under development.
* Various release-X.Y branches exist for previous releases
* We'd love to have your contributions, read "CONTRIBUTING.md" for process notes.
Author
======
Michael DeHaan -- michael@ansible.com
[Ansible, Inc](http://ansible.com)

View File

@ -1,100 +0,0 @@
|PyPI version| |Docs badge| |Build Status|
*******
Ansible
*******
Ansible is a radically simple IT automation system. It handles
configuration-management, application deployment, cloud provisioning,
ad-hoc task-execution, and multinode orchestration -- including
trivializing things like zero-downtime rolling updates with load
balancers.
Read the documentation and more at https://ansible.com/
You can find installation instructions
`here <https://docs.ansible.com/intro_getting_started.html>`_ for a
variety of platforms.
Most users should probably install a released version of Ansible from ``pip``, a package manager or
our `release repository <https://releases.ansible.com/ansible/>`_. `Officially supported
<https://www.ansible.com/ansible-engine>`_ builds of Ansible are also available. Some power users
run directly from the development branch - while significant efforts are made to ensure that
``devel`` is reasonably stable, you're more likely to encounter breaking changes when running
Ansible this way.
Design Principles
=================
* Have a dead simple setup process and a minimal learning curve
* Manage machines very quickly and in parallel
* Avoid custom-agents and additional open ports, be agentless by
leveraging the existing SSH daemon
* Describe infrastructure in a language that is both machine and human
friendly
* Focus on security and easy auditability/review/rewriting of content
* Manage new remote machines instantly, without bootstrapping any
software
* Allow module development in any dynamic language, not just Python
* Be usable as non-root
* Be the easiest IT automation system to use, ever.
Get Involved
============
* Read `Community
Information <https://docs.ansible.com/community.html>`_ for all
kinds of ways to contribute to and interact with the project,
including mailing list information and how to submit bug reports and
code to Ansible.
* All code submissions are done through pull requests. Take care to
make sure no merge commits are in the submission, and use
``git rebase`` vs ``git merge`` for this reason. If submitting a
large code change (other than modules), it's probably a good idea to
join ansible-devel and talk about what you would like to do or add
first to avoid duplicate efforts. This not only helps everyone
know what's going on, it also helps save time and effort if we decide
some changes are needed.
* Users list:
`ansible-project <https://groups.google.com/group/ansible-project>`_
* Development list:
`ansible-devel <https://groups.google.com/group/ansible-devel>`_
* Announcement list:
`ansible-announce <https://groups.google.com/group/ansible-announce>`_
-- read only
* irc.freenode.net: #ansible
Branch Info
===========
* Releases are named after Led Zeppelin songs. (Releases prior to 2.0
were named after Van Halen songs.)
* The devel branch corresponds to the release actively under
development.
* Various release-X.Y branches exist for previous releases.
* We'd love to have your contributions, read `Community
Information <https://docs.ansible.com/community.html>`_ for notes on
how to get started.
Authors
=======
Ansible was created by `Michael DeHaan <https://github.com/mpdehaan>`_
(michael.dehaan/gmail/com) and has contributions from over 1000 users
(and growing). Thanks everyone!
Ansible is sponsored by `Ansible, Inc <https://ansible.com>`_
License
=======
GNU General Public License v3.0
See `COPYING <COPYING>`_ to see the full text.
.. |PyPI version| image:: https://img.shields.io/pypi/v/ansible.svg
:target: https://pypi.org/project/ansible
.. |Docs badge| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
:target: http://docs.ansible.com/ansible
.. |Build Status| image:: https://api.shippable.com/projects/573f79d02a8192902e20e34b/badge?branch=devel
:target: https://app.shippable.com/projects/573f79d02a8192902e20e34b

View File

@ -1,92 +1,48 @@
Ansible Releases at a Glance
============================
VERSION RELEASE CODE NAME
++++++++++++++++++++++++++++++
Active Development
++++++++++++++++++
1.7 "Summer Nights" -------- CURRENT DEVEL BRANCH
1.6.5 "The Cradle Will Rock" - 06-25-2014
1.6.4 "The Cradle Will Rock" - 06-25-2014
1.6.3 "The Cradle Will Rock" - 06-09-2014
1.6.2 "The Cradle Will Rock" - 05-23-2014
1.6.1 "The Cradle Will Rock" - 05-07-2014
1.6 "The Cradle Will Rock" - 05-05-2014
1.5.5 "Love Walks In" -------- 04-18-2014
1.5.4 "Love Walks In" -------- 04-01-2014
1.5.3 "Love Walks In" -------- 03-13-2014
1.5.2 "Love Walks In" -------- 03-11-2014
1.5.1 "Love Walks In" -------- 03-10-2014
1.5 "Love Walks In" -------- 02-28-2014
1.4.5 "Could This Be Magic?" - 02-12-2014
1.4.4 "Could This Be Magic?" - 01-06-2014
1.4.3 "Could This Be Magic?" - 12-20-2013
1.4.2 "Could This Be Magic?" - 12-18-2013
1.4.1 "Could This Be Magic?" - 11-27-2013
1.4 "Could This Be Magic?" - 11-21-2013
1.3.4 "Top of the World" ----- 10-29-2013
1.3.3 "Top of the World" ----- 10-09-2013
1.3.2 "Top of the World" ----- 09-19-2013
1.3.1 "Top of the World" ----- 09-16-2013
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
2.5.2 2018-04-26 "Kashmir"
2.5.1 2018-04-18 "Kashmir"
2.5.0 2018-03-22 "Kashmir"
2.4.4 2018-04-04 "Dancing Days"
2.4.3 01-31.2018 "Dancing Days"
2.4.2 11-29-2017 "Dancing Days"
2.4.1 10-25-2017 "Dancing Days"
2.4.0 09-19-2017 "Dancing Days"
2.3.3 12-20-2017 "Ramble On"
2.3.2 2017-08-04 "Ramble On"
2.3.1 2017-06-01 "Ramble On"
2.3.0 2017-04-12 "Ramble On"
2.2.3 2017-05-09 "The Battle of Evermore"
2.2.2 2017-03-27 "The Battle of Evermore"
2.2.1 2017-01-16 "The Battle of Evermore"
2.2.0 2016-11-01 "The Battle of Evermore"
2.1.6 2017-06-01 "The Song Remains the Same"
2.1.5 2017-03-27 "The Song Remains the Same"
2.1.4 2017-01-16 "The Song Remains the Same"
2.1.3 2016-11-04 "The Song Remains the Same"
2.1.2 2016-09-29 "The Song Remains the Same"
2.1.1 2016-07-28 "The Song Remains the Same"
2.1.0 2016-05-25 "The Song Remains the Same"
2.0.2 2016-04-19 "Over the Hills and Far Away"
2.0.1 2016-02-24 "Over the Hills and Far Away"
2.0.0 2016-01-12 "Over the Hills and Far Away"
1.9.6 2016-04-15 "Dancing In the Streets"
1.9.5 2016-03-21 "Dancing In the Streets"
1.9.4 2015-10-09 "Dancing In the Streets"
1.9.3 2015-09-03 "Dancing In the Streets"
1.9.2 2015-06-24 "Dancing In the Streets"
1.9.1 2015-04-27 "Dancing In the Streets"
1.9.0 2015-03-25 "Dancing In the Streets"
1.8.4 2015-02-19 "You Really Got Me"
1.8.3 2015-02-17 "You Really Got Me"
1.8.2 2014-12-04 "You Really Got Me"
1.8.1 2014-11-26 "You Really Got Me"
1.8.0 2014-11-25 "You Really Got Me"
1.7.2 2014-09-24 "Summer Nights"
1.7.1 2014-08-14 "Summer Nights"
1.7.0 2014-08-06 "Summer Nights"
1.6.10 2014-07-25 "The Cradle Will Rock"
1.6.9 2014-07-24 "The Cradle Will Rock"
1.6.8 2014-07-22 "The Cradle Will Rock"
1.6.7 2014-07-21 "The Cradle Will Rock"
1.6.6 2014-07-01 "The Cradle Will Rock"
1.6.5 2014-06-25 "The Cradle Will Rock"
1.6.4 2014-06-25 "The Cradle Will Rock"
1.6.3 2014-06-09 "The Cradle Will Rock"
1.6.2 2014-05-23 "The Cradle Will Rock"
1.6.1 2014-05-07 "The Cradle Will Rock"
1.6.0 2014-05-05 "The Cradle Will Rock"
1.5.5 2014-04-18 "Love Walks In"
1.5.4 2014-04-01 "Love Walks In"
1.5.3 2014-03-13 "Love Walks In"
1.5.2 2014-03-11 "Love Walks In"
1.5.1 2014-03-10 "Love Walks In"
1.5.0 2014-02-28 "Love Walks In"
1.4.5 2014-02-12 "Could This Be Magic?"
1.4.4 2014-01-06 "Could This Be Magic?"
1.4.3 2013-12-20 "Could This Be Magic?"
1.4.2 2013-12-18 "Could This Be Magic?"
1.4.1 2013-11-27 "Could This Be Magic?"
1.4.0 2013-11-21 "Could This Be Magic?"
1.3.4 2013-10-29 "Top of the World"
1.3.3 2013-10-09 "Top of the World"
1.3.2 2013-09-19 "Top of the World"
1.3.1 2013-09-16 "Top of the World"
1.3.0 2013-09-13 "Top of the World"
1.2.3 2013-08-21 "Right Now"
1.2.2 2013-07-05 "Right Now"
1.2.1 2013-07-04 "Right Now"
1.2.0 2013-06-10 "Right Now"
1.1.0 2013-04-02 "Mean Street"
1.0.0 2013-02-01 "Eruption"
0.9.0 2012-11-30 "Dreams"
0.8.0 2012-10-19 "Cathedral"
0.7.0 2012-09-06 "Panama"
0.6.0 2012-08-06 "Cabo"
0.5.0 2012-07-04 "Amsterdam"
0.4.0 2012-05-23 "Unchained"
0.3.0 2012-04-23 "Baluchitherium"
0.2.0 ? "Untitled"
0.1.0 ? "Untitled"
0.0.2 ? "Untitled"
0.0.1 ? "Untitled"

View File

@ -1,17 +0,0 @@
*******************************
Roadmap For Ansible by Red Hat
*******************************
This document is now the location for published Ansible Core roadmaps.
The roadmap will be updated by version. Based on team and community feedback, an initial roadmap will be published for a major or minor version (2.0, 2.1). Subminor versions will generally not have roadmaps published.
2.1 was the first time Ansible has published this and asked for feedback in this manner. So feedback on the roadmap and the new process is quite welcome. The team is aiming for further transparency and better inclusion of both community desires and submissions.
These roadmaps are the team's *best guess* roadmaps based on the Ansible team's experience and are also based on requests and feedback from the community. There are things that may not make it on due to time constraints, lack of community maintainers, etc. And there may be things that got missed, so each roadmap is published both as an idea of what is upcoming in Ansible, and as a medium for seeking further feedback from the community. Here are the good places for you to submit feedback:
- Add to the agenda of a `Core IRC Meetings <https://github.com/ansible/community/blob/master/meetings/README.md>`_ (preferred)
- Ansible's google-group: ansible-devel
- AnsibleFest conferences.
- IRC Freenode channel: #ansible-devel (this one may have things lost in lots of conversation, so a caution).
Ansible Roadmaps can be found `here <http://docs.ansible.com/ansible/devel/roadmap/>`_.

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.6.5

File diff suppressed because it is too large Load Diff

View File

@ -18,146 +18,214 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
########################################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
__requires__ = ['ansible']
try:
import pkg_resources
except Exception:
# Use pkg_resources to find the correct versions of libraries and set
# sys.path appropriately when there are multiversion installs. But we
# have code that better expresses the errors in the places where the code
# is actually used (the deps are optional for many code paths) so we don't
# want to fail here.
pass
import os
import shutil
import sys
import traceback
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
from ansible.module_utils._text import to_text
from ansible.runner import Runner
import ansible.constants as C
from ansible import utils
from ansible import errors
from ansible import callbacks
from ansible import inventory
########################################################
class Cli(object):
''' code behind bin/ansible '''
# ----------------------------------------------
def __init__(self):
self.stats = callbacks.AggregateStats()
self.callbacks = callbacks.CliRunnerCallbacks()
# ----------------------------------------------
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,
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
if len(args) == 0 or len(args) > 1:
parser.print_help()
sys.exit(1)
# su and sudo command line arguments need to be mutually exclusive
if (options.su or options.su_user or options.ask_su_pass) and \
(options.sudo or options.sudo_user or options.ask_sudo_pass):
parser.error("Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') "
"and su arguments ('-su', '--su-user', and '--ask-su-pass') are "
"mutually exclusive")
if (options.ask_vault_pass and options.vault_password_file):
parser.error("--ask-vault-pass and --vault-password-file are mutually exclusive")
return (options, args)
# ----------------------------------------------
def run(self, options, args):
''' use Runner lib to do SSH things '''
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:
callbacks.display("No hosts matched")
sys.exit(0)
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
su_pass = None
vault_pass = None
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
options.ask_su_pass = options.ask_su_pass or C.DEFAULT_ASK_SU_PASS
options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_PASS
(sshpass, sudopass, su_pass, vault_pass) = utils.ask_passwords(ask_pass=options.ask_pass, ask_sudo_pass=options.ask_sudo_pass, ask_su_pass=options.ask_su_pass, ask_vault_pass=options.ask_vault_pass)
# read vault_pass from a file
if options.vault_password_file:
this_path = os.path.expanduser(options.vault_password_file)
try:
f = open(this_path, "rb")
tmp_vault_pass=f.read().strip()
f.close()
except (OSError, IOError), e:
raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
if not options.ask_vault_pass:
vault_pass = tmp_vault_pass
inventory_manager = inventory.Inventory(options.inventory)
if options.subset:
inventory_manager.subset(options.subset)
hosts = inventory_manager.list_hosts(pattern)
if len(hosts) == 0:
callbacks.display("No hosts matched")
sys.exit(0)
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)
# Used for determining if the system is running a new enough python version
# and should only restrict on our documented minimum versions
_PY3_MIN = sys.version_info[:2] >= (3, 5)
_PY2_MIN = (2, 6) <= sys.version_info[:2] < (3,)
_PY_MIN = _PY3_MIN or _PY2_MIN
if not _PY_MIN:
raise SystemExit('ERROR: Ansible requires a minimum of Python2 version 2.6 or Python3 version 3.5. Current version: %s' % ''.join(sys.version.splitlines()))
if options.su_user or options.ask_su_pass:
options.su = True
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
options.su_user = options.su_user or C.DEFAULT_SU_USER
if options.tree:
utils.prepare_writeable_dir(options.tree)
runner = Runner(
module_name=options.module_name,
module_path=options.module_path,
module_args=options.module_args,
remote_user=options.remote_user,
remote_pass=sshpass,
inventory=inventory_manager,
timeout=options.timeout,
private_key_file=options.private_key_file,
forks=options.forks,
pattern=pattern,
callbacks=self.callbacks,
sudo=options.sudo,
sudo_pass=sudopass,
sudo_user=options.sudo_user,
transport=options.connection,
subset=options.subset,
check=options.check,
diff=options.check,
su=options.su,
su_pass=su_pass,
su_user=options.su_user,
vault_pass=vault_pass
)
if options.seconds:
callbacks.display("background launch...\n\n", color='cyan')
results, poller = runner.run_async(options.seconds)
results = self.poll_while_needed(poller, options)
else:
results = runner.run()
return (runner, results)
# ----------------------------------------------
def poll_while_needed(self, poller, options):
''' summarize results from Runner '''
# BACKGROUND POLL LOGIC when -B and -P are specified
if options.seconds and options.poll_interval > 0:
poller.wait(options.seconds, options.poll_interval)
return poller.results
class LastResort(object):
# OUTPUT OF LAST RESORT
def display(self, msg, log_only=None):
print(msg, file=sys.stderr)
def error(self, msg, wrap_text=None):
print(msg, file=sys.stderr)
########################################################
if __name__ == '__main__':
callbacks.display("", log_only=True)
callbacks.display(" ".join(sys.argv), log_only=True)
callbacks.display("", log_only=True)
display = LastResort()
try: # bad ANSIBLE_CONFIG or config options can force ugly stacktrace
import ansible.constants as C
from ansible.utils.display import Display
except AnsibleOptionsError as e:
display.error(to_text(e), wrap_text=False)
sys.exit(5)
cli = None
me = os.path.basename(sys.argv[0])
cli = Cli()
(options, args) = cli.parse()
try:
display = Display()
display.debug("starting run")
(runner, results) = cli.run(options, args)
for result in results['contacted'].values():
if 'failed' in result or result.get('rc', 0) != 0:
sys.exit(2)
if results['dark']:
sys.exit(3)
except errors.AnsibleError, e:
# Generic handler for ansible specific errors
callbacks.display("ERROR: %s" % str(e), stderr=True, color='red')
sys.exit(1)
sub = None
target = me.split('-')
if target[-1][0].isdigit():
# Remove any version or python version info as downstreams
# sometimes add that
target = target[:-1]
if len(target) > 1:
sub = target[1]
myclass = "%sCLI" % sub.capitalize()
elif target[0] == 'ansible':
sub = 'adhoc'
myclass = 'AdHocCLI'
else:
raise AnsibleError("Unknown Ansible alias: %s" % me)
try:
mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
except ImportError as e:
# ImportError members have changed in py3
if 'msg' in dir(e):
msg = e.msg
else:
msg = e.message
if msg.endswith(' %s' % sub):
raise AnsibleError("Ansible sub-program not implemented: %s" % me)
else:
raise
try:
args = [to_text(a, errors='surrogate_or_strict') for a in sys.argv]
except UnicodeError:
display.error('Command line args are not in utf-8, unable to continue. Ansible currently only understands utf-8')
display.display(u"The full traceback was:\n\n%s" % to_text(traceback.format_exc()))
exit_code = 6
else:
cli = mycli(args)
cli.parse()
exit_code = cli.run()
except AnsibleOptionsError as e:
cli.parser.print_help()
display.error(to_text(e), wrap_text=False)
exit_code = 5
except AnsibleParserError as e:
display.error(to_text(e), wrap_text=False)
exit_code = 4
# TQM takes care of these, but leaving comment to reserve the exit codes
# except AnsibleHostUnreachable as e:
# display.error(str(e))
# exit_code = 3
# except AnsibleHostFailed as e:
# display.error(str(e))
# exit_code = 2
except AnsibleError as e:
display.error(to_text(e), wrap_text=False)
exit_code = 1
except KeyboardInterrupt:
display.error("User interrupted execution")
exit_code = 99
except Exception as e:
if C.DEFAULT_DEBUG:
# Show raw stacktraces in debug mode, It also allow pdb to
# enter post mortem mode.
raise
have_cli_options = cli is not None and cli.options is not None
display.error("Unexpected Exception, this is probably a bug: %s" % to_text(e), wrap_text=False)
if not have_cli_options or have_cli_options and cli.options.verbosity > 2:
log_only = False
if hasattr(e, 'orig_exc'):
display.vvv('\nexception type: %s' % to_text(type(e.orig_exc)))
why = to_text(e.orig_exc)
if to_text(e) != why:
display.vvv('\noriginal msg: %s' % why)
else:
display.display("to see the full traceback, use -vvv")
log_only = True
display.display(u"the full traceback was:\n\n%s" % to_text(traceback.format_exc()), log_only=log_only)
exit_code = 250
finally:
# Remove ansible tmpdir
shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
sys.exit(exit_code)

View File

@ -1 +0,0 @@
ansible

View File

@ -1,286 +0,0 @@
#!/usr/bin/env python
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
__requires__ = ['ansible']
try:
import pkg_resources
except Exception:
pass
import fcntl
import os
import signal
import socket
import sys
import traceback
import errno
import json
from ansible import constants as C
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.module_utils.six import PY3
from ansible.module_utils.six.moves import cPickle, StringIO
from ansible.module_utils.connection import Connection, ConnectionError, send_data, recv_data
from ansible.module_utils.service import fork_process
from ansible.playbook.play_context import PlayContext
from ansible.plugins.loader import connection_loader
from ansible.utils.path import unfrackpath, makedirs_safe
from ansible.utils.display import Display
from ansible.utils.jsonrpc import JsonRpcServer
class ConnectionProcess(object):
'''
The connection process wraps around a Connection object that manages
the connection to a remote device that persists over the playbook
'''
def __init__(self, fd, play_context, socket_path, original_path, ansible_playbook_pid=None):
self.play_context = play_context
self.socket_path = socket_path
self.original_path = original_path
self.fd = fd
self.exception = None
self.srv = JsonRpcServer()
self.sock = None
self.connection = None
self._ansible_playbook_pid = ansible_playbook_pid
def start(self):
try:
messages = list()
result = {}
messages.append('control socket path is %s' % self.socket_path)
# If this is a relative path (~ gets expanded later) then plug the
# key's path on to the directory we originally came from, so we can
# find it now that our cwd is /
if self.play_context.private_key_file and self.play_context.private_key_file[0] not in '~/':
self.play_context.private_key_file = os.path.join(self.original_path, self.play_context.private_key_file)
self.connection = connection_loader.get(self.play_context.connection, self.play_context, '/dev/null',
ansible_playbook_pid=self._ansible_playbook_pid)
self.connection.set_options()
self.connection._connect()
self.connection._socket_path = self.socket_path
self.srv.register(self.connection)
messages.extend(sys.stdout.getvalue().splitlines())
messages.append('connection to remote device started successfully')
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.bind(self.socket_path)
self.sock.listen(1)
messages.append('local domain socket listeners started successfully')
except Exception as exc:
result['error'] = to_text(exc)
result['exception'] = traceback.format_exc()
finally:
result['messages'] = messages
self.fd.write(json.dumps(result))
self.fd.close()
def run(self):
try:
while self.connection.connected:
signal.signal(signal.SIGALRM, self.connect_timeout)
signal.signal(signal.SIGTERM, self.handler)
signal.alarm(C.PERSISTENT_CONNECT_TIMEOUT)
self.exception = None
(s, addr) = self.sock.accept()
signal.alarm(0)
signal.signal(signal.SIGALRM, self.command_timeout)
while True:
data = recv_data(s)
if not data:
break
signal.alarm(self.connection._play_context.timeout)
resp = self.srv.handle_request(data)
signal.alarm(0)
send_data(s, to_bytes(resp))
s.close()
except Exception as e:
# socket.accept() will raise EINTR if the socket.close() is called
if hasattr(e, 'errno'):
if e.errno != errno.EINTR:
self.exception = traceback.format_exc()
else:
self.exception = traceback.format_exc()
finally:
# when done, close the connection properly and cleanup
# the socket file so it can be recreated
self.shutdown()
def connect_timeout(self, signum, frame):
display.display('persistent connection idle timeout triggered, timeout value is %s secs' % C.PERSISTENT_CONNECT_TIMEOUT, log_only=True)
self.shutdown()
def command_timeout(self, signum, frame):
display.display('command timeout triggered, timeout value is %s secs' % self.play_context.timeout, log_only=True)
self.shutdown()
def handler(self, signum, frame):
display.display('signal handler called with signal %s' % signum, log_only=True)
self.shutdown()
def shutdown(self):
""" Shuts down the local domain socket
"""
if os.path.exists(self.socket_path):
try:
if self.sock:
self.sock.close()
if self.connection:
self.connection.close()
except:
pass
finally:
if os.path.exists(self.socket_path):
os.remove(self.socket_path)
setattr(self.connection, '_socket_path', None)
setattr(self.connection, '_connected', False)
display.display('shutdown complete', log_only=True)
def main():
""" Called to initiate the connect to the remote device
"""
rc = 0
result = {}
messages = list()
socket_path = None
# Need stdin as a byte stream
if PY3:
stdin = sys.stdin.buffer
else:
stdin = sys.stdin
# Note: update the below log capture code after Display.display() is refactored.
saved_stdout = sys.stdout
sys.stdout = StringIO()
try:
# read the play context data via stdin, which means depickling it
cur_line = stdin.readline()
init_data = b''
while cur_line.strip() != b'#END_INIT#':
if cur_line == b'':
raise Exception("EOF found before init data was complete")
init_data += cur_line
cur_line = stdin.readline()
if PY3:
pc_data = cPickle.loads(init_data, encoding='bytes')
else:
pc_data = cPickle.loads(init_data)
play_context = PlayContext()
play_context.deserialize(pc_data)
display.verbosity = play_context.verbosity
except Exception as e:
rc = 1
result.update({
'error': to_text(e),
'exception': traceback.format_exc()
})
if rc == 0:
ssh = connection_loader.get('ssh', class_only=True)
ansible_playbook_pid = sys.argv[1]
cp = ssh._create_control_path(play_context.remote_addr, play_context.port, play_context.remote_user, play_context.connection, ansible_playbook_pid)
# create the persistent connection dir if need be and create the paths
# which we will be using later
tmp_path = unfrackpath(C.PERSISTENT_CONTROL_PATH_DIR)
makedirs_safe(tmp_path)
lock_path = unfrackpath("%s/.ansible_pc_lock" % tmp_path)
socket_path = unfrackpath(cp % dict(directory=tmp_path))
# if the socket file doesn't exist, spin up the daemon process
lock_fd = os.open(lock_path, os.O_RDWR | os.O_CREAT, 0o600)
fcntl.lockf(lock_fd, fcntl.LOCK_EX)
if not os.path.exists(socket_path):
messages.append('local domain socket does not exist, starting it')
original_path = os.getcwd()
r, w = os.pipe()
pid = fork_process()
if pid == 0:
try:
os.close(r)
wfd = os.fdopen(w, 'w')
process = ConnectionProcess(wfd, play_context, socket_path, original_path, ansible_playbook_pid)
process.start()
except Exception:
messages.append(traceback.format_exc())
rc = 1
fcntl.lockf(lock_fd, fcntl.LOCK_UN)
os.close(lock_fd)
if rc == 0:
process.run()
sys.exit(rc)
else:
os.close(w)
rfd = os.fdopen(r, 'r')
data = json.loads(rfd.read())
messages.extend(data.pop('messages'))
result.update(data)
else:
messages.append('found existing local domain socket, using it!')
conn = Connection(socket_path)
pc_data = to_text(init_data)
try:
messages.extend(conn.update_play_context(pc_data))
except Exception as exc:
# Only network_cli has update_play context, so missing this is
# not fatal e.g. netconf
if isinstance(exc, ConnectionError) and getattr(exc, 'code', None) == -32601:
pass
else:
result.update({
'error': to_text(exc),
'exception': traceback.format_exc()
})
messages.append(sys.stdout.getvalue())
result.update({
'messages': messages,
'socket_path': socket_path
})
sys.stdout = saved_stdout
if 'exception' in result:
rc = 1
sys.stderr.write(json.dumps(result))
else:
rc = 0
sys.stdout.write(json.dumps(result))
sys.exit(rc)
if __name__ == '__main__':
display = Display()
main()

View File

@ -1 +0,0 @@
ansible

View File

@ -1 +0,0 @@
ansible

291
bin/ansible-doc Executable file
View File

@ -0,0 +1,291 @@
#!/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
import subprocess
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\(([^)]+)\)")
PAGER = 'less'
LESS_OPTS = 'FRSX' # -F (quit-if-one-screen) -R (allow raw ansi control chars)
# -S (chop long lines) -X (disable termcap init and de-init)
def pager_print(text):
''' just print text '''
print text
def pager_pipe(text, cmd):
''' pipe text through a pager '''
if 'LESS' not in os.environ:
os.environ['LESS'] = LESS_OPTS
try:
cmd = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=sys.stdout)
cmd.communicate(input=text)
except IOError:
pass
except KeyboardInterrupt:
pass
def pager(text):
''' find reasonable way to display text '''
# this is a much simpler form of what is in pydoc.py
if not sys.stdout.isatty():
pager_print(text)
elif 'PAGER' in os.environ:
if sys.platform == 'win32':
pager_print(text)
else:
pager_pipe(text, os.environ['PAGER'])
elif hasattr(os, 'system') and os.system('(less) 2> /dev/null') == 0:
pager_pipe(text, 'less')
else:
pager_print(text)
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 get_man_text(doc):
opt_indent=" "
text = []
text.append("> %s\n" % doc['module'].upper())
desc = "".join(doc['description'])
text.append("%s\n" % textwrap.fill(tty_ify(desc), initial_indent=" ", subsequent_indent=" "))
if 'option_keys' in doc and len(doc['option_keys']) > 0:
text.append("Options (= is mandatory):\n")
for o in sorted(doc['option_keys']):
opt = doc['options'][o]
if opt.get('required', False):
opt_leadin = "="
else:
opt_leadin = "-"
text.append("%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 + ")"
text.append("%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'])
text.append("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'])
text.append("Requirements:%s\n" % textwrap.fill(tty_ify(req), initial_indent=" ",
subsequent_indent=opt_indent))
if 'examples' in doc and len(doc['examples']) > 0:
text.append("Example%s:\n" % ('' if len(doc['examples']) < 2 else 's'))
for ex in doc['examples']:
text.append("%s\n" % (ex['code']))
if 'plainexamples' in doc and doc['plainexamples'] is not None:
text.append(doc['plainexamples'])
text.append('')
return "\n".join(text)
def get_snippet_text(doc):
text = []
desc = tty_ify("".join(doc['short_description']))
text.append("- name: %s" % (desc))
text.append(" action: %s" % (doc['module']))
for o in sorted(doc['options'].keys()):
opt = doc['options'][o]
desc = tty_ify("".join(opt['description']))
if opt.get('required', False):
s = o + "="
else:
s = o
text.append(" %-20s # %s" % (s, desc))
text.append('')
return "\n".join(text)
def get_module_list_text(module_list):
text = []
for module in sorted(set(module_list)):
if module in module_docs.BLACKLIST_MODULES:
continue
filename = utils.plugins.module_finder.find_plugin(module)
if filename is None:
continue
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 + '...'
text.append("%-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
return "\n".join(text)
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)
pager(get_module_list_text(module_list))
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)
text = ''
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:
text += get_snippet_text(doc)
else:
text += get_man_text(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)
pager(text)
if __name__ == '__main__':
main()

View File

@ -1 +0,0 @@
ansible

814
bin/ansible-galaxy Executable file
View File

@ -0,0 +1,814 @@
#!/usr/bin/env python
########################################################################
#
# (C) 2013, James Cammarata <jcammarata@ansible.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 datetime
import json
import os
import os.path
import shutil
import sys
import tarfile
import tempfile
import urllib
import urllib2
import yaml
from collections import defaultdict
from distutils.version import LooseVersion
from jinja2 import Environment
from optparse import OptionParser
import ansible.constants as C
default_meta_template = """---
galaxy_info:
author: {{ author }}
description: {{description}}
company: {{ company }}
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: {{ license }}
min_ansible_version: {{ min_ansible_version }}
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
{%- for platform,versions in platforms.iteritems() %}
#- name: {{ platform }}
# versions:
# - all
{%- for version in versions %}
# - {{ version }}
{%- endfor %}
{%- endfor %}
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
{%- for category in categories %}
#- {{ category.name }}
{%- endfor %}
dependencies: []
# List your role dependencies here, one per line. Only
# dependencies available via galaxy should be listed here.
# Be sure to remove the '[]' above if you add dependencies
# to this list.
{% for dependency in dependencies %}
#- {{ dependency }}
{% endfor %}
"""
default_readme_template = """Role Name
========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
-------------------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
"""
#-------------------------------------------------------------------------------------
# Utility functions for parsing actions/options
#-------------------------------------------------------------------------------------
VALID_ACTIONS = ("init", "info", "install", "list", "remove")
def get_action(args):
"""
Get the action the user wants to execute from the
sys argv list.
"""
for i in range(0,len(args)):
arg = args[i]
if arg in VALID_ACTIONS:
del args[i]
return arg
return None
def build_option_parser(action):
"""
Builds an option parser object based on the action
the user wants to execute.
"""
usage = "usage: %%prog [%s] [--help] [options] ..." % "|".join(VALID_ACTIONS)
epilog = "\nSee '%s <command> --help' for more information on a specific command.\n\n" % os.path.basename(sys.argv[0])
OptionParser.format_epilog = lambda self, formatter: self.epilog
parser = OptionParser(usage=usage, epilog=epilog)
if not action:
parser.print_help()
sys.exit()
# options for all actions
# - none yet
# options specific to actions
if action == "info":
parser.set_usage("usage: %prog info [options] role_name[,version]")
elif action == "init":
parser.set_usage("usage: %prog init [options] role_name")
parser.add_option(
'-p', '--init-path', dest='init_path', default="./",
help='The path in which the skeleton role will be created. '
'The default is the current working directory.')
elif action == "install":
parser.set_usage("usage: %prog install [options] [-r FILE | role_name(s)[,version] | tar_file(s)]")
parser.add_option(
'-i', '--ignore-errors', dest='ignore_errors', action='store_true', default=False,
help='Ignore errors and continue with the next specified role.')
parser.add_option(
'-n', '--no-deps', dest='no_deps', action='store_true', default=False,
help='Don\'t download roles listed as dependencies')
parser.add_option(
'-r', '--role-file', dest='role_file',
help='A file containing a list of roles to be imported')
elif action == "remove":
parser.set_usage("usage: %prog remove role1 role2 ...")
elif action == "list":
parser.set_usage("usage: %prog list [role_name]")
# options that apply to more than one action
if action != "init":
parser.add_option(
'-p', '--roles-path', dest='roles_path', default=C.DEFAULT_ROLES_PATH,
help='The path to the directory containing your roles. '
'The default is the roles_path configured in your '
'ansible.cfg file (/etc/ansible/roles if not configured)')
if action in ("info","init","install"):
parser.add_option(
'-s', '--server', dest='api_server', default="galaxy.ansible.com",
help='The API server destination')
if action in ("init","install"):
parser.add_option(
'-f', '--force', dest='force', action='store_true', default=False,
help='Force overwriting an existing role')
# done, return the parser
return parser
def get_opt(options, k, defval=""):
"""
Returns an option from an Optparse values instance.
"""
try:
data = getattr(options, k)
except:
return defval
if k == "roles_path":
if os.pathsep in data:
data = data.split(os.pathsep)[0]
return data
def exit_without_ignore(options, rc=1):
"""
Exits with the specified return code unless the
option --ignore-errors was specified
"""
if not get_opt(options, "ignore_errors", False):
print 'You can use --ignore-errors to skip failed roles.'
sys.exit(rc)
#-------------------------------------------------------------------------------------
# Galaxy API functions
#-------------------------------------------------------------------------------------
def api_get_config(api_server):
"""
Fetches the Galaxy API current version to ensure
the API server is up and reachable.
"""
try:
url = 'https://%s/api/' % api_server
data = json.load(urllib2.urlopen(url))
if not data.get("current_version",None):
return None
else:
return data
except:
return None
def api_lookup_role_by_name(api_server, role_name):
"""
Uses the Galaxy API to do a lookup on the role owner/name.
"""
role_name = urllib.quote(role_name)
try:
parts = role_name.split(".")
user_name = ".".join(parts[0:-1])
role_name = parts[-1]
print " downloading role '%s', owned by %s" % (role_name, user_name)
except:
parser.print_help()
print "Invalid role name (%s). You must specify username.rolename" % role_name
sys.exit(1)
url = 'https://%s/api/v1/roles/?owner__username=%s&name=%s' % (api_server,user_name,role_name)
try:
data = json.load(urllib2.urlopen(url))
if len(data["results"]) == 0:
return None
else:
return data["results"][0]
except:
return None
def api_fetch_role_related(api_server, related, role_id):
"""
Uses the Galaxy API to fetch the list of related items for
the given role. The url comes from the 'related' field of
the role.
"""
try:
url = 'https://%s/api/v1/roles/%d/%s/?page_size=50' % (api_server, int(role_id), related)
data = json.load(urllib2.urlopen(url))
results = data['results']
done = (data.get('next', None) == None)
while not done:
url = 'https://%s%s' % (api_server, data['next'])
print url
data = json.load(urllib2.urlopen(url))
results += data['results']
done = (data.get('next', None) == None)
return results
except:
return None
def api_get_list(api_server, what):
"""
Uses the Galaxy API to fetch the list of items specified.
"""
try:
url = 'https://%s/api/v1/%s/?page_size' % (api_server, what)
data = json.load(urllib2.urlopen(url))
if "results" in data:
results = data['results']
else:
results = data
done = True
if "next" in data:
done = (data.get('next', None) == None)
while not done:
url = 'https://%s%s' % (api_server, data['next'])
print url
data = json.load(urllib2.urlopen(url))
results += data['results']
done = (data.get('next', None) == None)
return results
except:
print " - failed to download the %s list" % what
return None
#-------------------------------------------------------------------------------------
# Role utility functions
#-------------------------------------------------------------------------------------
def get_role_path(role_name, options):
"""
Returns the role path based on the roles_path option
and the role name.
"""
roles_path = get_opt(options,'roles_path')
roles_path = os.path.join(roles_path, role_name)
roles_path = os.path.expanduser(roles_path)
return roles_path
def get_role_metadata(role_name, options):
"""
Returns the metadata as YAML, if the file 'meta/main.yml'
exists in the specified role_path
"""
role_path = os.path.join(get_role_path(role_name, options), 'meta/main.yml')
try:
if os.path.isfile(role_path):
f = open(role_path, 'r')
meta_data = yaml.safe_load(f)
f.close()
return meta_data
else:
return None
except:
return None
def get_galaxy_install_info(role_name, options):
"""
Returns the YAML data contained in 'meta/.galaxy_install_info',
if it exists.
"""
try:
info_path = os.path.join(get_role_path(role_name, options), 'meta/.galaxy_install_info')
if os.path.isfile(info_path):
f = open(info_path, 'r')
info_data = yaml.safe_load(f)
f.close()
return info_data
else:
return None
except:
return None
def write_galaxy_install_info(role_name, role_version, options):
"""
Writes a YAML-formatted file to the role's meta/ directory
(named .galaxy_install_info) which contains some information
we can use later for commands like 'list' and 'info'.
"""
info = dict(
version = role_version,
install_date = datetime.datetime.utcnow().strftime("%c"),
)
try:
info_path = os.path.join(get_role_path(role_name, options), 'meta/.galaxy_install_info')
f = open(info_path, 'w+')
info_data = yaml.safe_dump(info, f)
f.close()
except:
return False
return True
def remove_role(role_name, options):
"""
Removes the specified role from the roles path. There is a
sanity check to make sure there's a meta/main.yml file at this
path so the user doesn't blow away random directories
"""
if get_role_metadata(role_name, options):
role_path = get_role_path(role_name, options)
shutil.rmtree(role_path)
return True
else:
return False
def fetch_role(role_name, target, role_data, options):
"""
Downloads the archived role from github to a temp location, extracts
it, and then copies the extracted role to the role library path.
"""
# first grab the file and save it to a temp location
archive_url = 'https://github.com/%s/%s/archive/%s.tar.gz' % (role_data["github_user"], role_data["github_repo"], target)
print " - downloading role from %s" % archive_url
try:
url_file = urllib2.urlopen(archive_url)
temp_file = tempfile.NamedTemporaryFile(delete=False)
data = url_file.read()
while data:
temp_file.write(data)
data = url_file.read()
temp_file.close()
return temp_file.name
except Exception, e:
# TODO: better urllib2 error handling for error
# messages that are more exact
print "Error: failed to download the file."
return False
def install_role(role_name, role_version, role_filename, options):
# the file is a tar, so open it that way and extract it
# to the specified (or default) roles directory
if not tarfile.is_tarfile(role_filename):
print "Error: the file downloaded was not a tar.gz"
return False
else:
role_tar_file = tarfile.open(role_filename, "r:gz")
# verify the role's meta file
meta_file = None
members = role_tar_file.getmembers()
for member in members:
if "/meta/main.yml" in member.name:
meta_file = member
break
if not meta_file:
print "Error: this role does not appear to have a meta/main.yml file."
return False
else:
try:
meta_file_data = yaml.safe_load(role_tar_file.extractfile(meta_file))
except:
print "Error: this role does not appear to have a valid meta/main.yml file."
return False
# we strip off the top-level directory for all of the files contained within
# the tar file here, since the default is 'github_repo-target', and change it
# to the specified role's name
role_path = os.path.join(get_opt(options, 'roles_path', '/etc/ansible/roles'), role_name)
role_path = os.path.expanduser(role_path)
print " - extracting %s to %s" % (role_name, role_path)
try:
if os.path.exists(role_path):
if not os.path.isdir(role_path):
print "Error: the specified roles path exists and is not a directory."
return False
elif not get_opt(options, "force", False):
print "Error: the specified role %s appears to already exist. Use --force to replace it." % role_name
return False
else:
# using --force, remove the old path
if not remove_role(role_name, options):
print "Error: %s doesn't appear to contain a role." % role_path
print "Please remove this directory manually if you really want to put the role here."
return False
else:
os.makedirs(role_path)
# now we do the actual extraction to the role_path
for member in members:
# we only extract files
if member.isreg():
member.name = "/".join(member.name.split("/")[1:])
role_tar_file.extract(member, role_path)
# write out the install info file for later use
write_galaxy_install_info(role_name, role_version, options)
except OSError, e:
print "Error: you do not have permission to modify files in %s" % role_path
return False
# return the parsed yaml metadata
print "%s was installed successfully" % role_name
return meta_file_data
#-------------------------------------------------------------------------------------
# Action functions
#-------------------------------------------------------------------------------------
def execute_init(args, options, parser):
"""
Executes the init action, which creates the skeleton framework
of a role that complies with the galaxy metadata format.
"""
init_path = get_opt(options, 'init_path', './')
api_server = get_opt(options, "api_server", "galaxy.ansible.com")
force = get_opt(options, 'force', False)
api_config = api_get_config(api_server)
if not api_config:
print "The API server (%s) is not responding, please try again later." % api_server
sys.exit(1)
try:
role_name = args.pop(0).strip()
if role_name == "":
raise Exception("")
role_path = os.path.join(init_path, role_name)
if os.path.exists(role_path):
if os.path.isfile(role_path):
print "The path %s already exists, but is a file - aborting" % role_path
sys.exit(1)
elif not force:
print "The directory %s already exists." % role_path
print ""
print "You can use --force to re-initialize this directory,\n" + \
"however it will reset any main.yml files that may have\n" + \
"been modified there already."
sys.exit(1)
except Exception, e:
parser.print_help()
print "No role name specified for init"
sys.exit(1)
ROLE_DIRS = ('defaults','files','handlers','meta','tasks','templates','vars')
# create the default README.md
if not os.path.exists(role_path):
os.makedirs(role_path)
readme_path = os.path.join(role_path, "README.md")
f = open(readme_path, "wb")
f.write(default_readme_template)
f.close
for dir in ROLE_DIRS:
dir_path = os.path.join(init_path, role_name, dir)
main_yml_path = os.path.join(dir_path, 'main.yml')
# create the directory if it doesn't exist already
if not os.path.exists(dir_path):
os.makedirs(dir_path)
# now create the main.yml file for that directory
if dir == "meta":
# create a skeleton meta/main.yml with a valid galaxy_info
# datastructure in place, plus with all of the available
# tags/platforms included (but commented out) and the
# dependencies section
platforms = api_get_list(api_server, "platforms")
if not platforms:
platforms = []
categories = api_get_list(api_server, "categories")
if not categories:
categories = []
# group the list of platforms from the api based
# on their names, with the release field being
# appended to a list of versions
platform_groups = defaultdict(list)
for platform in platforms:
platform_groups[platform['name']].append(platform['release'])
platform_groups[platform['name']].sort()
inject = dict(
author = 'your name',
company = 'your company (optional)',
license = 'license (GPLv2, CC-BY, etc)',
min_ansible_version = '1.2',
platforms = platform_groups,
categories = categories,
)
rendered_meta = Environment().from_string(default_meta_template).render(inject)
f = open(main_yml_path, 'w')
f.write(rendered_meta)
f.close()
pass
elif dir not in ('files','templates'):
# just write a (mostly) empty YAML file for main.yml
f = open(main_yml_path, 'w')
f.write('---\n# %s file for %s\n' % (dir,role_name))
f.close()
print "%s was created successfully" % role_name
def execute_info(args, options, parser):
"""
Executes the info action. This action prints out detailed
information about an installed role as well as info available
from the galaxy API.
"""
pass
def execute_install(args, options, parser):
"""
Executes the installation action. The args list contains the
roles to be installed, unless -f was specified. The list of roles
can be a name (which will be downloaded via the galaxy API and github),
or it can be a local .tar.gz file.
"""
role_file = get_opt(options, "role_file", None)
api_server = get_opt(options, "api_server", "galaxy.ansible.com")
no_deps = get_opt(options, "no_deps", False)
if len(args) == 0 and not role_file:
# the user needs to specify one of either --role-file
# or specify a single user/role name
parser.print_help()
print "You must specify a user/role name or a roles file"
sys.exit()
elif len(args) == 1 and role_file:
# using a role file is mutually exclusive of specifying
# the role name on the command line
parser.print_help()
print "Please specify a user/role name, or a roles file, but not both"
sys.exit(1)
api_config = api_get_config(api_server)
if not api_config:
print "The API server (%s) is not responding, please try again later." % api_server
sys.exit(1)
roles_done = []
if role_file:
# roles listed in a file, one per line
# so we'll go through and grab them all
f = open(role_file, 'r')
roles_left = f.readlines()
f.close()
else:
# roles were specified directly, so we'll just go out grab them
# (and their dependencies, unless the user doesn't want us to).
roles_left = args
while len(roles_left) > 0:
# query the galaxy API for the role data
role_name = roles_left.pop(0).strip()
role_version = None
if role_name == "" or role_name.startswith("#"):
continue
elif ',' in role_name:
role_name,role_version = role_name.split(',',1)
role_name = role_name.strip()
role_version = role_version.strip()
if os.path.isfile(role_name):
# installing a local tar.gz
tar_file = role_name
role_name = os.path.basename(role_name).replace('.tar.gz','')
if tarfile.is_tarfile(tar_file):
print " - installing %s as %s" % (tar_file, role_name)
if not install_role(role_name, role_version, tar_file, options):
exit_without_ignore(options)
else:
print "%s (%s) was NOT installed successfully." % (role_name,tar_file)
exit_without_ignore(options)
else:
# installing remotely
role_data = api_lookup_role_by_name(api_server, role_name)
if not role_data:
print "Sorry, %s was not found on %s." % (role_name, api_server)
continue
role_versions = api_fetch_role_related(api_server, 'versions', role_data['id'])
if not role_version:
# convert the version names to LooseVersion objects
# and sort them to get the latest version. If there
# are no versions in the list, we'll grab the head
# of the master branch
if len(role_versions) > 0:
loose_versions = [LooseVersion(a.get('name',None)) for a in role_versions]
loose_versions.sort()
role_version = str(loose_versions[-1])
else:
role_version = 'master'
print " no version specified, installing %s" % role_version
else:
if role_versions and role_version not in [a.get('name',None) for a in role_versions]:
print "The specified version (%s) was not found in the list of available versions." % role_version
exit_without_ignore(options)
continue
# download the role. if --no-deps was specified, we stop here,
# otherwise we recursively grab roles and all of their deps.
tmp_file = fetch_role(role_name, role_version, role_data, options)
if tmp_file and install_role(role_name, role_version, tmp_file, options):
# we're done with the temp file, clean it up
os.unlink(tmp_file)
# install dependencies, if we want them
if not no_deps:
role_dependencies = role_data['summary_fields']['dependencies'] # api_fetch_role_related(api_server, 'dependencies', role_data['id'])
for dep_name in role_dependencies:
#dep_name = "%s.%s" % (dep['owner'], dep['name'])
if not get_role_metadata(dep_name, options):
print ' adding dependency: %s' % dep_name
roles_left.append(dep_name)
else:
print ' dependency %s is already installed, skipping.' % dep_name
else:
if tmp_file:
os.unlink(tmp_file)
print "%s was NOT installed successfully." % role_name
exit_without_ignore(options)
sys.exit(0)
def execute_remove(args, options, parser):
"""
Executes the remove action. The args list contains the list
of roles to be removed. This list can contain more than one role.
"""
if len(args) == 0:
parser.print_help()
print 'You must specify at least one role to remove.'
sys.exit()
for role in args:
if get_role_metadata(role, options):
if remove_role(role, options):
print 'successfully removed %s' % role
else:
print "failed to remove role: %s" % role
else:
print '%s is not installed, skipping.' % role
sys.exit(0)
def execute_list(args, options, parser):
"""
Executes the list action. The args list can contain zero
or one role. If one is specified, only that role will be
shown, otherwise all roles in the specified directory will
be shown.
"""
if len(args) > 1:
print "Please specify only one role to list, or specify no roles to see a full list"
sys.exit(1)
if len(args) == 1:
# show only the request role, if it exists
role_name = args[0]
metadata = get_role_metadata(role_name, options)
if metadata:
install_info = get_galaxy_install_info(role_name, options)
version = None
if install_info:
version = install_info.get("version", None)
if not version:
version = "(unknown version)"
# show some more info about single roles here
print " %s, %s" % (role_name, version)
else:
print "The role %s was not found" % role_name
else:
# show all valid roles in the roles_path directory
roles_path = get_opt(options, 'roles_path')
roles_path = os.path.expanduser(roles_path)
if not os.path.exists(roles_path):
parser.print_help()
print "The path %s does not exist. Please specify a valid path with --roles-path" % roles_path
sys.exit(1)
elif not os.path.isdir(roles_path):
print "%s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path
parser.print_help()
sys.exit(1)
path_files = os.listdir(roles_path)
for path_file in path_files:
if get_role_metadata(path_file, options):
install_info = get_galaxy_install_info(path_file, options)
version = None
if install_info:
version = install_info.get("version", None)
if not version:
version = "(unknown version)"
print " %s, %s" % (path_file, version)
sys.exit(0)
#-------------------------------------------------------------------------------------
# The main entry point
#-------------------------------------------------------------------------------------
def main():
# parse the CLI options
action = get_action(sys.argv)
parser = build_option_parser(action)
(options, args) = parser.parse_args()
# execute the desired action
if 1: #try:
fn = globals()["execute_%s" % action]
fn(args, options, parser)
#except KeyError, e:
# print "Error: %s is not a valid action. Valid actions are: %s" % (action, ", ".join(VALID_ACTIONS))
# sys.exit(1)
if __name__ == "__main__":
main()

View File

@ -1 +0,0 @@
ansible

View File

@ -1 +0,0 @@
ansible

324
bin/ansible-playbook Executable file
View File

@ -0,0 +1,324 @@
#!/usr/bin/env python
# (C) 2012, Michael DeHaan, <michael.dehaan@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/>.
#######################################################
#__requires__ = ['ansible']
#import pkg_resources
import sys
import os
import stat
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 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, color=True):
if ANSIBLE_COLOR and color:
if stats['failures'] != 0 or stats['unreachable'] != 0:
return "%-37s" % stringc(host, 'red')
elif stats['changed'] != 0:
return "%-37s" % stringc(host, 'yellow')
else:
return "%-37s" % stringc(host, 'green')
return "%-26s" % host
def main(args):
''' run ansible-playbook operations '''
# create parser for CLI options
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('--vault-password', dest="vault_password",
# help="password for vault encrypted files")
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('--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="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")
parser.add_option('--force-handlers', dest='force_handlers', action='store_true',
help="run handlers even if a task fails")
options, args = parser.parse_args(args)
if len(args) == 0:
parser.print_help(file=sys.stderr)
return 1
# su and sudo command line arguments need to be mutually exclusive
if (options.su or options.su_user or options.ask_su_pass) and \
(options.sudo or options.sudo_user or options.ask_sudo_pass):
parser.error("Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') "
"and su arguments ('-su', '--su-user', and '--ask-su-pass') are "
"mutually exclusive")
if (options.ask_vault_pass and options.vault_password_file):
parser.error("--ask-vault-pass and --vault-password-file are mutually exclusive")
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
su_pass = None
vault_pass = None
if not options.listhosts and not options.syntax and not options.listtasks:
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_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
options.ask_su_pass = options.ask_su_pass or C.DEFAULT_ASK_SU_PASS
options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_PASS
(sshpass, sudopass, su_pass, vault_pass) = utils.ask_passwords(ask_pass=options.ask_pass, ask_sudo_pass=options.ask_sudo_pass, ask_su_pass=options.ask_su_pass, ask_vault_pass=options.ask_vault_pass)
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
options.su_user = options.su_user or C.DEFAULT_SU_USER
if options.vault_password_file:
this_path = os.path.expanduser(options.vault_password_file)
try:
f = open(this_path, "rb")
tmp_vault_pass=f.read().strip()
f.close()
except (OSError, IOError), e:
raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
if not options.ask_vault_pass:
vault_pass = tmp_vault_pass
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:], vault_password=vault_pass))
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) or stat.S_ISFIFO(os.stat(playbook).st_mode)):
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,
inventory=inventory,
forks=options.forks,
remote_user=options.remote_user,
remote_pass=sshpass,
callbacks=playbook_cb,
runner_callbacks=runner_cb,
stats=stats,
timeout=options.timeout,
transport=options.connection,
sudo=options.sudo,
sudo_user=options.sudo_user,
sudo_pass=sudopass,
extra_vars=extra_vars,
private_key_file=options.private_key_file,
only_tags=only_tags,
skip_tags=skip_tags,
check=options.check,
diff=options.diff,
su=options.su,
su_pass=su_pass,
su_user=options.su_user,
vault_password=vault_pass,
force_handlers=options.force_handlers
)
if options.listhosts or options.listtasks or options.syntax:
print ''
print 'playbook: %s' % playbook
print ''
playnum = 0
for (play_ds, play_basedir) in zip(pb.playbook, pb.play_basedirs):
playnum += 1
play = ansible.playbook.Play(pb, play_ds, play_basedir)
label = play.name
hosts = pb.inventory.list_hosts(play.hosts)
# Filter all tasks by given tags
if pb.only_tags != 'all':
if options.subset and not hosts:
continue
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
if options.listhosts:
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
for host in hosts:
print ' %s' % host
if options.listtasks:
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())
display(callbacks.banner("PLAY RECAP"))
playbook_cb.on_stats(pb.stats)
for h in hosts:
t = pb.stats.summarize(h)
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')),
screen_only=True
)
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:
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:
display("ERROR: %s" % e, color='red', stderr=True)
sys.exit(1)
except KeyboardInterrupt, ke:
display("ERROR: interrupted", color='red', stderr=True)
sys.exit(1)

View File

@ -1 +0,0 @@
ansible

230
bin/ansible-pull Executable file
View File

@ -0,0 +1,230 @@
#!/usr/bin/env python
# (c) 2012, Stephen Fromm <sfromm@gmail.com>
#
# 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/>.
#
# ansible-pull is a script that runs ansible in local mode
# 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.
# usage:
# ansible-pull -d /var/lib/ansible \
# -U http://example.net/content.git [-C production] \
# [path/playbook.yml]
#
# the -d and -U arguments are required; the -C argument is optional.
#
# ansible-pull accepts an optional argument to specify a playbook
# location underneath the workdir and then searches the source repo
# for playbooks in the following order, stopping at the first match:
#
# 1. $workdir/path/playbook.yml, if specified
# 2. $workdir/$fqdn.yml
# 3. $workdir/$hostname.yml
# 4. $workdir/local.yml
#
# the source repo must contain at least one of these playbooks.
import os
import shutil
import subprocess
import sys
import datetime
import socket
import random
import time
from ansible import utils
from ansible.utils import cmd_functions
from ansible import errors
DEFAULT_REPO_TYPE = 'git'
DEFAULT_PLAYBOOK = 'local.yml'
PLAYBOOK_ERRORS = {1: 'File does not exist',
2: 'File is not readable'}
VERBOSITY=0
def increment_debug(option, opt, value, parser):
global VERBOSITY
VERBOSITY += 1
def try_playbook(path):
if not os.path.exists(path):
return 1
if not os.access(path, os.R_OK):
return 2
return 0
def select_playbook(path, args):
playbook = None
if len(args) > 0 and args[0] is not None:
playbook = "%s/%s" % (path, args[0])
rc = try_playbook(playbook)
if rc != 0:
print >>sys.stderr, "%s: %s" % (playbook, PLAYBOOK_ERRORS[rc])
return None
return playbook
else:
fqdn = socket.getfqdn()
hostpb = "%s/%s.yml" % (path, fqdn)
shorthostpb = "%s/%s.yml" % (path, fqdn.split('.')[0])
localpb = "%s/%s" % (path, DEFAULT_PLAYBOOK)
errors = []
for pb in [hostpb, shorthostpb, localpb]:
rc = try_playbook(pb)
if rc == 0:
playbook = pb
break
else:
errors.append("%s: %s" % (pb, PLAYBOOK_ERRORS[rc]))
if playbook is None:
print >>sys.stderr, "\n".join(errors)
return playbook
def main(args):
""" Set up and run a local playbook """
usage = "%prog [options] [playbook.yml]"
parser = utils.SortedOptParser(usage=usage)
parser.add_option('--purge', default=False, action='store_true',
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('-s', '--sleep', dest='sleep', default=None,
help='sleep for random interval (between 0 and n number of seconds) before starting. this is a useful way to disperse git requests')
parser.add_option('-f', '--force', dest='force', default=False,
action='store_true',
help='run the playbook even if the repository could '
'not be updated')
parser.add_option('-d', '--directory', dest='dest', default=None,
help='directory to checkout repository to')
#parser.add_option('-l', '--live', default=True, action='store_live',
# help='Print the ansible-playbook output while running')
parser.add_option('-U', '--url', dest='url', default=None,
help='URL of the playbook repository')
parser.add_option('-C', '--checkout', dest='checkout',
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('-e', '--extra-vars', dest="extra_vars", action="append",
help="set additional variables as key=value or YAML/JSON", default=[])
parser.add_option('-v', '--verbose', default=False, action="callback",
callback=increment_debug,
help='Pass -vvvv to ansible-playbook')
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)
parser.add_option('--vault-password-file', dest='vault_password_file',
help="vault password file")
parser.add_option('-K', '--ask-sudo-pass', default=False, dest='ask_sudo_pass', action='store_true',
help='ask for sudo password')
options, args = parser.parse_args(args)
hostname = socket.getfqdn()
if not options.dest:
# use a hostname dependent directory, in case of $HOME on nfs
options.dest = utils.prepare_writeable_dir('~/.ansible/pull/%s' % hostname)
options.dest = os.path.abspath(options.dest)
if not options.url:
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")
inv_opts = 'localhost,'
limit_opts = 'localhost:%s:127.0.0.1' % hostname
repo_opts = "name=%s dest=%s" % (options.url, options.dest)
if VERBOSITY == 0:
base_opts = '-c local --limit "%s"' % limit_opts
elif VERBOSITY > 0:
debug_level = ''.join([ "v" for x in range(0, VERBOSITY) ])
base_opts = '-%s -c local --limit "%s"' % (debug_level, limit_opts)
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
)
if options.sleep:
try:
secs = random.randint(0,int(options.sleep));
except ValueError:
parser.error("%s is not a number." % options.sleep)
return 1
print >>sys.stderr, "Sleeping for %d seconds..." % secs
time.sleep(secs);
# RUN THe CHECKOUT COMMAND
rc, out, err = cmd_functions.run_cmd(cmd, live=True)
if rc != 0:
if options.force:
print "Unable to update repository. Continuing with (forced) run of playbook."
else:
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)
if playbook is None:
print >>sys.stderr, "Could not find a playbook to run."
return 1
cmd = 'ansible-playbook %s %s' % (base_opts, playbook)
if options.vault_password_file:
cmd += " --vault-password-file=%s" % options.vault_password_file
if options.inventory:
cmd += ' -i "%s"' % options.inventory
for ev in options.extra_vars:
cmd += ' -e "%s"' % ev
if options.ask_sudo_pass:
cmd += ' -K'
os.chdir(options.dest)
# RUN THE PLAYBOOK COMMAND
rc, out, err = cmd_functions.run_cmd(cmd, live=True)
if options.purge:
os.chdir('/')
try:
shutil.rmtree(options.dest)
except Exception, e:
print >>sys.stderr, "Failed to remove %s: %s" % (options.dest, str(e))
return rc
if __name__ == '__main__':
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt, e:
print >>sys.stderr, "Exit on user request.\n"
sys.exit(1)

View File

@ -1 +0,0 @@
ansible

219
bin/ansible-vault Executable file
View File

@ -0,0 +1,219 @@
#!/usr/bin/env python
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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/>.
#
# ansible-pull is a script that runs ansible in local mode
# 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.
#__requires__ = ['ansible']
#import pkg_resources
import os
import sys
import traceback
from ansible import utils
from ansible import errors
from ansible.utils.vault import VaultEditor
from optparse import OptionParser
#-------------------------------------------------------------------------------------
# Utility functions for parsing actions/options
#-------------------------------------------------------------------------------------
VALID_ACTIONS = ("create", "decrypt", "edit", "encrypt", "rekey")
def build_option_parser(action):
"""
Builds an option parser object based on the action
the user wants to execute.
"""
usage = "usage: %%prog [%s] [--help] [options] file_name" % "|".join(VALID_ACTIONS)
epilog = "\nSee '%s <command> --help' for more information on a specific command.\n\n" % os.path.basename(sys.argv[0])
OptionParser.format_epilog = lambda self, formatter: self.epilog
parser = OptionParser(usage=usage, epilog=epilog)
if not action:
parser.print_help()
sys.exit()
# options for all actions
#parser.add_option('-c', '--cipher', dest='cipher', default="AES256", help="cipher to use")
parser.add_option('--debug', dest='debug', action="store_true", help="debug")
parser.add_option('--vault-password-file', dest='password_file',
help="vault password file")
# options specific to actions
if action == "create":
parser.set_usage("usage: %prog create [options] file_name")
elif action == "decrypt":
parser.set_usage("usage: %prog decrypt [options] file_name")
elif action == "edit":
parser.set_usage("usage: %prog edit [options] file_name")
elif action == "encrypt":
parser.set_usage("usage: %prog encrypt [options] file_name")
elif action == "rekey":
parser.set_usage("usage: %prog rekey [options] file_name")
# done, return the parser
return parser
def get_action(args):
"""
Get the action the user wants to execute from the
sys argv list.
"""
for i in range(0,len(args)):
arg = args[i]
if arg in VALID_ACTIONS:
del args[i]
return arg
return None
def get_opt(options, k, defval=""):
"""
Returns an option from an Optparse values instance.
"""
try:
data = getattr(options, k)
except:
return defval
if k == "roles_path":
if os.pathsep in data:
data = data.split(os.pathsep)[0]
return data
#-------------------------------------------------------------------------------------
# Command functions
#-------------------------------------------------------------------------------------
def _read_password(filename):
f = open(filename, "rb")
data = f.read()
f.close
data = data.strip()
return data
def execute_create(args, options, parser):
if len(args) > 1:
raise errors.AnsibleError("'create' does not accept more than one filename")
if not options.password_file:
password, new_password = utils.ask_vault_passwords(ask_vault_pass=True, confirm_vault=True)
else:
password = _read_password(options.password_file)
cipher = 'AES256'
if hasattr(options, 'cipher'):
cipher = options.cipher
this_editor = VaultEditor(cipher, password, args[0])
this_editor.create_file()
def execute_decrypt(args, options, parser):
if not options.password_file:
password, new_password = utils.ask_vault_passwords(ask_vault_pass=True)
else:
password = _read_password(options.password_file)
cipher = 'AES256'
if hasattr(options, 'cipher'):
cipher = options.cipher
for f in args:
this_editor = VaultEditor(cipher, password, f)
this_editor.decrypt_file()
print "Decryption successful"
def execute_edit(args, options, parser):
if len(args) > 1:
raise errors.AnsibleError("create does not accept more than one filename")
if not options.password_file:
password, new_password = utils.ask_vault_passwords(ask_vault_pass=True)
else:
password = _read_password(options.password_file)
cipher = None
for f in args:
this_editor = VaultEditor(cipher, password, f)
this_editor.edit_file()
def execute_encrypt(args, options, parser):
if not options.password_file:
password, new_password = utils.ask_vault_passwords(ask_vault_pass=True, confirm_vault=True)
else:
password = _read_password(options.password_file)
cipher = 'AES256'
if hasattr(options, 'cipher'):
cipher = options.cipher
for f in args:
this_editor = VaultEditor(cipher, password, f)
this_editor.encrypt_file()
print "Encryption successful"
def execute_rekey(args, options, parser):
if not options.password_file:
password, __ = utils.ask_vault_passwords(ask_vault_pass=True)
else:
password = _read_password(options.password_file)
__, new_password = utils.ask_vault_passwords(ask_vault_pass=False, ask_new_vault_pass=True, confirm_new=True)
cipher = None
for f in args:
this_editor = VaultEditor(cipher, password, f)
this_editor.rekey_file(new_password)
print "Rekey successful"
#-------------------------------------------------------------------------------------
# MAIN
#-------------------------------------------------------------------------------------
def main():
action = get_action(sys.argv)
parser = build_option_parser(action)
(options, args) = parser.parse_args()
# execute the desired action
try:
fn = globals()["execute_%s" % action]
fn(args, options, parser)
except Exception, err:
if options.debug:
print traceback.format_exc()
print "ERROR:",err
sys.exit(1)
if __name__ == "__main__":
main()

File diff suppressed because it is too large Load Diff

View File

@ -1,588 +0,0 @@
=======================================================
Ansible 2.0 "Over the Hills and Far Away" Release Notes
=======================================================
2.0.3 "Over the Hills and Far Away"
-----------------------------------
- Backport fix to uri module to return the body of an error response
- Backport fix to uri module to handle file:/// uris.
- Backport fix to uri module to fix traceback when handling certain
server error types.
2.0.2 "Over the Hills and Far Away"
-----------------------------------
- Backport of the 2.1 feature to ensure per-item callbacks are sent as
they occur, rather than all at once at the end of the task.
- Fixed bugs related to the iteration of tasks when certain
combinations of roles, blocks, and includes were used, especially
when handling errors in rescue/always portions of blocks.
- Fixed handling of redirects in our helper code, and ported the uri
module to use this helper code. This removes the httplib dependency
for this module while fixing some bugs related to redirects and SSL
certs.
- Fixed some bugs related to the incorrect creation of extra temp
directories for uploading files, which were not cleaned up properly.
- Improved error reporting in certain situations, to provide more
information such as the playbook file/line.
- Fixed a bug related to the variable precedence of role parameters,
especially when a role may be used both as a dependency of a role and
directly by itself within the same play.
- Fixed some bugs in the 2.0 implementation of do/until.
- Fixed some bugs related to run\_once:
- Ensure that all hosts are marked as failed if a task marked as
run\_once fails.
- Show a warning when using the free strategy when a run\_once task is
encountered, as there is no way for the free strategy to guarantee
the task is not run more than once.
- Fixed a bug where the assemble module was not honoring check mode in
some situations.
- Fixed a bug related to delegate\_to, where we were incorrectly using
variables from the inventory host rather than the delegated-to host.
- The 'package' meta-module now properly squashes items down to a
single execution (as the apt/yum/other package modules do).
- Fixed a bug related to the ansible-galaxy CLI command dealing with
paged results from the Galaxy server.
- Pipelining support is now available for the local and jail connection
plugins, which is useful for users who do not wish to have temp
files/directories created when running tasks with these connection
types.
- Improvements in support for additional shell types.
- Improvements in the code which is used to calculate checksums for
remote files.
- Some speed ups and bug fixes related to the variable merging code.
- Workaround bug in python subprocess on El Capitan that was making
vault fail when attempting to encrypt a file
- Fix lxc\_container module having predictable temp file names and
setting file permissions on the temporary file too leniently on a
temporary file that was executed as a script. Addresses CVE-2016-3096
- Fix a bug in the uri module where setting headers via module params
that start with ``HEADER_`` were causing a traceback.
- Fix bug in the free strategy that was causing it to synchronize its
workers after every task (making it a lot more like linear than it
should have been).
2.0.1 "Over the Hills and Far Away"
-----------------------------------
- Fixes a major compatibility break in the synchronize module shipped
with 2.0.0.x. That version of synchronize ran sudo on the controller
prior to running rsync. In 1.9.x and previous, sudo was run on the
host that rsync connected to. 2.0.1 restores the 1.9.x behaviour.
- Additionally, several other problems with where synchronize chose to
run when combined with delegate\_to were fixed. In particular, if a
playbook targetted localhost and then delegated\_to a remote host the
prior behavior (in 1.9.x and 2.0.0.x) was to copy files between the
src and destination directories on the delegated host. This has now
been fixed to copy between localhost and the delegated host.
- Fix a regression where synchronize was unable to deal with unicode
paths.
- Fix a regression where synchronize deals with inventory hosts that
use localhost but with an alternate port.
- Fixes a regression where the retry files feature was not implemented.
- Fixes a regression where the any\_errors\_fatal option was
implemented in 2.0 incorrectly, and also adds a feature where
any\_errors\_fatal can be set at the block level.
- Fix tracebacks when playbooks or ansible itself were located in
directories with unicode characters.
- Fix bug when sending unicode characters to an external pager for
display.
- Fix a bug with squashing loops for special modules (mostly package
managers). The optimization was squashing when the loop did not apply
to the selection of packages. This has now been fixed.
- Temp files created when using vault are now "shredded" using the unix
shred program which overwrites the file with random data.
- Some fixes to cloudstack modules for case sensitivity
- Fix non-newstyle modules (non-python modules and old-style modules)
to disabled pipelining.
- Fix fetch module failing even if fail\_on\_missing is set to False
- Fix for cornercase when local connections, sudo, and raw were used
together.
- Fix dnf module to remove dependent packages when state=absent is
specified. This was a feature of the 1.9.x version that was left out
by mistake when the module was rewritten for 2.0.
- Fix bugs with non-english locales in yum, git, and apt modules
- Fix a bug with the dnf module where state=latest could only upgrade,
not install.
- Fix to make implicit fact gathering task correctly inherit settings
from play, this might cause an error if settings environment on play
depending on 'ansible\_env' which was previously ignored
2.0 "Over the Hills and Far Away" - Jan 12, 2016
------------------------------------------------
Major Changes:
~~~~~~~~~~~~~~
- Releases are now named after Led Zeppelin songs, 1.9 will be the last
Van Halen named release.
- The new block/rescue/always directives allow for making task blocks
and exception-like semantics
- New strategy plugins (e.g. ``free``) allow control over the flow of
task execution per play. The default (``linear``) will be the same as
before.
- Improved error handling, with more detailed parser messages. General
exception handling and display has been revamped.
- Task includes are now evaluated during execution, allowing more
dynamic includes and options. Play includes are unchanged both still
use the ``include`` directive.
- "with\_" loops can now be used with task includes since they are
dynamic.
- Callback, connection, cache and lookup plugin APIs have changed.
Existing plugins might require modification to work with the new
versions.
- Callbacks are now shipped in the active directory and don't need to
be copied, just whitelisted in ansible.cfg.
- Many API changes. Those integrating directly with Ansible's API will
encounter breaking changes, but the new API is much easier to use and
test.
- Settings are now more inheritable; what you set at play, block or
role will be automatically inherited by the contained tasks. This
allows for new features to automatically be settable at all levels,
previously we had to manually code this.
- Vars are now settable at play, block, role and task level with the
``vars`` directive and scoped to the tasks contained.
- Template code now retains types for bools and numbers instead of
turning them into strings. If you need the old behaviour, quote the
value and it will get passed around as a string
- Empty variables and variables set to null in yaml will no longer be
converted to empty strings. They will retain the value of ``None``.
To go back to the old behaviour, you can override the
``null_representation`` setting to an empty string in your config
file or by setting the ``ANSIBLE_NULL_REPRESENTATION`` environment
variable.
- Added ``meta: refresh_inventory`` to force rereading the inventory in
a play. This re-executes inventory scripts, but does not force them
to ignore any cache they might use.
- New delegate\_facts directive, a boolean that allows you to apply
facts to the delegated host (true/yes) instead of the
inventory\_hostname (no/false) which is the default and previous
behaviour.
- local connections now work with 'su' as a privilege escalation method
- Ansible 2.0 has deprecated the "ssh" from ansible\_ssh\_user,
ansible\_ssh\_host, and ansible\_ssh\_port to become ansible\_user,
ansible\_host, and ansible\_port.
- New ssh configuration variables (``ansible_ssh_common_args``,
``ansible_ssh_extra_args``) can be used to configure a per-group or
per-host ssh ProxyCommand or set any other ssh options.
``ansible_ssh_extra_args`` is used to set options that are accepted
only by ssh (not sftp or scp, which have their own analogous
settings).
- ansible-pull can now verify the code it runs when using git as a
source repository, using git's code signing and verification
features.
- Backslashes used when specifying parameters in jinja2 expressions in
YAML dicts sometimes needed to be escaped twice. This has been fixed
so that escaping once works. Here's an example of how playbooks need
to be modified:
.. code:: yaml
# Syntax in 1.9.x
- debug:
msg: "{{ 'test1_junk 1\\\\3' | regex_replace('(.*)_junk (.*)', '\\\\1 \\\\2') }}"
# Syntax in 2.0.x
- debug:
msg: "{{ 'test1_junk 1\\3' | regex_replace('(.*)_junk (.*)', '\\1 \\2') }}"
# Output:
"msg": "test1 1\\3"
- When a string with a trailing newline was specified in the playbook
via yaml dict format, the trailing newline was stripped. When
specified in key=value format the trailing newlines were kept. In v2,
both methods of specifying the string will keep the trailing
newlines. If you relied on the trailing newline being stripped you
can change your playbook like this:
.. code:: yaml
# Syntax in 1.9.2
vars:
message: >
Testing
some things
tasks:
- debug:
msg: "{{ message }}"
# Syntax in 2.0.x
vars:
old_message: >
Testing
some things
message: "{{ old_messsage[:-1] }}"
- debug:
msg: "{{ message }}"
# Output
"msg": "Testing some things"
- In 1.9.x, newlines in templates were converted to Unix EOL
conventions. If someone wanted a templated file to end up with
Windows or Mac EOL conventions, this could cause problems for them.
In 2.x newlines now remain as specified in the template file.
- When specifying complex args as a variable, the variable must use the
full jinja2 variable syntax ('{{var\_name}}') - bare variable names
there are no longer accepted. In fact, even specifying args with
variables has been deprecated, and will not be allowed in future
versions:
.. code:: yaml
---
- hosts: localhost
connection: local
gather_facts: false
vars:
my_dirs:
- { path: /tmp/3a, state: directory, mode: 0755 }
- { path: /tmp/3b, state: directory, mode: 0700 }
tasks:
- file:
args: "{{item}}"
with_items: my_dirs
- The bigip\* networking modules have a new parameter, validate\_certs.
When True (the default) the module will validate any hosts it
connects to against the TLS certificates it presents when run on new
enough python versions. If the python version is too old to validate
certificates or you used certificates that cannot be validated
against available CAs you will need to add validate\_certs=no to your
playbook for those tasks.
Plugins
~~~~~~~
- Rewritten dnf module that should be faster and less prone to
encountering bugs in cornercases
- WinRM connection plugin passes all vars named ``ansible_winrm_*`` to
the underlying pywinrm client. This allows, for instance,
``ansible_winrm_server_cert_validation=ignore`` to be used with newer
versions of pywinrm to disable certificate validation on Python
2.7.9+.
- WinRM connection plugin put\_file is significantly faster and no
longer has file size limitations.
Deprecated Modules (new ones in parens):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ec2\_ami\_search (ec2\_ami\_find)
- quantum\_network (os\_network)
- glance\_image
- nova\_compute (os\_server)
- quantum\_floating\_ip (os\_floating\_ip)
- quantum\_router (os\_router)
- quantum\_router\_gateway (os\_router)
- quantum\_router\_interface (os\_router)
New Modules:
^^^^^^^^^^^^
- amazon: ec2\_ami\_copy
- amazon: ec2\_ami\_find
- amazon: ec2\_elb\_facts
- amazon: ec2\_eni
- amazon: ec2\_eni\_facts
- amazon: ec2\_remote\_facts
- amazon: ec2\_vpc\_igw
- amazon: ec2\_vpc\_net
- amazon: ec2\_vpc\_net\_facts
- amazon: ec2\_vpc\_route\_table
- amazon: ec2\_vpc\_route\_table\_facts
- amazon: ec2\_vpc\_subnet
- amazon: ec2\_vpc\_subnet\_facts
- amazon: ec2\_win\_password
- amazon: ecs\_cluster
- amazon: ecs\_task
- amazon: ecs\_taskdefinition
- amazon: elasticache\_subnet\_group\_facts
- amazon: iam
- amazon: iam\_cert
- amazon: iam\_policy
- amazon: route53\_facts
- amazon: route53\_health\_check
- amazon: route53\_zone
- amazon: sts\_assume\_role
- amazon: s3\_bucket
- amazon: s3\_lifecycle
- amazon: s3\_logging
- amazon: sqs\_queue
- amazon: sns\_topic
- amazon: sts\_assume\_role
- apk
- bigip\_gtm\_wide\_ip
- bundler
- centurylink: clc\_aa\_policy
- centurylink: clc\_alert\_policy
- centurylink: clc\_blueprint\_package
- centurylink: clc\_firewall\_policy
- centurylink: clc\_group
- centurylink: clc\_loadbalancer
- centurylink: clc\_modify\_server
- centurylink: clc\_publicip
- centurylink: clc\_server
- centurylink: clc\_server\_snapshot
- circonus\_annotation
- consul
- consul\_acl
- consul\_kv
- consul\_session
- cloudtrail
- cloudstack: cs\_account
- cloudstack: cs\_affinitygroup
- cloudstack: cs\_domain
- cloudstack: cs\_facts
- cloudstack: cs\_firewall
- cloudstack: cs\_iso
- cloudstack: cs\_instance
- cloudstack: cs\_instancegroup
- cloudstack: cs\_ip\_address
- cloudstack: cs\_loadbalancer\_rule
- cloudstack: cs\_loadbalancer\_rule\_member
- cloudstack: cs\_network
- cloudstack: cs\_portforward
- cloudstack: cs\_project
- cloudstack: cs\_sshkeypair
- cloudstack: cs\_securitygroup
- cloudstack: cs\_securitygroup\_rule
- cloudstack: cs\_staticnat
- cloudstack: cs\_template
- cloudstack: cs\_user
- cloudstack: cs\_vmsnapshot
- cronvar
- datadog\_monitor
- deploy\_helper
- docker: docker\_login
- dpkg\_selections
- elasticsearch\_plugin
- expect
- find
- google: gce\_tag
- hall
- ipify\_facts
- iptables
- libvirt: virt\_net
- libvirt: virt\_pool
- maven\_artifact
- openstack: os\_auth
- openstack: os\_client\_config
- openstack: os\_image
- openstack: os\_image\_facts
- openstack: os\_floating\_ip
- openstack: os\_ironic
- openstack: os\_ironic\_node
- openstack: os\_keypair
- openstack: os\_network
- openstack: os\_network\_facts
- openstack: os\_nova\_flavor
- openstack: os\_object
- openstack: os\_port
- openstack: os\_project
- openstack: os\_router
- openstack: os\_security\_group
- openstack: os\_security\_group\_rule
- openstack: os\_server
- openstack: os\_server\_actions
- openstack: os\_server\_facts
- openstack: os\_server\_volume
- openstack: os\_subnet
- openstack: os\_subnet\_facts
- openstack: os\_user
- openstack: os\_user\_group
- openstack: os\_volume
- openvswitch\_db.
- osx\_defaults
- pagerduty\_alert
- pam\_limits
- pear
- profitbricks: profitbricks
- profitbricks: profitbricks\_datacenter
- profitbricks: profitbricks\_nic
- profitbricks: profitbricks\_volume
- profitbricks: profitbricks\_volume\_attachments
- profitbricks: profitbricks\_snapshot
- proxmox: proxmox
- proxmox: proxmox\_template
- puppet
- pushover
- pushbullet
- rax: rax\_clb\_ssl
- rax: rax\_mon\_alarm
- rax: rax\_mon\_check
- rax: rax\_mon\_entity
- rax: rax\_mon\_notification
- rax: rax\_mon\_notification\_plan
- rabbitmq\_binding
- rabbitmq\_exchange
- rabbitmq\_queue
- selinux\_permissive
- sendgrid
- sensu\_check
- sensu\_subscription
- seport
- slackpkg
- solaris\_zone
- taiga\_issue
- vertica\_configuration
- vertica\_facts
- vertica\_role
- vertica\_schema
- vertica\_user
- vmware: vca\_fw
- vmware: vca\_nat
- vmware: vmware\_cluster
- vmware: vmware\_datacenter
- vmware: vmware\_dns\_config
- vmware: vmware\_dvs\_host
- vmware: vmware\_dvs\_portgroup
- vmware: vmware\_dvswitch
- vmware: vmware\_host
- vmware: vmware\_migrate\_vmk
- vmware: vmware\_portgroup
- vmware: vmware\_target\_canonical\_facts
- vmware: vmware\_vm\_facts
- vmware: vmware\_vm\_vss\_dvs\_migrate
- vmware: vmware\_vmkernel
- vmware: vmware\_vmkernel\_ip\_config
- vmware: vmware\_vsan\_cluster
- vmware: vmware\_vswitch
- vmware: vsphere\_copy
- webfaction\_app
- webfaction\_db
- webfaction\_domain
- webfaction\_mailbox
- webfaction\_site
- win\_acl
- win\_dotnet\_ngen
- win\_environment
- win\_firewall\_rule
- win\_iis\_virtualdirectory
- win\_iis\_webapplication
- win\_iis\_webapppool
- win\_iis\_webbinding
- win\_iis\_website
- win\_lineinfile
- win\_nssm
- win\_package
- win\_regedit
- win\_scheduled\_task
- win\_unzip
- win\_updates
- win\_webpicmd
- xenserver\_facts
- zabbix\_host
- zabbix\_hostmacro
- zabbix\_screen
- znode
New Inventory scripts:
^^^^^^^^^^^^^^^^^^^^^^
- cloudstack
- fleetctl
- openvz
- nagios\_ndo
- nsot
- proxmox
- rudder
- serf
New Lookups:
^^^^^^^^^^^^
- credstash
- hashi\_vault
- ini
- shelvefile
New Filters:
^^^^^^^^^^^^
- combine
New Connection:
^^^^^^^^^^^^^^^
- docker: for talking to docker containers on the ansible controller
machine without using ssh.
New Callbacks:
^^^^^^^^^^^^^^
- logentries: plugin to send play data to logentries service
- skippy: same as default but does not display skip messages
Minor changes:
~~~~~~~~~~~~~~
- Many more tests. The new API makes things more testable and we took
advantage of it.
- big\_ip modules now support turning off ssl certificate validation
(use only for self-signed certificates).
- Consolidated code from modules using urllib2 to normalize features,
TLS and SNI support.
- synchronize module's dest\_port parameter now takes precedence over
the ansible\_ssh\_port inventory setting.
- Play output is now dynamically sized to terminal with a minimum of 80
coluumns (old default).
- vars\_prompt and pause are now skipped with a warning if the play is
called noninteractively (i.e. pull from cron).
- Support for OpenBSD's 'doas' privilege escalation method.
- Most vault operations can now be done over multilple files.
- ansible-vault encrypt/decrypt read from stdin if no other input file
is given, and can write to a given ``--output file`` (including
stdout, '-'). This lets you avoid ever writing sensitive plaintext to
disk.
- ansible-vault rekey accepts the --new-vault-password-file option.
- ansible-vault now preserves file permissions on edit and rekey and
defaults to restrictive permissions for other options.
- Configuration items defined as paths (local only) now all support
shell style interpolations.
- Many fixes and new options added to modules, too many to list here.
- Now you can see task file and line number when using verbosity of 3
or above.
- The ``[x-y]`` host range syntax is no longer supported. Note that
``[0:1]`` matches two hosts, i.e. the range is inclusive of its
endpoints.
- We now recommend the use of ``pattern1,pattern2`` to combine host
matching patterns.
- The use of ':' as a separator conflicts with IPv6 addresses and host
ranges. It will be deprecated in the future.
- The undocumented use of ';' as a separator is now deprecated.
- modules and callbacks have been extended to support no\_log to avoid
data disclosure.
- new managed\_syslog option has been added to control output to syslog
on managed machines, no\_log supersedes this settings.
- Lookup, vars and action plugin pathing has been normalized, all now
follow the same sequence to find relative files.
- We do not ignore the explicitly set login user for ssh when it
matches the 'current user' anymore, this allows overriding
.ssh/config when it is set explicitly. Leaving it unset will still
use the same user and respect .ssh/config. This also means
ansible\_ssh\_user can now return a None value.
- environment variables passed to remote shells now default to
'controller' settings, with fallback to en\_US.UTF8 which was the
previous default.
- add\_hosts is much stricter about host name and will prevent invalid
names from being added.
- ansible-pull now defaults to doing shallow checkouts with git, use
``--full`` to return to previous behaviour.
- random cows are more random
- when: now gets the registered var after the first iteration, making
it possible to break out of item loops
- Handling of undefined variables has changed. In most places they will
now raise an error instead of silently injecting an empty string. Use
the default filter if you want to approximate the old behaviour:
::
- debug: msg="The error message was: {{error_code |default('') }}"
- The yum module's detection of installed packages has been made more
robust by using /usr/bin/rpm in cases where it woud have used
repoquery before.
- The pip module now properly reports changes when packages are coming
from a VCS.
- Fixes for retrieving files over https when a CONNECT-only proxy is in
the middle.

View File

@ -1,394 +0,0 @@
=====================================================
Ansible 2.1 "The Song Remains the Same" Release Notes
=====================================================
2.1.6 "The Song Remains the Same" - 06-01-2017
----------------------------------------------
- Security fix for CVE-2017-7481 - data for lookup plugins used as
variables was not being correctly marked as "unsafe".
2.1.5 "The Song Remains the Same" - 03-27-2017
----------------------------------------------
- Security continued fix for CVE-2016-9587 - Handle some additional
corner cases in the way conditionals are parsed and evaluated.
2.1.4 "The Song Remains the Same" - 2017-01-16
----------------------------------------------
- Security fix for CVE-2016-9587 - An attacker with control over a
client system being managed by Ansible and the ability to send facts
back to the Ansible server could use this flaw to execute arbitrary
code on the Ansible server as the user and group Ansible is running
as.
- Fixed a bug with conditionals in loops, where undefined variables and
other errors will defer raising the error until the conditional has
been evaluated.
- Added a version check for jinja2-2.9, which does not fully work with
Ansible currently.
2.1.3 "The Song Remains the Same" - 2016-11-04
----------------------------------------------
- Security fix for CVE-2016-8628 - Command injection by compromised
server via fact variables. In some situations, facts returned by
modules could overwrite connection-based facts or some other special
variables, leading to injected commands running on the Ansible
controller as the user running Ansible (or via escalated
permissions).
- Security fix for CVE-2016-8614 - apt\_key module not properly
validating keys in some situations.
Minor Changes:
~~~~~~~~~~~~~~
- The subversion module from core now marks its password parameter as
no\_log so the password is obscured when logging.
- The postgresql\_lang and postgresql\_ext modules from extras now mark
login\_password as no\_log so the password is obscured when logging.
- Fixed several bugs related to locating files relative to
role/playbook directories.
- Fixed a bug in the way hosts were tested for failed states, resulting
in incorrectly skipped block sessions.
- Fixed a bug in the way our custom JSON encoder is used for the
``to_json*`` filters.
- Fixed some bugs related to the use of non-ascii characters in become
passwords.
- Fixed a bug with Azure modules which may be using the latest rc6
library.
- Backported some docker\_common fixes.
2.1.2 "The Song Remains the Same" - 2016-09-29
----------------------------------------------
Minor Changes
~~~~~~~~~~~~~
- Fixed a bug related to creation of retry files (#17456)
- Fixed a bug in the way include params are used when an include task
is dynamic (#17064)
- Fixed a bug related to including blocks in an include task (#15963)
- Fixed a bug related to the use of hostvars internally when creating
the connection plugin. This prevents things like variables using
lookups from being evaluated unnecessarily (#17024)
- Fixed a bug where using a variable containing a list for the
``hosts`` of a play resulted in an list of lists (#16583)
- Fixed a bug where integer values would cause an error if a module
param was of type ``float`` (no issue)
- Fixed a bug with net\_template failing if src was not specified
(#17726)
- Fixed a bug in "ansible-galaxy import" (#17417)
- Fixed a bug in which INI files incorrectly treated a hosts range as a
section header (#15331)
- Fixed a bug in which the max\_fail\_percentage calculation
erroneously caused a series of plays to stop executing (#15954)
- Fixed a bug in which the task names were not properly templated
(#16295)
- Fixed a bug causing "squashed" loops (ie. yum, apt) to incorrectly
report results (ansible-modules-core#4214)
- Fixed several bugs related to includes:
- when including statically, make sure that all parents were also
included statically (issue #16990)
- properly resolve nested static include paths
- print a message when a file is statically included
- Fixed a bug in which module params expected to be float types were
not converted from integers (only strings) (#17325)
- Fixed a bug introduced by static includes in 2.1, which prevented
notifications from going to the "top level" handler name.
- Fixed a bug where a group\_vars or host\_vars directory in the
current working directory would be used (and would take precedence)
over those in the inventory and/or playbook directory.
- Fixed a bug which could occur when the result of an async task did
not parse as valid JSON.
- (re)-allowed the use of ansible\_python\_interpreter lines with more
than one argument.
- Fixed several bugs related to the creation of the implicit localhost
in inventory.
- Fixed a bug related to an unspecified number of retries when using
until.
- Fixed a race-condition bug when creating temp directories before the
worker process is forked.
- Fix a bug with async's poll keyword not making use of
ansible\_python\_interpreter to run (and thus breaking when
/usr/bin/python is not present on the remote machine.)
- Fix a bug where hosts that started with a range in inventory were
being treated as an invalid section header.
Module fixes: \* Fixed a bug where the temporary CA files created by the
module helper code were not being deleted properly in some situations
(#17073) \* Fixed many bugs in the unarchive module \* Fixes for module
ec2: - Fixed a bug related to source\_dest\_check when used with non-vpc
instances (core#3243) - Fixed a bug in ec2 where instances were not
powering of when referenced via tags only (core#4765) - Fixed a bug
where instances with multiple interfaces were not powering up/down
correctly (core#3234) \* Fixes for module get\_url: - Fixed a bug in
get\_url module to force a download if there is a checksum mismatch
regardless of the last modified time (core#4262) - Fixed a bug in
get\_url module to properly process FTP results (core#3661 and
core#4601) \* Fixed a bug in win\_user related to users with disabled
accounts/expired passwords (core#4369) \* ini\_file: - Fixed a bug where
option lines are now inserted before blank lines. - Fixed a bug where
leading whitespace prevented matches on options. \* Fixed a bug in
iam\_cert when dup\_ok is used as a string. \* Fixed a bug in
postgresql\_db related to the changed logic when state=absent. \* Fixed
a bug where single\_transaction and quick were not passed into db\_dump
for the mysql\_db module. \* Fixed a bug where the fetch module was not
idempotent when retrieving the target of a symlink. \* Many minor fixes
for bugs in extras modules.
Deprecations
~~~~~~~~~~~~
- Deprecated the use of ``_fixup_perms``. Use ``_fixup_perms2``
instead. This change only impacts custom action plugins using
``_fixup_perms``.
Incompatible Changes
~~~~~~~~~~~~~~~~~~~~
- Use of ``_fixup_perms`` with ``recursive=True`` (the default) is no
longer supported. Custom action plugins using ``_fixup_perms`` will
require changes unless they already use ``recursive=False``. Use
``_fixup_perms2`` if support for previous releases is not required.
Otherwise use ``_fixup_perms`` with ``recursive=False``.
2.1 "The Song Remains the Same"
-------------------------------
Major Changes:
~~~~~~~~~~~~~~
- Official support for the networking modules, originally available in
2.0 as a tech preview.
- Refactored and expanded support for Docker with new modules and many
improvements to existing modules, as well as a new Kubernetes module.
- Added new modules for Azure (see below for the full list)
- Added the ability to specify includes as "static" (either through a
configuration option or on a per-include basis). When includes are
static, they are loaded at compile time and cannot contain dynamic
features like loops.
- Added a new strategy ``debug``, which allows per-task debugging of
playbooks, for more details see
https://docs.ansible.com/ansible/playbooks\_debugger.html
- Added a new option for tasks: ``loop_control``. This currently only
supports one option - ``loop_var``, which allows a different loop
variable from ``item`` to be used.
- Added the ability to filter facts returned by the fact gathering
setup step using the ``gather_subset`` option on the play or in the
ansible.cfg configuration file. See
http://docs.ansible.com/ansible/intro\_configuration.html#gathering
for details on the format of the option.
- Added the ability to send per-item callbacks, rather than a batch
update (this more closely resembles the behavior of Ansible 1.x).
- Added facility for modules to send back 'diff' for display when
ansible is called with --diff, updated several modules to return this
info
- Added ansible-console tool, a REPL shell that allows running adhoc
tasks against a chosen inventory (based on
https://github.com/dominis/ansible-shell)
- Added two new variables, which are set when the ``rescue`` portion of
a ``block`` is started:
- ``ansible_failed_task``, which contains the serialized version of the
failed task.
- ``ansible_failed_result``, which contains the result of the failed
task.
- New meta action, ``meta: clear_host_errors`` which will clear any
hosts which were marked as failed (but not unreachable hosts).
- New meta action, ``meta: clear_facts`` which will remove existing
facts for the current host from current memory and facts cache.
- copy module can now transparently use a vaulted file as source, if
vault passwords were provided it will decrypt and copy on the fly.
- The way new-style python modules (which include all of the
non-windows modules shipped with Ansible) are assembled before
execution on the remote machine has been changed. The new way stays
closer to how python imports modules which will make it easier to
write modules which rely heavily on shared code.
- Reduce the situations in which a module can end up as world readable.
For details, see:
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
- Re-implemented the retry file feature, which had been left out of 2.0
(fix was backported to 2.0.1 originally).
- Improved winrm argument validation and feature sniffing (for upcoming
pywinrm NTLM support).
- Improved winrm error handling: basic parsing of stderr from CLIXML
stream.
New Modules
^^^^^^^^^^^
- aws
- ec2\_vol\_facts
- ec2\_vpc\_dhcp\_options
- ec2\_vpc\_net\_facts
- ec2\_snapshot\_facts
- azure:
- azure\_rm\_deployment
- azure\_rm\_networkinterface
- azure\_rm\_networkinterface\_facts (TECH PREVIEW)
- azure\_rm\_publicipaddress
- azure\_rm\_publicipaddress\_facts (TECH PREVIEW)
- azure\_rm\_resourcegroup
- azure\_rm\_resourcegroup\_facts (TECH PREVIEW)
- azure\_rm\_securitygroup
- azure\_rm\_securitygroup\_facts (TECH PREVIEW)
- azure\_rm\_storageaccount
- azure\_rm\_storageaccount\_facts (TECH PREVIEW)
- azure\_rm\_storageblob
- azure\_rm\_subnet
- azure\_rm\_virtualmachine
- azure\_rm\_virtualmachineimage\_facts (TECH PREVIEW)
- azure\_rm\_virtualnetwork
- azure\_rm\_virtualnetwork\_facts (TECH PREVIEW)
- cloudflare\_dns
- cloudstack
- cs\_cluster
- cs\_configuration
- cs\_instance\_facts
- cs\_pod
- cs\_resourcelimit
- cs\_volume
- cs\_zone
- cs\_zone\_facts
- clustering
- kubernetes
- cumulus
- cl\_bond
- cl\_bridge
- cl\_img\_install
- cl\_interface
- cl\_interface\_policy
- cl\_license
- cl\_ports
- eos
- eos\_command
- eos\_config
- eos\_eapi
- eos\_template
- gitlab
- gitlab\_group
- gitlab\_project
- gitlab\_user
- ios
- ios\_command
- ios\_config
- ios\_template
- iosxr
- iosxr\_command
- iosxr\_config
- iosxr\_template
- junos
- junos\_command
- junos\_config
- junos\_facts
- junos\_netconf
- junos\_package
- junos\_template
- make
- mongodb\_parameter
- nxos
- nxos\_command
- nxos\_config
- nxos\_facts
- nxos\_feature
- nxos\_interface
- nxos\_ip\_interface
- nxos\_nxapi
- nxos\_ping
- nxos\_switchport
- nxos\_template
- nxos\_vlan
- nxos\_vrf
- nxos\_vrf\_interface
- nxos\_vrrp
- openstack
- os\_flavor\_facts
- os\_group
- os\_ironic\_inspect
- os\_keystone\_domain\_facts
- os\_keystone\_role
- os\_port\_facts
- os\_project\_facts
- os\_user\_facts
- os\_user\_role
- openswitch
- ops\_command
- ops\_config
- ops\_facts
- ops\_template
- softlayer
- sl\_vm
- vmware
- vmware\_maintenancemode
- vmware\_vm\_shell
- windows
- win\_acl\_inheritance
- win\_owner
- win\_reboot
- win\_regmerge
- win\_timezone
- yum\_repository
New Strategies
^^^^^^^^^^^^^^
- debug
New Filters
^^^^^^^^^^^
- extract
- ip4\_hex
- regex\_search
- regex\_findall
New Callbacks
^^^^^^^^^^^^^
- actionable (only shows changed and failed)
- slack
- json
New Tests
^^^^^^^^^
- issubset
- issuperset
New Inventory scripts:
^^^^^^^^^^^^^^^^^^^^^^
- brook
- rackhd
- azure\_rm
Minor Changes:
~~~~~~~~~~~~~~
- Added support for pipelining mode to more connection plugins, which
helps prevent module data from being written to disk.
- Added a new '!unsafe' YAML decorator, which can be used in playbooks
to ensure a string is not templated. For example:
``foo: !unsafe "Don't template {{me}}"``.
- Callbacks now have access to the options with which the CLI was
called
- Debug now has verbosity option to control when to display by matching
number of -v in command line
- Modules now get verbosity, diff and other flags as passed to ansible
- Mount facts now also show 'network mounts' that use the pattern
``<host>:/<mount>``
- Plugins are now sorted before loading. This means, for instance, if
you want two custom callback plugins to run in a certain order you
can name them 10-first-callback.py and 20-second-callback.py.
- Added (alpha) Centirfy's dzdo as another become meethod (privilege
escalation)
Deprecations:
~~~~~~~~~~~~~
- Deprecated the use of "bare" variables in loops (ie.
``with_items: foo``, where ``foo`` is a variable). The full jinja2
variable syntax of ``{{foo}}`` should always be used instead. This
warning will be removed completely in 2.3, after which time it will
be an error.
- play\_hosts magic variable, use ansible\_play\_batch or
ansible\_play\_hosts instead.

View File

@ -1,515 +0,0 @@
==================================================
Ansible 2.2 "The Battle of Evermore" Release Notes
==================================================
2.2.4 "The Battle of Evermore" - TBD
------------------------------------
- avoid vault view writing to logs
- moved htpasswd module to use LooseVersion vs StrictVersion to make
usable on Debian
- fix for adhoc not obeying callback options
2.2.3 "The Battle of Evermore" - 05-09-2017
-------------------------------------------
Major Changes:
~~~~~~~~~~~~~~
- [SECURITY] (HIGH): fix for CVE-2017-7466, which was caused by an
incomplete cherry-picking of commits related to CVE-2016-9587. This
can lead to some jinja2 syntax not being stripped out of templated
results.
- [SECURITY] (MODERATE): fix for CVE-2017-7481, in which data for
lookup plugins used as variables was not being correctly marked as
"unsafe".
Minor Changes:
~~~~~~~~~~~~~~
- Fixes a bug when using YAML inventory where hosts were not put in the
'all' group, and some other 'ungrouped' issues in inventory.
- Fixes a bug when using ansible commands without a tty for stdin.
- Split on newlines when searching for become prompt.
- Fix crash upon pass prompt in py3 when using the paramiko connection
type.
2.2.2 "The Battle of Evermore" - 03-27-2017
-------------------------------------------
Major Changes:
~~~~~~~~~~~~~~
- [SECURITY] (HIGH): (continued fix for CVE-2016-9587) Handle some
additional corner cases in the way conditionals are parsed and
evaluated.
- [SECURITY] (LOW): properly filter passwords out of URLs when
displaying output from some modules.
Minor Changes:
~~~~~~~~~~~~~~
- Fix azure\_rm version checks (#22270).
- Fix for traceback when we encounter non-utf8 characters when using
--diff.
- Ensure ssh hostkey checks respect server port.
- Use proper PyYAML classes for safe loading YAML files.
- Fix for bug related to when statements for older jinja2 versions.
- Fix a bug/traceback when using to\_yaml/to\_nice\_yaml.
- Properly clean data of jinja2-like syntax, even if that data came
from an unsafe source.
- Fix bug regarding undefined entries in HostVars.
- Skip fact gathering if the entire play was included via conditional
which evaluates to False.
- Fixed a performance regression when using a large number of items in
a with loop.
- Fixed a bug in the way the end of role was detected, which in some
cases could cause a role to be run more than once.
- Add jinja2 groupby filter override to cast namedtuple to tuple to
handle a non-compatible change in jinja2 2.9.4-2.9.5.
- Fixed several bugs related to temp directory creation on remote
systems when using shell expansions and become privilege escalation.
- Fixed a bug related to spliting/parsing the output of a become
privilege escalation when looking for a password prompt.
- Several unicode/bytes fixes.
2.2.1 "The Battle of Evermore" - 01-16-2017
-------------------------------------------
Major Changes:
~~~~~~~~~~~~~~
- Security fix for CVE-2016-9587 - An attacker with control over a
client system being managed by Ansible and the ability to send facts
back to the Ansible server could use this flaw to execute arbitrary
code on the Ansible server as the user and group Ansible is running
as.
Minor Changes
~~~~~~~~~~~~~
- Fixes a bug where undefined variables in with\_\* loops would cause a
task failure even if the when condition would cause the task to be
skipped.
- Fixed a bug related to roles where in certain situations a role may
be run more than once despite not allowing duplicates.
- Fixed some additional bugs related to atomic\_move for modules.
- Fixes multiple bugs related to field/attribute inheritance in nested
blocks and includes, as well as task iteration logic during failures.
- Fixed pip installing packages into virtualenvs using the system pip
instead of the virtualenv pip.
- Fixed dnf on systems with dnf-2.0.x (some changes in the API).
- Fixed traceback with dnf install of groups.
- Fixes a bug in which include\_vars was not working with failed\_when.
- Fix for include\_vars only loading files with .yml, .yaml, and .json
extensions. This was only supposed to apply to loading a directory of
vars files.
- Fixes several bugs related to properly incrementing the failed count
in the host statistics.
- Fixes a bug with listening handlers which did not specify a ``name``
field.
- Fixes a bug with the ``play_hosts`` internal variable, so that it
properly reflects the current list of hosts.
- Fixes a bug related to the v2\_playbook\_on\_start callback method
and legacy (v1) plugins.
- Fixes an openssh related process exit race condition, related to the
fact that connections using ControlPersist do not close stderr.
- Improvements and fixes to OpenBSD fact gathering.
- Updated ``make deb`` to use pbuilder. Use ``make local_deb`` for the
previous non-pbuilder build.
- Fixed Windows async to avoid blocking due to handle inheritance.
- Fixed bugs in the mount module on older Linux kernels and \*BSDs
- Fix regression in jinja2 include search path.
- Various minor fixes for Python 3
- Inserted some checks for jinja2-2.9, which can cause some issues with
Ansible currently.
2.2 "The Battle of Evermore" - 11-01-2016
-----------------------------------------
Major Changes:
~~~~~~~~~~~~~~
- Security fix for CVE-2016-8628 - Command injection by compromised
server via fact variables. In some situations, facts returned by
modules could overwrite connection-based facts or some other special
variables, leading to injected commands running on the Ansible
controller as the user running Ansible (or via escalated
permissions).
- Security fix for CVE-2016-8614 - apt\_key module not properly
validating keys in some situations.
- Added the ``listen`` feature for modules. This feature allows tasks
to more easily notify multiple handlers, as well as making it easier
for handlers from decoupled roles to be notified.
- Major performance improvements.
- Added support for binary modules
- Added the ability to specify serial batches as a list
(``serial: [1, 5, 10]``), which allows for so-called "canary" actions
in one play.
- Fixed 'local type' plugins and actions to have a more predictable
relative path. Fixes a regression of 1.9 (PR #16805). Existing users
of 2.x will need to adjust related tasks.
- ``meta`` tasks can now use conditionals.
- ``raw`` now returns ``changed: true`` to be consistent with
shell/command/script modules. Add ``changed_when: false`` to ``raw``
tasks to restore the pre-2.2 behavior if necessary.
- New privilege escalation become method ``ksu``
- Windows ``async:`` support for long-running or background tasks.
- Windows ``environment:`` support for setting module environment vars
in play/task.
- Added a new ``meta`` option: ``end_play``, which can be used to skip
to the end of a play.
- roles can now be included in the middle of a task list via the new
``include_role`` module, this also allows for making the role import
'loopable' and/or conditional.
- The service module has been changed to use system specific modules if
they exist and fall back to the old service module if they cannot be
found or detected.
- Add ability to specify what ssh client binary to use on the
controller. This can be configured via ssh\_executable in the ansible
config file or by setting ansible\_ssh\_executable as an inventory
variable if different ones are needed for different hosts.
- Windows:
- several facts were modified or renamed for consistency with their
Unix counterparts, and many new facts were added. If your playbooks
rely on any of the following keys, please ensure they are using the
correct key names and/or values:
- ansible\_date\_time.date (changed to use yyyy-mm-dd format instead
of default system-locale format)
- ansible\_date\_time.iso8601 (changed to UTC instead of local time)
- ansible\_distribution (now uses OS caption string, e.g.:
"Microsoft Windows Server 2012 R2 Standard", version is still
available on ansible\_distribution\_version)
- ansible\_totalmem (renamed to ansible\_memtotal\_mb, units changed
to MB instead of bytes)
- ``async:`` support for long-running or background tasks.
- ``environment:`` support for setting module environment vars in
play/task.
- Tech Preview: Work has been done to get Ansible running under
Python3. This work is not complete enough to depend upon in
production environments but it is enough to begin testing it.
- Most of the controller side should now work. Users should be able to
run python3 /usr/bin/ansible and python3 /usr/bin/ansible-playbook
and have core features of ansible work.
- A few of the most essential modules have been audited and are known
to work. Others work out of the box.
- We are using unit and integration tests to help us port code and not
regress later. Even if you are not familiar with python you can still
help by contributing integration tests (just ansible roles) that
exercise more of the code to make sure it continues to run on both
Python2 and Python3.
- scp\_if\_ssh now supports True, False and "smart". "smart" is the
default and will retry failed sftp transfers with scp.
- Network:
- Refactored all network modules to remove duplicate code and take
advantage of Ansiballz implementation
- All functionality from \*\_template network modules have been
combined into \*\_config module
- Network \*\_command modules not longer allow configuration mode
statements
New Modules
^^^^^^^^^^^
- apache2\_mod\_proxy
- asa
- asa\_acl
- asa\_command
- asa\_config
- atomic
- atomic\_host
- atomic\_image
- aws
- cloudformation\_facts
- ec2\_asg\_facts
- ec2\_customer\_gateway
- ec2\_lc\_find
- ec2\_vpc\_dhcp\_options\_facts
- ec2\_vpc\_nacl
- ec2\_vpc\_nacl\_facts
- ec2\_vpc\_nat\_gateway
- ec2\_vpc\_peer
- ec2\_vpc\_vgw
- efs
- efs\_facts
- execute\_lambda
- iam\_mfa\_device\_facts
- iam\_server\_certificate\_facts
- kinesis\_stream
- lambda
- lambda\_alias
- lambda\_event
- lambda\_facts
- redshift
- redshift\_subnet\_group
- s3\_website
- sts\_session\_token
- cloudstack
- cs\_router
- cs\_snapshot\_policy
- dellos6
- dellos6\_command
- dellos6\_config
- dellos6\_facts
- dellos9
- dellos9\_command
- dellos9\_config
- dellos9\_facts
- dellos10
- dellos10\_command
- dellos10\_config
- dellos10\_facts
- digital\_ocean\_block\_storage
- docker
- docker\_network
- eos
- eos\_facts
- exoscale:
- exo\_dns\_domain
- exo\_dns\_record
- f5:
- bigip\_device\_dns
- bigip\_device\_ntp
- bigip\_device\_sshd
- bigip\_gtm\_datacenter
- bigip\_gtm\_virtual\_server
- bigip\_irule
- bigip\_routedomain
- bigip\_selfip
- bigip\_ssl\_certificate
- bigip\_sys\_db
- bigip\_vlan
- github
- github\_key
- github\_release
- google
- gcdns\_record
- gcdns\_zone
- gce\_mig
- honeybadger\_deployment
- illumos
- dladm\_etherstub
- dladm\_vnic
- flowadm
- ipadm\_if
- ipadm\_prop
- ipmi
- ipmi\_boot
- ipmi\_power
- ios
- ios\_facts
- iosxr
- iosxr\_facts
- include\_role
- jenkins
- jenkins\_job
- jenkins\_plugin
- kibana\_plugin
- letsencrypt
- logicmonitor
- logicmonitor\_facts
- lxd
- lxd\_profile
- lxd\_container
- netapp
- netapp\_e\_amg
- netapp\_e\_amg\_role
- netapp\_e\_amg\_sync
- netapp\_e\_auth
- netapp\_e\_facts
- netapp\_e\_flashcache
- netapp\_e\_hostgroup
- netapp\_e\_host
- netapp\_e\_lun\_mapping
- netapp\_e\_snapshot\_group
- netapp\_e\_snapshot\_images
- netapp\_e\_snapshot\_volume
- netapp\_e\_storage\_system
- netapp\_e\_storagepool
- netapp\_e\_volume
- netapp\_e\_volume\_copy
- netconf\_config
- netvisor
- pn\_cluster
- pn\_ospfarea
- pn\_ospf
- pn\_show
- pn\_trunk
- pn\_vlag
- pn\_vlan
- pn\_vrouterbgp
- pn\_vrouterif
- pn\_vrouterlbif
- pn\_vrouter
- nxos
- nxos\_aaa\_server\_host
- nxos\_aaa\_server
- nxos\_acl\_interface
- nxos\_acl
- nxos\_bgp\_af
- nxos\_bgp\_neighbor\_af
- nxos\_bgp\_neighbor
- nxos\_bgp
- nxos\_evpn\_global
- nxos\_evpn\_vni
- nxos\_file\_copy
- nxos\_gir\_profile\_management
- nxos\_gir
- nxos\_hsrp
- nxos\_igmp\_interface
- nxos\_igmp
- nxos\_igmp\_snooping
- nxos\_install\_os
- nxos\_interface\_ospf
- nxos\_mtu
- nxos\_ntp\_auth
- nxos\_ntp\_options
- nxos\_ntp
- nxos\_ospf
- nxos\_ospf\_vrf
- nxos\_overlay\_global
- nxos\_pim\_interface
- nxos\_pim
- nxos\_pim\_rp\_address
- nxos\_portchannel
- nxos\_rollback
- nxos\_smu
- nxos\_snapshot
- nxos\_snmp\_community
- nxos\_snmp\_contact
- nxos\_snmp\_host
- nxos\_snmp\_location
- nxos\_snmp\_traps
- nxos\_snmp\_user
- nxos\_static\_route
- nxos\_udld\_interface
- nxos\_udld
- nxos\_vpc\_interface
- nxos\_vpc
- nxos\_vrf\_af
- nxos\_vtp\_domain
- nxos\_vtp\_password
- nxos\_vtp\_version
- nxos\_vxlan\_vtep
- nxos\_vxlan\_vtep\_vni
- mssql\_db
- ovh\_ip\_loadbalancing\_backend
- opendj\_backendprop
- openstack
- os\_keystone\_service
- os\_recordset
- os\_server\_group
- os\_stack
- os\_zone
- ovirt
- ovirt\_auth
- ovirt\_disks
- ovirt\_vms
- rhevm
- rocketchat
- sefcontext
- sensu\_subscription
- smartos
- smartos\_image\_facts
- sros
- sros\_command
- sros\_config
- sros\_rollback
- statusio\_maintenance
- systemd
- telegram
- univention
- udm\_dns\_record
- udm\_dns\_zone
- udm\_group
- udm\_share
- udm\_user
- vmware
- vmware\_guest
- vmware\_local\_user\_manager
- vmware\_vmotion
- vyos
- vyos\_command
- vyos\_config
- vyos\_facts
- wakeonlan
- windows
- win\_command
- win\_robocopy
- win\_shell
New Callbacks
^^^^^^^^^^^^^
- foreman
Minor Changes
~~~~~~~~~~~~~
- now -vvv shows exact path from which 'currently executing module' was
picked up from.
- loop\_control now has a label option to allow fine grained control
what gets displayed per item
- loop\_control now has a pause option to allow pausing for N seconds
between loop iterations of a task.
- New privilege escalation become method ``ksu``
- ``raw`` now returns ``changed: true`` to be consistent with
shell/command/script modules. Add ``changed_when: false`` to ``raw``
tasks to restore the pre-2.2 behavior if necessary.
- removed previously deprecated ';' as host list separator.
- Only check if the default ssh client supports ControlPersist once
instead of once for each host + task combination.
- Fix a problem with the pip module updating the python pip package
itself.
- ansible\_play\_hosts is a new magic variable to provide a list of
hosts in scope for the current play. Unlike play\_hosts it is not
subject to the 'serial' keyword.
- ansible\_play\_batch is a new magic variable meant to substitute the
current play\_hosts.
- The subversion module from core now marks its password parameter as
no\_log so the password is obscured when logging.
- The postgresql\_lang and postgresql\_ext modules from extras now mark
login\_password as no\_log so the password is obscured when logging.
- Fix for yum module incorrectly thinking it succeeded in installing
packages
- Make the default ansible\_managed template string into a static
string since all of the replacable values lead to non-idempotent
behaviour.
For custom front ends using the API:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ansible.parsing.vault:
- VaultLib.is\_encrypted() has been deprecated. It will be removed in
2.4. Use ansible.parsing.vault.is\_encrypted() instead
- VaultFile has been removed. This unfinished code was never used
inside of Ansible. The feature it was intended to support has now
been implemented without using this.
- VaultAES, the older, insecure encrypted format that debuted in
Ansible-1.5 and was replaced by VaultAES256 less than a week later,
now has a deprecation warning. **It will be removed in 2.3**. In the
unlikely event that you wrote a vault file in that 1 week window and
have never modified the file since (ansible-vault automatically
re-encrypts the file using VaultAES256 whenever it is written to but
not read), run ``ansible-vault rekey [filename]`` to move to
VaultAES256.
Removed Deprecated
~~~~~~~~~~~~~~~~~~
- ';' as host list separator.
- with\_ 'bare variable' handling, now loop items must always be
templated ``{{ }}`` or they will be considered as plain strings.
- skipping task on 'missing attribute' in loop variable, now in a loop
an undefined attribute will return an error instead of skipping the
task.
- skipping on undefined variables in loop, now loops will have to
define a variable or use ``|default`` to avoid errors.
Deprecations
~~~~~~~~~~~~
Notice given that the following will be removed in Ansible 2.4: \*
Modules \* eos\_template \* ios\_template \* iosxr\_template \*
junos\_template \* nxos\_template \* ops\_template

View File

@ -1,581 +0,0 @@
=====================================
Ansible 2.3 "Ramble On" Release Notes
=====================================
2.3.4 "Ramble On" - TBD
-----------------------
- Flush stdin when passing the become password. Fixes some cases of
timeout on Python3 with the ssh connection plugin:
https://github.com/ansible/ansible/pull/35049
Bugfixes
~~~~~~~~
- Fix setting of environment in a task that uses a loop:
https://github.com/ansible/ansible/issues/32685
- Fix https retrieval with TLSv1.2:
https://github.com/ansible/ansible/pull/32053
2.3.3 "Ramble On" - TBD
-----------------------
Bugfixes
~~~~~~~~
- Security fix for CVE-2017-7550 the jenkins\_plugin module was logging
the jenkins server password if the url\_password was passed via the
params field: https://github.com/ansible/ansible/pull/30875
- Fix alternatives module handlling of non existing options
- Fix synchronize traceback with the docker connection plugin
- Do not escape backslashes in the template lookup plugin to mirror
what the template module does
- Fix the expires option of the postgresq\_user module
- Fix for win\_acl when settings permissions on registry objects that
use ``ALL APPLICATION PACKAGES`` and
``ALL RESTRICTED APPLICATION PACKAGES``
- Python3 fixes
- asorted azure modules
- pause module
- hacking/env-setup script
- Fix traceback when checking for passwords in logged strings when
logging executed commands.
- docker\_login module
- Workaround python-libselinux API change in the seboolean module
- digital\_ocean\_tag module
- Fix the zip filter
- Fix user module combining bytes and text
- Fix for security groups in the amazon efs module
- Fix for the jail connection plugin not finding the named jail
- Fix for blockinfile's parameters insertbefore and insertafter
- ios\_config: Fix traceback when the efaults parameter is not set
- iosxr\_config: Fixed unicode error when UTF-8 characters are in
configs
- Fix check mode in archive module
- Fix UnboundLocalError in check mode in cs\_role module
- Fix to always use lowercase hostnames for host keys in known\_hosts
module
- Added missing return results for win\_stat
- Fix rabbitmq modules to give a helpful error if requests is not
installed
- Fix yum module not deleting rpms that it downloaded
- Fix yum module failing with a URL to an rpm
- Fix file module inappropriately expanding literal dollar signs in a
path read from the filesystem as an environment variable.
- Fix the ssh "smart" transport setting which automatically selects the
best means of transferring files over ssh (sftp, ssh, piped).
- Fix authentication by api\_key parameter in exoscale modules.
- vmware module\_utils shared code ssl/validate\_certs fixes in
connection logic
- allow 'bridge' facts to work for certain containers that create
conflicting ones with connection plugins
- Fix for win\_get\_url to use TLS 1.2/1.1 if it is available on the
host
- Fix for the filetree lookup with non-ascii group names
- Better message for invalid keywords/options in task due to undefined
expressions
- Fixed check mode for enable on Solaris for service module
- Fix cloudtrail module to allow AWS profiles other than the default
- Fix an encoding issue with secret (password) vars\_prompts
- Fix for Windows become to show the stdout and stderr strings on a
failure
- Fix the issue SSL verification can not be disabled for Tower modules
- Use safe\_load instead on load to read a yaml document
- Fix for win\_file to respect check mode when deleting directories
- Include\_role now complains about invalid arguments
- Added socket conditions to ignore for wait\_for, no need to error for
closing already closed connection
- Updated hostname module to work on newer RHEL7 releases
- Security fix to avoid provider password leaking in logs for network
modules
\* Python3 fixes for azure modules
2.3.2 "Ramble On" - 2017-08-04
------------------------------
Bugfixes
~~~~~~~~
- Fix partend i18n issues
- fixed handling of extra vars for tower\_job\_template (#25272)
- Python3 bugfixes
- Fix sorting of ec2 policies
- Fix digital\_ocean dynamic inventory script
- Fix for the docker connection plugin
- Fix pip module when using python3's pyvenv and python3 -m venv to
create virtualenvs
- Fix for the AnsiBallZ wrapper so that it gives a better error message
when there's not enough disk space to create its tempdir.
- Fix so ansilbe-galaxy install --force with unversioned roles will
once again overwrite old versions.
- Fix for RabbitMQ 3.6.7 endpoint return code changing.
- Fix for Foreman organization creation
- fixed incorrect fail\_json ref in rpm\_key
- Corrected requried on hash\_name for dynamodb\_table
- Fix for fetch action plugin not validating correctly
- Avoid vault view writing display to logs
- htpasswd: fix passlib module version comparison
- Fix for flowdock error message when external\_user\_name is missing
- fixed corner case for delegate\_to, loops and delegate\_facts
- fixed wait\_for python2.4/2.5 compatibility (this is last version
this is needed)
- fix for adhoc not obeying callback options
- fix for win\_find where it fails to recursively scan empty nested
directories
- fix non-pipelined code paths for Windows (eg,
ANSIBLE\_KEEP\_REMOTE\_FILES, non-pipelined connection plugins)
- fix for win\_updates where args and check mode were ignored due to
common code change
- fix for unprivileged users to Windows runas become method
- fix starttls code path for mail module
- fix missing LC\_TYPE in parted module
- fix CN parsing with OpenSSL 1.1 in letsencrypt module
- fix params assignment in jabber module
- fix TXT record type handling in exo\_dns\_record module
- fix message queue message ttl can't be 0 in rabbitmq\_queue module
- CloudStack bugfixes:
- fix template upload for users in cs\_template module, change default
to is\_routing=None
- several fixes in cs\_host module fixes hypervisor handling
- fix network param ignored due typo in cs\_nic module
- fix missing type bool in module cs\_zone
- fix KeyError: 'sshkeypair' in cs\_instance module for CloudStack v4.5
and before
- fix for win\_chocolatey where trying to upgrade all the packages as
per the example docs fails
- fix for win\_chocolatey where it did not fail if the version set did
not exist
- fix for win\_regedit always changing a reg key if the dword values
set is a hex
- fix for wait\_for on non-Linux systems with newer versions of psutil
- fix eos\_banner code and test issues
- run tearup and teardown of EAPI service only on EAPI tests
- fix eos\_config tests so only Eth1 and Eth2 are used
- Fix for potential bug when using legacy inventory vars for
configuring the su password.
- Fix crash in file module when directories contain non-utf8 filenames
- Fix for dnf groupinstall with dnf-2.x
- Fix seboolean module for incompatibility in newer Python3 selinux
bindings
- Optimization for inventory, no need to dedup at every stage, its
redundant and slow
- Fix fact gathering for package and service action plugins
- make random\_choice more error resilient (#27380)
- ensure prefix in plugin loading to avoid conflicts
- fix for a small number of modules (tempfile, possibly copy) which
could fail if the tempdir on the remote box was a symlink
- fix non-pipelined code paths for Windows (eg,
ANSIBLE\_KEEP\_REMOTE\_FILES, non-pipelined connection plugins)
- fix for win\_updates where args and check mode were ignored due to
common code change
2.3.1 "Ramble On" - 2017-06-01
------------------------------
Bugfixes
~~~~~~~~
- Security fix for CVE-2017-7481 - data for lookup plugins used as
variables was not being correctly marked as "unsafe".
- Fix default value of fetch module's validate\_checksum to be True
- Added fix for "meta: refresh\_connection" not working with default
'smart' connection.
- Fix template so that the --diff command line option works when the
destination is a directory
- Fix python3 bugs in pam\_limits
- Fix unbound error when using module deprecation as a single string
- Several places in which error handling was broken due to bad
conversions or just typos
- Fix to user module for appending/setting groups on OpenBSD (flags
were reversed)
- assemble fix to use safer os.join.path, avoids charset issues
- fixed issue with solaris facts and i18n
- added python2.4 compatiblity fix to sysctl module
- Fix comparison of exisiting container security opts in the
docker\_container module
- fixed service module invocation of insserv on certain platforms
- Fix traceback in os\_user in an error case.
- Fix docker container to restart a container when changing to fewer
exposed ports
- Fix tracebacks in docker\_network
- Fixes to detection of updated docker images
- Handle detection of docker image changes when published ports is
changed
- Fix for docker\_container restarting images when links list is empty.
2.3 "Ramble On" - 2017-04-12
----------------------------
Moving to Ansible 2.3 guide
http://docs.ansible.com/ansible/porting\_guide\_2.3.html
Major Changes
~~~~~~~~~~~~~
- Documented and renamed the previously released 'single var vaulting'
feature, allowing user to use vault encryption for single variables
in a normal YAML vars file.
- Allow module\_utils for custom modules to be placed in site-specific
directories and shipped in roles
- On platforms that support it, use more modern system polling API
instead of select in the ssh connection plugin. This removes one
limitation on how many parallel forks are feasible on these systems.
- Windows/WinRM supports (experimental) become method "runas" to run
modules and scripts as a different user, and to transparently access
network resources.
- The WinRM connection plugin now uses pipelining when executing
modules, resulting in significantly faster execution for small tasks.
- The WinRM connection plugin can now manage Kerberos tickets
automatically when ``ansible_winrm_transport=kerberos`` and
``ansible_user``/``ansible_password`` are specified.
- Refactored/standardized most Windows modules, adding check-mode and
diff support where possible.
- Extended Windows module API with parameter-type support, helper
functions. (i.e. Expand-Environment, Add-Warning,
Add-DeprecatationWarning)
- restructured how async works to allow it to apply to action plugins
that choose to support it.
Minor Changes
~~~~~~~~~~~~~
- The version and release facts for OpenBSD hosts were reversed. This
has been changed so that version has the numeric portion and release
has the name of the release.
- removed 'package' from default squash actions as not all package
managers support it and it creates errors when using loops, any user
can add back via config options if they don't use those package
managers or otherwise avoid the errors.
- Blocks can now have a ``name`` field, to aid in playbook readability.
- default strategy is now configurable via ansible.cfg or environment
variable.
- Added 'ansible\_playbook\_python' which contains 'current python
executable', it can be blank in some cases in which Ansible is not
invoked via the standard CLI (sys.executable limitation).
- Added 'metadata' to modules to enable classification
- ansible-doc now displays path to module and existing 'metadata'
- added optional 'piped' transfer method to ssh plugin for when scp and
sftp are missing, ssh plugin is also now 'smarter' when using these
options
- default controlpersist path is now a custom hash of host-port-user to
avoid the socket path length errors for long hostnames
- Various fixes for Python3 compatibility
- Fixed issues with inventory formats not handling 'all' and
'ungrouped' in an uniform way.
- 'service' tasks can now use async again, we had lost this capability
when changed into an action plugin.
- made any\_errors\_fatal inheritable from play to task and all other
objects in between.
- many small performance improvements in inventory and variable
handling and in task execution.
- Added a retry class to the ec2\_asg module since customers were
running into throttling errors (AWSRetry is a solution for modules
using boto3 which isn't applicable here).
Deprecations
~~~~~~~~~~~~
- Specifying --tags (or --skip-tags) multiple times on the command line
currently leads to the last one overriding all the previous ones.
This behaviour is deprecated. In the future, if you specify --tags
multiple times the tags will be merged together. From now on, using
--tags multiple times on one command line will emit a deprecation
warning. Setting the merge\_multiple\_cli\_tags option to True in the
ansible.cfg file will enable the new behaviour. In 2.4, the default
will be to merge and you can enable the old overwriting behaviour via
the config option. In 2.5, multiple --tags options will be merged
with no way to go back to the old behaviour.
- Modules (scheduled for removal in 2.5)
- ec2\_vpc
- cl\_bond
- cl\_bridge
- cl\_img\_install
- cl\_interface
- cl\_interface\_policy
- cl\_license
- cl\_ports
- nxos\_mtu, use nxos\_system instead
New: Callbacks
^^^^^^^^^^^^^^
- dense: minimal stdout output with fallback to default when verbose
New: lookups
^^^^^^^^^^^^
- keyring: allows getting password from the 'controller' system's
keyrings
New: cache
^^^^^^^^^^
- pickle (uses python's own serializer)
- yaml
New: inventory scripts
^^^^^^^^^^^^^^^^^^^^^^
- oVirt/RHV
New: filters
^^^^^^^^^^^^
- combinations
- permutations
- zip
- zip\_longest
Module Notes
~~~~~~~~~~~~
- AWS lambda: previously ignored changes that only affected one
parameter. Existing deployments may have outstanding changes that
this bugfix will apply.
- oVirt/RHV: Added support for 4.1 features and the following:
- data centers, clusters, hosts, storage domains and networks
management.
- hosts and virtual machines affinity groups and labels.
- users, groups and permissions management.
- Improved virtual machines and disks management.
- Mount: Some fixes so bind mounts are not mounted each time the
playbook runs.
New Modules
~~~~~~~~~~~
- a10\_server\_axapi3
- amazon:
- aws\_kms
- cloudfront\_facts
- ec2\_group\_facts
- ec2\_lc\_facts
- ec2\_vpc\_igw\_facts
- ec2\_vpc\_nat\_gateway\_facts
- ec2\_vpc\_vgw\_facts
- ecs\_ecr
- elasticache\_parameter\_group
- elasticache\_snapshot
- iam\_role
- s3\_sync
- archive
- beadm
- bigswitch:
- bigmon\_chain
- bigmon\_policy
- cloudengine:
- ce\_command
- cloudscale\_server
- cloudstack:
- cs\_host
- cs\_nic
- cs\_region
- cs\_role
- cs\_vpc
- dimensiondata\_network
- eos:
- eos\_banner
- eos\_system
- eos\_user
- f5:
- bigip\_gtm\_facts
- bigip\_hostname
- bigip\_snat\_pool
- bigip\_sys\_global
- foreman:
- foreman
- katello
- fortios
- fortios\_config
- gconftool2
- google:
- gce\_eip
- gce\_snapshot
- gcpubsub
- gcpubsub\_facts
- hpilo:
- hpilo\_boot
- hpilo\_facts
- hponcfg
- icinga2\_feature
- illumos:
- dladm\_iptun
- dladm\_linkprop
- dladm\_vlan
- ipadm\_addr
- ipadm\_addrprop
- ipadm\_ifprop
- infinidat:
- infini\_export
- infini\_export\_client
- infini\_fs
- infini\_host
- infini\_pool
- infini\_vol
- ipa:
- ipa\_group
- ipa\_hbacrule
- ipa\_host
- ipa\_hostgroup
- ipa\_role
- ipa\_sudocmd
- ipa\_sudocmdgroup
- ipa\_sudorule
- ipa\_user
- ipinfoio\_facts
- ios:
- ios\_banner
- ios\_system
- ios\_vrf
- iosxr\_system
- iso\_extract
- java\_cert
- jenkins\_script
- ldap:
- ldap\_attr
- ldap\_entry
- logstash\_plugin
- mattermost
- net\_command
- netapp:
- sf\_account\_manager
- sf\_snapshot\_schedule\_manager
- sf\_volume\_manager
- sf\_volume\_access\_group\_manager
- nginx\_status\_facts
- nsupdate
- omapi\_host
- openssl:
- openssl\_privatekey
- openssl\_publickey
- openstack:
- os\_nova\_host\_aggregate
- os\_quota
- openwrt\_init
- ordnance:
- ordnance\_config
- ordnance\_facts
- ovirt:
- ovirt\_affinity\_groups
- ovirt\_affinity\_labels
- ovirt\_affinity\_labels\_facts
- ovirt\_clusters
- ovirt\_clusters\_facts
- ovirt\_datacenters
- ovirt\_datacenters\_facts
- ovirt\_external\_providers
- ovirt\_external\_providers\_facts
- ovirt\_groups
- ovirt\_groups\_facts
- ovirt\_host\_networks
- ovirt\_host\_pm
- ovirt\_hosts
- ovirt\_hosts\_facts
- ovirt\_mac\_pools
- ovirt\_networks
- ovirt\_networks\_facts
- ovirt\_nics
- ovirt\_nics\_facts
- ovirt\_permissions
- ovirt\_permissions\_facts
- ovirt\_quotas
- ovirt\_quotas\_facts
- ovirt\_snapshots
- ovirt\_snapshots\_facts
- ovirt\_storage\_domains
- ovirt\_storage\_domains\_facts
- ovirt\_tags
- ovirt\_tags\_facts
- ovirt\_templates
- ovirt\_templates\_facts
- ovirt\_users
- ovirt\_users\_facts
- ovirt\_vmpools
- ovirt\_vmpools\_facts
- ovirt\_vms\_facts
- pacemaker\_cluster
- packet:
- packet\_device
- packet\_sshkey
- pamd
- panos:
- panos\_address
- panos\_admin
- panos\_admpwd
- panos\_cert\_gen\_ssh
- panos\_check
- panos\_commit
- panos\_dag
- panos\_import
- panos\_interface
- panos\_lic
- panos\_loadcfg
- panos\_mgtconfig
- panos\_nat\_policy
- panos\_pg
- panos\_restart
- panos\_security\_policy
- panos\_service
- postgresql\_schema
- proxmox\_kvm
- proxysql:
- proxysql\_backend\_servers
- proxysql\_global\_variables
- proxysql\_manage\_config
- proxysql\_mysql\_users
- proxysql\_query\_rules
- proxysql\_replication\_hostgroups
- proxysql\_scheduler
- pubnub\_blocks
- pulp\_repo
- runit
- serverless
- set\_stats
- panos:
- panos\_security\_policy
- smartos:
- imgadm
- vmadm
- sorcery
- stacki\_host
- swupd
- tempfile
- tower:
- tower\_credential
- tower\_group
- tower\_host
- tower\_inventory
- tower\_job\_template
- tower\_label
- tower\_organization
- tower\_project
- tower\_role
- tower\_team
- tower\_user
- vmware:
- vmware\_guest\_facts
- vmware\_guest\_snapshot
- web\_infrastructure:
- jenkins\_script
- system
- parted
- windows:
- win\_disk\_image
- win\_dns\_client
- win\_domain
- win\_domain\_controller
- win\_domain\_membership
- win\_find
- win\_msg
- win\_path
- win\_psexec
- win\_reg\_stat
- win\_region
- win\_say
- win\_shortcut
- win\_tempfile
- xbps
- zfs:
- zfs\_facts
- zpool\_facts

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
---
release_tag_re: '(v(?:[\d.ab\-]|rc)+)'
pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
notesdir: fragments
prelude_section_name: release_summary
sections:
- ['major_changes', 'Major Changes']
- ['minor_changes', 'Minor Changes']
- ['deprecated_features', 'Deprecated Features']
- ['removed_features', 'Removed Features (previously deprecated)']
- ['new_lookup_plugins', 'New Lookup Plugins']
- ['new_callback_plugins', 'New Callback Plugins']
- ['new_connection_plugins', 'New Connection Plugins']
- ['new_test_plugins', 'New Test Plugins']
- ['new_filter_plugins', 'New Filter Plugins']
- ['new_modules', 'New Modules']
- ['bugfixes', 'Bugfixes']
- ['known_issues', 'Known Issues']

View File

@ -1,2 +0,0 @@
bugfixes:
- EOS can not check configuration without use of config session (ANSIBLE_EOS_USE_SESSIONS=0). Fix is to throw error when hiting into this exception case. Configs would neither be checked nor be played on the eos device.

View File

@ -1,2 +0,0 @@
bugfixes:
- Adds exception handling which is raised when user does not have correct set of permissions/privileges to read virtual machine facts.

View File

@ -1,2 +0,0 @@
bugfixes:
- onyx_pfc_interface - Add support for changes in pfc output in onyx 3.6.6000 https://github.com/ansible/ansible/pull/37651

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix mlag summary json parsing for onyx version 3.6.6000 and above https://github.com/ansible/ansible/pull/38191

View File

@ -1,2 +0,0 @@
bugfixes:
- Update documentation related to datacenter in vmware_guest_find module. Mark datacenter as optional.

View File

@ -1,2 +0,0 @@
bugfixes:
- Set default network type as 'dhcp' if user has not specified any.

View File

@ -1,2 +0,0 @@
bugfixes:
- Changed hostname variable in order for the esxi host to be found when authentication against a vcenter was done.

View File

@ -1,2 +0,0 @@
bugfixes:
- nmcli change default value of autoconnect

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-inventory - now supports a ``--export`` option to preserve group_var data (https://github.com/ansible/ansible/pull/36188)

View File

@ -1,2 +0,0 @@
bugfixes:
- tower_* modules - fix credentials to work with v1 and v2 of Ansible Tower API

View File

@ -1,2 +0,0 @@
bugfixes:
- azure_rm modules - updated with internal changes to use API profiles and kwargs for future Azure Stack support and better stability between SDK updates. (https://github.com/ansible/ansible/pull/35538)

View File

@ -1,2 +0,0 @@
bugfixes:
- azure_rm_image - Allow Azure images to be created with tags, bug was introduced in Ansible v2.5.0

View File

@ -1,2 +0,0 @@
bugfixes:
- azure_rm_networkinterface - fixed examples in module documentation and added fix to allow an IP configuration with no public IP (https://github.com/ansible/ansible/pull/36824)

View File

@ -1,2 +0,0 @@
bugfixes:
- azure_rm_virtualmachine - removed docs note that says on marketplace images can be used, custom images were added in 2.5

View File

@ -1,2 +0,0 @@
bugfixes:
- fixed memory bloat on nested includes by preventing blocks from self-parenting (https://github.com/ansible/ansible/pull/36075)

View File

@ -1,5 +0,0 @@
bugfixes:
- Improve keyed groups for complex inventory
- Made separator configurable
- Fixed some exception types
- Better error messages

View File

@ -1,4 +0,0 @@
---
bugfixes:
- copy - fixed copy to only follow symlinks for files in the non-recursive case
- file - fixed the default follow behaviour of file to be true

View File

@ -1,2 +0,0 @@
deprecated_features:
- Apstra's ``aos_*`` modules are deprecated as they do not work with AOS 2.1 or higher. See new modules at `https://github.com/apstra <https://github.com/apstra>`_.

View File

@ -1,2 +0,0 @@
bugfixes:
- updated to ensure displayed messages under peristent connections are returned to the controller (https://github.com/ansible/ansible/pull/36064)

View File

@ -1,2 +0,0 @@
bugfixes:
- backup options doc change to reflect backup directory location in case playbook is run from a role

View File

@ -1,2 +0,0 @@
bugfixes:
- docker_container, docker_image, docker_network modules - Update to work with Docker SDK 3.1

View File

@ -1,2 +0,0 @@
bugfixes:
- docker modules - Error with useful message is both docker and docker-py are found to both be installed (https://github.com/ansible/ansible/pull/38884)

View File

@ -1,2 +0,0 @@
bugfixes:
- filters - Don't overwrite builtin jinja2 filters with tests (https://github.com/ansible/ansible/pull/37881)

View File

@ -1,2 +0,0 @@
bugfixes:
- dynamic includes - Improved performance by fixing re-parenting on copy (https://github.com/ansible/ansible/pull/38747)

View File

@ -1,2 +0,0 @@
bugfixes:
- edgeos_command - add action plugin to backup config (https://github.com/ansible/ansible/pull/37619)

View File

@ -1,2 +0,0 @@
bugfixes:
- edgeos_facts - fix error when there are no commit revisions (https://github.com/ansible/ansible/issues/37123)

View File

@ -1,2 +0,0 @@
bugfixes:
- eos cliconf get_config() format type fix (https://github.com/ansible/ansible/pull/38682)

View File

@ -1,2 +0,0 @@
bugfixes:
- eos_vlan - fixed eos_vlan not working when having more than 6 interfaces (https://github.com/ansible/ansible/pull/38347)

View File

@ -1,2 +0,0 @@
bugfixes:
- eos_vrf and eos_eapi - fixed vrf parsing (https://github.com/ansible/ansible/pull/35791)

View File

@ -1,2 +0,0 @@
minor_changes:
- Return virtual_facts after VMware platform detection, otherwise we're falling back to 'NA' for virtualization type and virtualization role.

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Various grafana_* modules - Port away from the deprecated b64encodestring function to the b64encode function instead. (https://github.com/ansible/ansible/pull/38388)

View File

@ -1,2 +0,0 @@
bugfixes:
- dynamic includes - Fix IncludedFile comparison for free strategy (https://github.com/ansible/ansible/pull/37083)

View File

@ -1,2 +0,0 @@
bugfixes:
- dynamic includes - Allow inheriting attributes from static parents (https://github.com/ansible/ansible/pull/38827)

View File

@ -1,2 +0,0 @@
bugfixes:
- include_role - improved performance and recursion depth (https://github.com/ansible/ansible/pull/36470)

View File

@ -1,2 +0,0 @@
bugfixes:
- include_role - Fix parameter templating (https://github.com/ansible/ansible/pull/36372)

View File

@ -1,2 +0,0 @@
bugfixes:
- include_vars - Call DataLoader.load with the correct signature to prevent hang on error processing (https://github.com/ansible/ansible/pull/38194)

View File

@ -1,2 +0,0 @@
bugfixes:
- interface_file - now accepts interfaces without address family or method (https://github.com/ansible/ansible/pull/34200)

View File

@ -1,2 +0,0 @@
bugfixes:
- ios_interface - neighbors option now include CDP neighbors (https://github.com/ansible/ansible/pull/37667)

View File

@ -1,2 +0,0 @@
bugfixes:
- ios_l2_interface - fix removal of trunk vlans (https://github.com/ansible/ansible/pull/37389)

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix ios and iosxr terminal prompt regex (https://github.com/ansible/ansible/pull/39063)

View File

@ -1,2 +0,0 @@
bugfixes:
- Add supported connection in junos module documentation (https://github.com/ansible/ansible/pull/38813)

View File

@ -1,2 +0,0 @@
bugfixes:
- junos_netconf - Report error is wrong connection type is used for junos_netconf (https://github.com/ansible/ansible/pull/38527)

View File

@ -1,2 +0,0 @@
bugfixes:
- lineinfile - fixed insertion if pattern already exists (https://github.com/ansible/ansible/pull/33393)

View File

@ -1,2 +0,0 @@
bugfixes:
- lineinfile - fixed regexp used with insert(before|after) inserting duplicate lines (https://github.com/ansible/ansible/pull/36156)

View File

@ -1,11 +0,0 @@
major_changes:
- |
Ansible Network improvements
* Created new connection plugins ``network_cli`` and ``netconf`` to replace ``connection=local``. ``connection=local`` will continue to work for a number of Ansible releases.
* No more ``unable to open shell``. A clear and descriptive message will be displayed in normal ansible-playbook output without needing to enable debug mode
* Loads of documentation, see `Ansible for Network Automation Documentation <http://docs.ansible.com/ansible/2.5/network/>`_.
* Refactor common network shared code into package under ``module_utils/network/``
* Filters: Add a filter to convert XML response from a network device to JSON object.
* Loads of bug fixes.
* Plus lots more.

View File

@ -1,2 +0,0 @@
bugfixes:
- Connection error messages may contain characters that jinja2 would interpret as a template. Wrap the error string so this doesn't happen (https://github.com/ansible/ansible/pull/37329)

View File

@ -1,22 +0,0 @@
bugfixes:
- _nxos_switchport - fix removal of trunk vlans (https://github.com/ansible/ansible/pull/37328)
- nxos_l2_interface - fix removal of trunk vlans (https://github.com/ansible/ansible/pull/37336)
- nxos_snapshot - fix documentation and add required parameter logic (https://github.com/ansible/ansible/pull/37232, https://github.com/ansible/ansible/pull/37248)
- Improve integration test - Ensure each transport test runs only once (https://github.com/ansible/ansible/pull/37462)
- nxos_user - Integration test (https://github.com/ansible/ansible/pull/37852)
- nxos_bgp_af - Fix UnboundLocalError (https://github.com/ansible/ansible/pull/37610)
- nxos_vrf - Fix nxos_vrf issues (https://github.com/ansible/ansible/pull/37092)
- nxos_vrf_af - Fix nxos_vrf_af issues (https://github.com/ansible/ansible/pull/37211)
- nxos_udld - Fix nxos_udld issues (https://github.com/ansible/ansible/pull/37418)
- nxos_vlan - Fix nxos_vlan issues (https://github.com/ansible/ansible/pull/38008)
- nxos_vlan - nxos_vlan purge (https://github.com/ansible/ansible/pull/38202)
- nxos_aaa_server - Fix nxos_aaa_server (https://github.com/ansible/ansible/pull/38117)
- nxos_aaa_server_host - Fix nxos_aaa_server_host (https://github.com/ansible/ansible/pull/38188)
- nxos_acl - Fix nxos_acl (https://github.com/ansible/ansible/pull/38283)
- nxos_static_route - Fix nxos_static_route (https://github.com/ansible/ansible/pull/37614)
- nxos_acl_interface test - Fix nxos_acl_interface test (https://github.com/ansible/ansible/pull/38230)
- nxos_igmp - Fix nxos_igmp (https://github.com/ansible/ansible/pull/38496)
- nxos_hsrp - Fix nxos_hsrp (https://github.com/ansible/ansible/pull/38410)
- nxos_igmp_snooping - Fix nxos_igmp_snooping (https://github.com/ansible/ansible/pull/38566)
- nxos_ntp_auth - Fix nxos_ntp_auth issues (https://github.com/ansible/ansible/pull/38824)
- nxos_ntp_options - Fix nxos_ntp_options issues (https://github.com/ansible/ansible/pull/38695)

View File

@ -1,2 +0,0 @@
bugfixes:
- nxos_evpn_vni - fixed a number of issues (https://github.com/ansible/ansible/pull/35930)

View File

@ -1,2 +0,0 @@
bugfixes:
- nxos_igmp_interface - fixed response handling for different nxos versions (https://github.com/ansible/ansible/pull/35959)

View File

@ -1,2 +0,0 @@
bugfixes:
- nxos_interface_ospf - added various bugfixes (https://github.com/ansible/ansible/pull/35988)

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix onyx_linkagg module writing debugging information to a tempfile on the remote machine (https://github.com/ansible/ansible/pull/37308)

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix onyx_config action plugin when used on Python 3 https://github.com/ansible/ansible/pull/38343

View File

@ -1,2 +0,0 @@
bugfixes:
- openshift modules - updated to client version 0.4.0 (https://github.com/ansible/ansible/pull/35127)

View File

@ -1,2 +0,0 @@
bugfixes:
- openssl_certificate - Handle dump() in check_mode https://github.com/ansible/ansible/pull/38386

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Fix traceback when creating or stopping ovirt vms (https://github.com/ansible/ansible/pull/37249)

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