Commit Graph

392 Commits (e401b4e424bf95c5fb62806909c6951160cadc8b)

Author SHA1 Message Date
jctanner ac78347f2b Use a -short- custom hash for controlpersist path by default (#20843)
* A method to validate and alter the ssh control path automatically.
* First tries %C to use the shortened hash
* On further failure, it removes section by section from the original path
* Fix hostname
* Implement bcoca's suggested changes
* Remove unused option
* Remove unused class var
* Use to_string to avoid unicode error
* Switch from to_text to to_bytes
* Update the example config for the new controlpath feature
8 years ago
Matt Clay 10d9318de7 PEP 8 indent cleanup. (#20800)
* PEP 8 E121 cleanup.

* PEP 8 E126 cleanup.

* PEP 8 E122 cleanup.
8 years ago
Dag Wieers c94c53e8a4 Ensure that the script is run with elevated privileges (#20669)
* Ensure that the script is run with elevated privileges

This fixes #20654

* Implement our own check for elevated privileges
8 years ago
Dag Wieers e64ef8b0ab Small fix for running using Invoke-Expression
A small fix suggested by a user for running ConfigureRemotingForAnsible.

This fixes #20512
8 years ago
Andrew Gaffney ac51266e8f Add pipeline-ish method using dd for file transfer over SSH (#18642) 8 years ago
Dag Wieers de21038feb Enable -Verbose and log to EventLog (#19909)
Instead of asking the user to type something prior to running the script, why not allow -Verbose on the command line directly.
Also log important events to EventLog, so that it can be traced e.g. when running via RunOnce mechanism.

The documentation is updated as well.
8 years ago
TaoBeier 6ec0369c26 fix indent (#20071) 8 years ago
Brian Coca 08e0f6ada5 allow modules to set custom stats (#18946)
can be per run or per host, also aggregate or not
set_stats action plugin as reference implementation
added doc stub
display stats in calblack
made custom stats showing configurable
8 years ago
Carlos E. Garcia 0b8011436d minor spelling changes 8 years ago
Matt Clay 75c281debc Fix compile errors in scripts. 8 years ago
Brian Coca 6dece90a57 change to ~ instead of $HOME to avoid undefined (#18551)
fixes #16032
8 years ago
Gael Pasgrimaud f94100aa87 make default strategy configurable (#18394) 8 years ago
Brian Coca aab80ac353 removed package from squash in examples 8 years ago
scottb abc9133cb6 Merge pull request #12712 from ananyacleetus/patch-1
Update DOCUMENTATION.yml
8 years ago
Andrea Tartaglia b18263cf36 ANSIBLE_SSH_CONTROL_PATH_DIR option added (#18342)
* ANSIBLE_SSH_CONTROL_PATH_DIR option added

This removes the hardcoded value ( $HOME/.ansible/cp ) from ssh.py.
User is able to change the ControlPath directory ( the one that replaces %(directory)s ).

 Fixes #18325

* Added config option in ansible.cfg
8 years ago
Matt Clay 0d46805979 Clean up shebangs for various files.
- Remove shebangs from:
  - ini files
  - unit tests
  - module_utils
  - plugins
  - module_docs_fragments
  - non-executable Makefiles
- Change non-modules from '/usr/bin/python' to '/usr/bin/env python'.
- Change '/bin/env' to '/usr/bin/env'.

Also removed main functions from unit tests (since they no longer
have a shebang) and fixed a python 3 compatibility issue with
update_bundled.py so it does not need to specify a python 2 shebang.

A script was added to check for unexpected shebangs in files.
This script is run during CI on Shippable.
8 years ago
Toshio Kuratomi 5037dc4e69 Make the default Ansible_managed string static so it doesn't interfere with idempotency 8 years ago
Brian Coca b169a61c20 toggle missing handler errors/warnings via config 8 years ago
Brian Coca 7b2f15453d make explicit the scope of config's gather_subset
it only affects the invocation of setup triggered by the gather_facts directive in plays (explicit or implicit)
8 years ago
Toshio Kuratomi 1efe782b46 Refactor parsing of CLI args so that we can modify them in the base class
Implement tag and skip_tag handling in the CLI() class.  Change tag and
skip_tag command line options to be accepted multiple times on the CLI
and add them together rather than overwrite.

* Make it configurable whether to merge or overwrite multiple --tags arguments
* Make the base CLI class an abstractbaseclass so we can implement
  functionality in parse() but still make subclasses implement it.
* Deprecate the overwrite feature of --tags with a message that the
  default will change in 2.4 and go away in 2.5.

* Add documentation for merge_multiple_cli_flags
* Fix galaxy search so its tags argument does not conflict with generic tags
* Unit tests and more integration tests for tags
8 years ago
Indrajit Raychaudhuri becb4765c3 Add homebrew in squash_actions list (#16966)
`homebrew`, like other package modules in the existing `squash_actions` list can
benefit from `with_items` loops optimization.
8 years ago
jctanner fff161f2f6 Smart mode for sftp+scp (#17813)
If the sftp fails, roll over to scp by default. This saves users
from having to know about the scp_if_ssh method when sftp is broken
on the remote host.
8 years ago
nitzmahone ee080eddb5 adjust WinRM service configuration message text
fixes #17478
8 years ago
jlehtniemi-broadsoft 5864ae50c6 Start WinRM service automatically on reboot 8 years ago
Brian Coca 81a4164207 old yaml format has been long gone
script is not compatible with new yaml format so removing it to avoid confusion

(cherry picked from commit 52099224e632fe0a8b076774b22723fb73d19ea0)
8 years ago
Brian Coca f59e8be428 linked cause people forget yaml and yml exist
(cherry picked from commit c769a966106cc01edd87f26a587238e954195d7d)
8 years ago
jctanner fe8258a378 make timeout decorator for facts have a configurable duration (#16551)
* Add a gather_timeout parameter
* update example ansible.cfg
* fix play level fact gathering too
8 years ago
Shota 47f715fb37 Fix some typos (#16498) 8 years ago
Scott Mcdermott 007c20a28b Add missing {cache,inventory}_plugins to ansible.cfg (#16463) 8 years ago
Toshio Kuratomi a3959644ee Change the default of module_set_locale to False. (#16313)
This makes Ansible no longer set LC_ALL for remote systems.  It is up to
the individual modules to set LC_ALL if they need it for screenscraping
the output from a program.

This is the 2.2 followup for #15138
9 years ago
Brian Coca de18566882 made ssh compression configurable (#16214)
AIX ssh does not seem to like compression, moved it to ssh_args
to allow making it configurable. Note that those using ssh_args
already will need to add it explicitly to keep compression.
9 years ago
Matt Davis 5825958a5a Merge pull request #15275 from Cryptophobia/devel
Update ConfigureRemotingForAnsible.ps1
9 years ago
Dag Wieers a485395b02 Fix small typo in ansible.cfg (#15912) 9 years ago
Cryptophobia 76a519fddc Update to ConfigureRemotingForAnsible.ps1 9 years ago
Toshio Kuratomi dcc5dfdf81 Controller-side module caching.
This makes our recursive, ast.parse performance measures as fast as
pre-ziploader baseline.

Since this unittest isn't testing that the returned module data is
correct we don't need to worry about os.rename not having any module
data.  Should devise a separate test for the module and caching code
9 years ago
Brian Coca 1942cd33dc draft add group merge priority and yaml inventory
* now you can specify a yaml invenotry file

* ansible_group_priority will now set this property on groups

* added example yaml inventory

* TODO: make group var merging depend on priority

  groups, child/parent relationships should remain unchanged.
9 years ago
James Cammarata 040893a677 Adding a config option to allow disabling locale settings upon module exec
Fixes #15138
9 years ago
Toshio Kuratomi 4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

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

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

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

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

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

* Refactoring of module_common code:

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

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

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

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

* Comments cleanup

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

* for line in lines strips the newlines so we have to add them back in
9 years ago
Linus Arver 0814a37a76 examples/ansible.cfg: add vault_password_file 9 years ago
James Cammarata 2c20579a06 Add options to make includes 'static'
* Can be configured in the ansible.cfg for tasks/handlers individually
* If an included filename contains no vars or loops, it will be expanded
  in-place as if it were marked as static
9 years ago
Toshio Kuratomi 52e9209491 Don't create world-readable module and tempfiles without explicit user permission 9 years ago
Matthew Gamble 7b06ec79e3 Add documentation for squash_actions configuration setting 9 years ago
Toshio Kuratomi 512825455e Make ohai and facter work via module_utils Fact classes rather than in the setup module 9 years ago
Yannig Perré 88772b6003 Add a way to restrict gathered facts in Ansible:
- Using gather_subset options
- By ignoring ohai/chef or facter/puppet facts
9 years ago
Matt Clay ba1bcdfc17 Add noseclabel support to libvirt_lxc plugin. 9 years ago
Brian Coca e74ab3ecdd draft 1st release of ansible-console
porting @dominis 's ansible-shell tool from 1.9 and integrating it into ansible
added verbosity control
made more resilitent to several errors
added highlight color, to configurable colors
more resilient on exception and interruptions
prompt coloring, goes red and changes to # when using become = true and root
become setting is now explicit and not a toggle
9 years ago
Kishin Yagami 299c18d700 Support strategy_plugins setting in a configuration file 9 years ago
Brian Coca c24249c57d made max diff size configurable 9 years ago
Matt Davis 840cda741d Merge pull request #12363 from breathe/devel
allow ConfigureRemotingForAnsible.ps1 script from public zone
9 years ago
Michael Crilly e9fe5f201f $SubjectName variable unused; clean up
Having used this script several times today, I came to notice the $SubjectName variable, being passed in via the CLI, is essentially ignored when generating the SSL certificates, rendering it useless. I believe it's a good idea to have it in place, so I've updated the script to reflect this.

I also cleaned up some random new lines throughout the file, and expanded on a comment.

It might be worth going a step further and commenting the file fully, as most people reviewing this file won't be familiar with PowerShell (like I wasn't unitl a few days ago). It could be helpful.
9 years ago