summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Update DOCUMENTATION.yml (#80579)Esther Christopher2023-04-201-6/+9
|
* fix reject list (#79391)Brian Coca2022-11-181-2/+2
|
* issue #72449 winrm script rm (#77931)Don Naro2022-06-161-0/+15
|
* ansible-test pssa update and new rules (#76256)Jordan Borean2021-11-102-116/+74
|
* updated ansible.cfg to guide stray link devel link (#75782)Brian Coca2021-09-241-1/+7
| | | * updated ansible.cfg to guide stray link devel link
* removing out of date example ansible.cfg (#75193)Brian Coca2021-08-301-524/+4
| | | | | removing out of date example ansible.cfg, show user how to generate from ansible-config Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
* config: small typo fix (#74845)Boris Korzun2021-05-271-1/+1
|
* fixed URL for becoming an unprivileged user doc (#74448)antonc422021-04-281-1/+1
|
* Update examples/scripts/uptime.py (#74438)Abhijeet Kasurde2021-04-271-1/+1
| | | | | Fixes missing parameter 'verbosity' Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* rethink wording (#70028)Brian Coca2020-10-301-4/+4
| | | | | | | * rethink wording * removed unrequired requirement * fix tests * fixed versions Co-authored-by: Sloane Hertel <shertel@redhat.com>
* Fix example to use correct shebang (#72129)Jordan Borean2020-10-073-3/+3
| | | | | | | * Fix example to use correct shebang * Fix other example modules as well * Ignore shebang test
* galaxy: Add examples for galaxy section in ansible.cfg (#70931)Abhijeet Kasurde2020-08-211-0/+31
| | | | | | | Add example section for galaxy section in ansible.cfg Fixes: #68402 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Add documentation about info/facts module development (#71250)Abhijeet Kasurde2020-08-183-0/+341
| | | | | Fixes: #40151 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Refactor Python API examples and docsSviatoslav Sydorenko2020-07-231-28/+54
| | | | | | | | | PR #70446: it's a follow-up for #70445. It includes a merge of `examples/scripts/uptime.py` and a similar code snippet from `docs/docsite/rst/dev_guide/developing_api.rst`. This patch also changes the docs RST file to include contents of the example file instead of holding a copy of a similar code.
* misc typo fixes (#70736)Abhijeet Kasurde2020-07-192-7/+7
| | | Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Fix the internal Python API usage examplesSviatoslav Sydorenko2020-07-031-9/+17
| | | | | | | | | | | | | Previous version initialized the `TaskQueueManager` after calling `Play.load()` while advertising a way to inject a custom library location path. This caused the tasks loader not to find any custom modules because it was triggered before the path was actually added to the module loader. This patch changes the order of the operations to ensure that the customized `context.CLIARGS` actually influences things. Resolves https://github.com/ansible/ansible/issues/69758.
* More boilerplate fixes. (#70224)Matt Clay2020-06-221-0/+3
| | | | | | | * Fix boilerplate in hacking dir. * Fix boilerplate in docs dir. * Fix boilerplate in integration tests. * Fix boilerplate in examples.
* comment heavy playbook (#68981)Brian Coca2020-05-191-0/+525
| | | | | | * create examples/play.yml Co-authored-by: flowerysong <junk+github@flowerysong.com>
* Change example ControlPath to be short and unique (#69347)Jakub Paweł Głazik2020-05-071-1/+1
| | | Use %C as the ControlPath setting in the example config file. The old setting used %h and %r tokens, which break ansible for a few use cases, including packer provisioning, where hostname is always 127.0.0.1. %C is a hash of local host, remote host, username and port.
* add punctuation marks to comments (#68882)Rowayda Khayri2020-05-061-4/+4
|
* Add example setting for collections_paths parameter to examples/ansible.cfg ↵Hideki Saito2020-04-301-0/+3
| | | | | (#69018) Signed-off-by: Hideki Saito <saito@fgrep.org>
* Remove old example playbooks dir. (#68409)Matt Clay2020-03-251-7/+0
| | | The content was relocated nearly 7 years ago.
* Fix typos in `ansible.cfg` commentsAnatoly Kamchatnov2019-11-231-3/+3
| | | PR #65177
* Update ansible.cfg (#64855)Sam Doran2019-11-191-168/+169
| | | | | - clean out old options that are now deprecated - clean up formatting of comments a bit - add become plugin examples
* add vfat to selinux special_context_filesystems (#59823)James Cassell2019-08-121-1/+1
| | | | | | vfat is the format of the /boot/efi partition on UEFI hosts and does not support SELinux labels add an environment variable for this config option
* many pslint fixes (#55862)Shachaf922019-07-092-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handles: PSAvoidTrailingWhitespace PSAvoidGlobalVars PSAvoidAssignmentToAutomaticVariable PSAvoidUsingCmdletAliases PSAvoidUsingWriteHost PSUseDeclaredVarsMoreThanAssignments PSUsePSCredentialType PSAvoidUsingPositionalParameters PSAvoidUsingEmptyCatchBlock PSAvoidUsingWMICmdlet Replaced Write-Host with Write-Output Added smart reboot check for win_domain feature installation Modify the Creation of the pagefileto fit to CIM Changelog fragment addition Ignore.txt without fixes * Changes after community reviews * Change Out-Null to '> $null' * Fixes after jborean93 comments * Test * Revert "Test" This reverts commit 35c5c0648fa9d2868a18094d84954e53ffa28880. * Removed all > $null since they broke the module since the output got dumped * run test again * Revert "run test again" This reverts commit 80eaf07143f9d8cb0116cbbc68a6a69c0ace840c. * Changes after community review * ignore PSUseDeclaredVarsMoreThanAssignments that are on a diffrent PR * CI failed on extra line in ignore.txt * Review changes * PSlint errors * Trail space * send to null breaks the tests for Set-Workgroup * Lint stuff * win_domain_user issue of indent. * Update win_domain_user.ps1 * Update win_domain_membership.ps1 * Fix redirect to null * lint space issue * removed return from set-workgroup * removed send to null
* Clearer examples of hosts.yml inventory (#57999)Brian Coca2019-06-181-24/+35
| | | * Clearer examples of hosts.yml inventory
* Change the retry_files_enabled to False and modify the comments to reflect ↵Chuck Douglas2019-02-281-2/+2
| | | | | | | | | | | | | | | | that this has been disabled (#52581) * Change the retry_files_enabled to False and modify the comments to reflect that this has been disabled. * Change the default action of retry_files_enabled to False * Update porting guide to reflect change in default state of retry_files_enabled variable * Change log documenting a change in default behaviour of retry_files_enabled * Revert config change to comment out the retry_files_enabled line to let the user decided what is best. Comment above still states how to change.
* examples: fix Ansible API example (#51863)Abhijeet Kasurde2019-02-121-13/+9
| | | Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Become plugins (#50991)Matt Martz2019-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [WIP] become plugins Move from hardcoded method to plugins for ease of use, expansion and overrides - load into connection as it is going to be the main consumer - play_context will also use to keep backwards compat API - ensure shell is used to construct commands when needed - migrate settings remove from base config in favor of plugin specific configs - cleanup ansible-doc - add become plugin docs - remove deprecated sudo/su code and keywords - adjust become options for cli - set plugin options from context - ensure config defs are avaialbe before instance - refactored getting the shell plugin, fixed tests - changed into regex as they were string matching, which does not work with random string generation - explicitly set flags for play context tests - moved plugin loading up front - now loads for basedir also - allow pyc/o for non m modules - fixes to tests and some plugins - migrate to play objects fro play_context - simiplify gathering - added utf8 headers - moved option setting - add fail msg to dzdo - use tuple for multiple options on fail/missing - fix relative plugin paths - shift from play context to play - all tasks already inherit this from play directly - remove obsolete 'set play' - correct environment handling - add wrap_exe option to pfexec - fix runas to noop - fixed setting play context - added password configs - removed required false - remove from doc building till they are ready future development: - deal with 'enable' and 'runas' which are not 'command wrappers' but 'state flags' and currently hardcoded in diff subsystems * cleanup remove callers to removed func removed --sudo cli doc refs remove runas become_exe ensure keyerorr on plugin also fix backwards compat, missing method is attributeerror, not ansible error get remote_user consistently ignore missing system_tmpdirs on plugin load correct config precedence add deprecation fix networking imports backwards compat for plugins using BECOME_METHODS * Port become_plugins to context.CLIARGS This is a work in progress: * Stop passing options around everywhere as we can use context.CLIARGS instead * Refactor make_become_commands as asked for by alikins * Typo in comment fix * Stop loading values from the cli in more than one place Both play and play_context were saving default values from the cli arguments directly. This changes things so that the default values are loaded into the play and then play_context takes them from there. * Rename BECOME_PLUGIN_PATH to DEFAULT_BECOME_PLUGIN_PATH As alikins said, all other plugin paths are named DEFAULT_plugintype_PLUGIN_PATH. If we're going to rename these, that should be done all at one time rather than piecemeal. * One to throw away This is a set of hacks to get setting FieldAttribute defaults to command line args to work. It's not fully done yet. After talking it over with sivel and jimi-c this should be done by fixing FieldAttributeBase and _get_parent_attribute() calls to do the right thing when there is a non-None default. What we want to be able to do ideally is something like this: class Base(FieldAttributeBase): _check_mode = FieldAttribute([..] default=lambda: context.CLIARGS['check']) class Play(Base): # lambda so that we have a chance to parse the command line args # before we get here. In the future we might be able to restructure # this so that the cli parsing code runs before these classes are # defined. class Task(Base): pass And still have a playbook like this function: --- - hosts: tasks: - command: whoami check_mode: True (The check_mode test that is added as a separate commit in this PR will let you test variations on this case). There's a few separate reasons that the code doesn't let us do this or a non-ugly workaround for this as written right now. The fix that jimi-c, sivel, and I talked about may let us do this or it may still require a workaround (but less ugly) (having one class that has the FieldAttributes with default values and one class that inherits from that but just overrides the FieldAttributes which now have defaults) * Revert "One to throw away" This reverts commit 23aa883cbed11429ef1be2a2d0ed18f83a3b8064. * Set FieldAttr defaults directly from CLIARGS * Remove dead code * Move timeout directly to PlayContext, it's never needed on Play * just for backwards compat, add a static version of BECOME_METHODS to constants * Make the become attr on the connection public, since it's used outside of the connection * Logic fix * Nuke connection testing if it supports specific become methods * Remove unused vars * Address rebase issues * Fix path encoding issue * Remove unused import * Various cleanups * Restore network_cli check in _low_level_execute_command * type improvements for cliargs_deferred_get and swap shallowcopy to default to False * minor cleanups * Allow the su plugin to work, since it doesn't define a prompt the same way * Fix up ksu become plugin * Only set prompt if build_become_command was called * Add helper to assist connection plugins in knowing they need to wait for a prompt * Fix tests and code expectations * Doc updates * Various additional minor cleanups * Make doas functional * Don't change connection signature, load become plugin from TaskExecutor * Remove unused imports * Add comment about setting the become plugin on the playcontext * Fix up tests for recent changes * Support 'Password:' natively for the doas plugin * Make default prompts raw * wording cleanups. ci_complete * Remove unrelated changes * Address spelling mistake * Restore removed test, and udpate to use new functionality * Add changelog fragment * Don't hard fail in set_attributes_from_cli on missing CLI keys * Remove unrelated change to loader * Remove internal deprecated FieldAttributes now * Emit deprecation warnings now
* Increase persistent command_timeout default value (#51056)Ganesh Nalawade2019-01-211-9/+2
| | | | | | | | | | * Increase persistent command_timeout default value * Increase command_timeout default value from 10 to 30 sec to reduce frequent timeout issue for network connection types (netconf/network_cli/httpapi/napalm) * Fix review comments
* Fix usetty keyword in example ansible.cfg (#51084)jctanner2019-01-181-1/+1
|
* inventory plugin order: update docPierre-Louis Bonicoli2018-12-121-1/+1
| | | | | | | | | add doc for #44428: - add changelog fragment - update porting guide also: - update auto inventory plugin doc - mention toml plugin in examples
* Inventory plugins move auto before ini (#44428)Pilou2018-12-111-1/+1
| | | | | | | | | | | | | * inventory plugins: try auto before ini auto plugin should run before ini to avoid ini being able to parse some plugin configuration YAML files successfully. * Update comment comment was added by 2ffe3c42bb15263ad67dd36842712d9d3ec99070 but related code was later removed by 506e6a0b2d49a147e1c0c0b301c71163ea785d71.
* Add comment about group merge in yaml inventory example (#24986)Monty Taylor2018-11-291-2/+9
| | | | * Add comment about group merge in yaml inventory example, w/bcoca feedback
* Misc Typo (#48918)Abhijeet Kasurde2018-11-201-1/+1
| | | | | Changed hostames to hostnames Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Add 'auto' to documented default enabled inventory plugins (#46621)Sloane Hertel2018-10-081-1/+1
| | | | | | * Correct default inventory plugins enabled in docs and example/ansible.cfg * Fix headers
* explicitly set LocalAccountTokenFilterPolicy on WinRM configure script (#45947)Jordan Borean2018-09-251-0/+15
|
* Add undocumented configuration parameter and explain in porting guide (#36059)skylerbunny2018-09-171-0/+9
| | | * Add undocumented configuration parameter and explain in porting guide
* Surround top-level function and class definitions with two blank lines.Joren Vrancken2018-07-311-0/+1
|
* Fix some broken links (#42079)John R Barker2018-06-291-2/+1
| | | | | | | * Fix some broken links * We now only serve via https * redirects don't work with anchors, so update those links (devel/dev_guide)
* update ansible.cfg example (#41832)李宏杰2018-06-221-0/+7
|
* draft schema for inventory scripts (#39454)Brian Coca2018-05-241-0/+53
| | | | | | | | | | | | * draft schema for inventory scripts used by the script inventory plugin * fixes and details for vars * proper escape * restrict additional
* Add ssh_connection retries to ansible.cfg example (#38393)Matt Ralph2018-05-241-0/+5
| | | | I add the `retries` option under [ssh_connection] as it was missing, and some brief comments on the backoff logic.
* Use https for links to ansible.com domains.Matt Clay2018-04-231-1/+1
|
* Generate SHA256 signed certificates for WinRM (#36668)David Norman2018-04-201-1/+33
| | | | | | | | | | | | | | | | | | | | * Generate SHA256 signed certificates Vulnerability scanners are increasingly reporting SHA-1 signed certificates as a vulnerability on servers. Before this change, -ForceNewSSLCert generates a signature algorithm that openssl shows as sha1WthRSAEncryption for WinRM port 5986. After, this forces certificates to be signed with SHA256, which openssl shows sha256WithRSAEncryption. Some example SHA-1 deprecations include: - https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2017/4010323 - https://blog.mozilla.org/security/2014/09/23/phasing-out-certificates-with-sha-1-based-signature-algorithms/ Also note that RDP 3389 on Windows 2016 also defaults to a SHA256 certificate. The specifics were merged from a script mod I found at https://gallery.technet.microsoft.com/scriptcenter/PowerShell-script-to-7a0321b7 intended for Exchange. It also includes a mod to add an alternate DNS listing so the cert contains CN=HOSTNAME plus now also an alternative of the FQDN. I tested this change on Windows 2008R2, 2012R2, and 2016 Datacenter. * Keep WinRM cert key length at 4096. * Remove WinRM cert exportpolicy setting.
* Implement plugin filteringToshio Kuratomi2018-01-222-0/+7
|
* Update example uptime script to provide correct type for explicit individual ↵John Bond2018-01-161-2/+7
| | | | hosts (#34740)
* Python 2.6 `str.format()` compatibility fixes.Matt Clay2018-01-101-3/+3
|
* Added possibility to disable basic auth (#33224)Erwan Quélin2018-01-021-10/+32
|