summaryrefslogtreecommitdiff
path: root/examples/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Update examples/scripts/uptime.py (#74438)Abhijeet Kasurde2021-04-271-1/+1
| | | | | Fixes missing parameter 'verbosity' Signed-off-by: Abhijeet Kasurde <akasurde@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
* 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.
* 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.
* 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
* examples: fix Ansible API example (#51863)Abhijeet Kasurde2019-02-121-13/+9
| | | Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* explicitly set LocalAccountTokenFilterPolicy on WinRM configure script (#45947)Jordan Borean2018-09-251-0/+15
|
* Surround top-level function and class definitions with two blank lines.Joren Vrancken2018-07-311-0/+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.
* 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
|
* avoid use of Write-Host in config scriptMatt Davis2017-12-201-3/+3
|
* add GlobalHttpFirewallAccess arg (#34124)Matt Davis2017-12-201-1/+60
|
* Explain -EnableCredSSP in headerDag Wieers2017-11-021-0/+2
| | | The new Windows documentation references the top of this file for a list and explanation of options, however `-EnableCredSSP` was missing from this list.
* Update uptime.py example script with changes to the API. Fixes #31229Matt Martz2017-10-041-6/+6
|
* Set startup type to automatic before attempting to start the service. ↵Simon Liddicott2017-08-071-3/+3
| | | | Otherwise it will fail if the service is disabled. (#27751)
* Fix one name in module error due to rewritten VariableManagerToshio Kuratomi2017-07-271-1/+1
|
* Fix spelling mistakes (comments only) (#25564)Abhijeet Kasurde2017-06-121-1/+1
| | | | | | | | Original Author : klemens <ka7@github.com> Taking over previous PR as per https://github.com/ansible/ansible/pull/23644#issuecomment-307334525 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* examples/: PEP8 compliancy (#24682)Dag Wieers2017-05-181-17/+20
| | | - Make PEP8 compliant
* ConfigureRemotingForAnsible: RSA 1024 to RSA 4096 (#23684)Nicolas Simond2017-04-191-3/+5
|
* Remove useless # in comment (#21609)David PHAM-VAN2017-02-181-1/+1
|
* fix ambiguous cert selection in WinRM enable script (#21263)Matt Davis2017-02-131-4/+5
| | | Rather than trying to guess which cert we just generated, parse the generated cert data and extract the thumbprint directly.
* Added info on ntlm and credssp, updated configure script for credssp (#21175)Jordan Borean2017-02-081-1/+17
|
* Add missing support for -CertValidityDays (#21009)Dag Wieers2017-02-061-36/+22
| | | | | | | | | | | | | | * Add missing support for -CertValidityDays For some reason the -CertValidityDays option was not being used in the certificates we created. This fixes #10439 * Possible fix * We cannot use New-SelfSignedCertificate on 2012R2 and earlier As suggested by @jhawkesworth
* Improve inline docs (#21029)Dag Wieers2017-02-041-7/+14
|
* PEP 8 indent cleanup. (#20800)Matt Clay2017-01-291-11/+11
| | | | | | | | * PEP 8 E121 cleanup. * PEP 8 E126 cleanup. * PEP 8 E122 cleanup.
* Ensure that the script is run with elevated privileges (#20669)Dag Wieers2017-01-271-0/+18
| | | | | | | | * Ensure that the script is run with elevated privileges This fixes #20654 * Implement our own check for elevated privileges
* Small fix for running using Invoke-ExpressionDag Wieers2017-01-261-1/+1
| | | | | | A small fix suggested by a user for running ConfigureRemotingForAnsible. This fixes #20512
* Enable -Verbose and log to EventLog (#19909)Dag Wieers2017-01-101-24/+74
| | | | | | 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.
* fix indent (#20071)TaoBeier2017-01-101-1/+1
|
* Fix compile errors in scripts.Matt Clay2016-12-081-6/+6
|
* Clean up shebangs for various files.Matt Clay2016-11-021-1/+1
| | | | | | | | | | | | | | | | | | | - 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.
* adjust WinRM service configuration message textnitzmahone2016-09-091-1/+1
| | | | fixes #17478
* Start WinRM service automatically on rebootjlehtniemi-broadsoft2016-09-091-0/+2
|
* old yaml format has been long goneBrian Coca2016-09-081-207/+0
| | | | | | script is not compatible with new yaml format so removing it to avoid confusion (cherry picked from commit 52099224e632fe0a8b076774b22723fb73d19ea0)
* Fix some typos (#16498)Shota2016-06-291-1/+1
|
* Update to ConfigureRemotingForAnsible.ps1Cryptophobia2016-04-131-1/+38
|
* Merge pull request #12363 from breathe/develMatt Davis2016-02-291-3/+14
|\ | | | | allow ConfigureRemotingForAnsible.ps1 script from public zone
| * Document -SkipNetworkProfileCheck switchNathaniel Cohen2015-09-221-0/+4
| |
| * allow ConfigureRemotingForAnsible.ps1 script to function from 'public' adaptersNathaniel Cohen2015-09-141-4/+11
| | | | | | | | | | | | | | The current script fails on machines which have network interfaces designated as connected to "Public" networks (choices for network designation being Private, Domain, Public). This commit changes the script to NOT prevent winrm initialization when device is connected to a "Public" network.
* | $SubjectName variable unused; clean upMichael Crilly2016-02-291-16/+14
| | | | | | | | | | | | | | | | 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.
* | update uptime script to use version 2.0 of the apib4ldr2016-02-171-23/+80
|/
* Replace .iteritems() with six.iteritems()Marius Gedminas2015-09-031-1/+2
| | | | | | | Replace .iteritems() with six.iteritems() everywhere except in module_utils (because there's no 'six' on the remote host). And except in lib/ansible/galaxy/data/metadata_template.j2, because I'm not sure six is available there.
* moved WinRM setup script test after confignitzmahone2015-08-311-25/+22
|
* Fixed error handling for the enabling of PS RemotingWillem Pienaar2014-12-161-7/+1
|
* Merge pull request #9481 from cipress/patch-1Chris Church2014-11-231-2/+13
|\ | | | | fixes powershell upgrade script to work on different System architectures.
| * Found issue on different System architecture.cipress2014-11-041-2/+13
| | | | | | On x86 systems doesn't work so, starting by the line 63 we check if the architecture is x86 or x64.