summaryrefslogtreecommitdiffstats
path: root/hacking (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Perf graphing (#46346)Matt Martz2019-01-081-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * csv of memory usage * Fix var * Configurable output file * Add cpu profiling * Valdiate the existence of cgroup files * Add guard to prevent exception when trying to reset max memory value * to_bytes/to_text and docs updates * Add support for CPU results * Just track the max, don't log all results, and then calculate max * Restore cgroup_memory_recap, and move new functionality into cgroup_perf_recap * Add pid count tracking, restructure to support more profilers * Add cli tool for graphing cgroup_perf_recap data * csv_output_dir is a path * Correct CALLBACK_NAME * Include uuid in csv data * fix linting errors * Bump version_added * Create helper funciton to create dict from list of keys, with callable default * Updated notes to include pids * Print a newline after each section * Plugin improvements * Add option to supporess recap display * Add default for output directory * Add option to dictate whether or not to write files * Add JSON-seq output option * s/uuid/task_uuid * Use bytes for paths * Increase polling interval length for pids/memory * Reduce instance attrs, change how we invoke profilers * Shorten some line lengths * Remove more instance attrs * Fix some typos * document directory creation, and catch exceptions * Enable per task file outputs, and filename customization * s/per_task_file/file_per_task/g
* Port from plaform.dist to ansible.module_utils.distro.linux_distributionToshio Kuratomi2018-12-171-4/+7
| | | | ci_complete
* Update bare exceptions to specify Exception.Toshio Kuratomi2018-12-172-2/+2
| | | | | This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
* [AWS] ses rule set module for inbound email processing (#42781)Ed Costello2018-11-142-1/+30
| | | | | | | | | | * Add module ses_rule_set for Amazon SES * Update behaviours and naming to be consistent with other aws_ses_ modules. * Add global lock around tests using active rule sets to prevent intermittent test failures. * Fix deletion of rule sets so that we don't inactivate the active rule set when force deleting an inactive rule set.
* test-module: define ansible_version attributePierre-Louis Bonicoli2018-10-181-0/+2
| | | | | | | | | | | | | | | | | | | | | Executed command: ./hacking/test-module -m lib/ansible/modules/cloud/scaleway/scaleway_security_group.py -a ... Fix this exception found while testing scaleway_security_group module: Traceback (most recent call last): File "~/debug_dir/__main__.py", line 240, in <module> main() File "~/debug_dir/__main__.py", line 236, in main core(module) File "~/debug_dir/__main__.py", line 209, in core api = Scaleway(module=module) File "~/debug_dir/ansible/module_utils/scaleway.py", line 58, in __init__ 'User-Agent': self.get_user_agent_string(module), File "~/debug_dir/ansible/module_utils/scaleway.py", line 99, in get_user_agent_string return "ansible %s Python %s" % (module.ansible_version, sys.version.split(' ')[0]) AttributeError: 'AnsibleModule' object has no attribute 'ansible_version'
* add module aws_codecommit to represent AWS CodeCommit (#46161)Shuang Wang2018-10-181-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kick off * done for the day * beta code and test * fix a typo * boto3_conn and boto_exception aren't used in this code, ec2_argument_spec is used but unneeded. * Returning when find a match avoids doing extra work, especially when pagination is involved * add new permissions for test * (output is changed) is preferred over accessing the attribute directly. * pass the result through camel_dict_to_snake_dict() before returning it. * AnsibleAWSModule automatically merges the argument_spec. * deletes the created resources even if a test fails. * AnsibleAWSModule automatically merges the argument_spec. * fix typo * fix pep8 * paginate list_repositories * specify permissions for test * cut the unnecessary code. * add return doc string * add missed ':' * fix syntax error: mapping values are not allowed here * add description for return * fix syntax error * rename module name and turn off automated integration test.
* pylint plugin to catch due/past-due deprecated calls (#44143)Matt Martz2018-09-252-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start of work on pylint plugin to catch due/past-due deprecated calls * Improve deprecated pylint plugin * Catch call to AnsibleModule.deprecate also * Skip splatted kwargs, we can't infer that info * Add error for invalid version in deprecation * Skip version if it's a reference to a var * Disable ansible-deprecated-no-version for displaying deprecated module info * fix comments * is None * Force specifying a version, this can be disabled on a per case basis * Disable ansible-deprecated-version by default * Remove to look for 2.8 deprecated * Revert "Remove to look for 2.8 deprecated" This reverts commit 4e84034fd104879f429f0262ff0b2317e3d08deb. * Add script and template used for creating issues for deprecated issues * Fix underscore var
* Make ansible-test available in the bin directory. (#45876)Matt Clay2018-09-202-2/+2
|
* Improve iam_group exception handling (#45599)Will Thames2018-09-181-0/+4
| | | | | | | | | | | | | | | * Improve iam_group exception handling Use AnsibleAWSModule for iam_group and handle BotoCoreErrors as well as ClientErrors. Use fail_json_aws to improve error messages * Add minimal iam_group test suite Update some of the read-only IAM permissions (this is not sufficient to run the test suite but it gets further than it did until it tries to add a (non-existent) user) * Clean up after tests
* Add a default man path (#45689)Michael Scherer2018-09-181-1/+1
| | | | | It seems that on some Linux distribution (Fedora 28, Debian), man will not fallback on a default path if MANPATH is set. So using the env-setup script will prevent man from working.
* Add a ticket stub for guiding GitHub newcomersSviatoslav Sydorenko2018-09-111-0/+15
| | | PR #45497
* Add missing s3 permissions for s3 module testing. (#43243)Ed Costello2018-09-101-0/+8
|
* Don't require requests in hacking/report.py (#45350)Matt Martz2018-09-071-3/+5
| | | | | | * Don't require requests in hacking/report.py * move ansible import
* sns_topic boto3 port (#39292)Will Thames2018-08-242-2/+9
| | | | * Port sns_topic to boto3 and add tests
* added account_alias in the response of module aws_caller_facts (#42345)sdubrul2018-08-221-1/+2
| | | | | | | | | | | | | | | | * added account_alias in the response of module aws_caller_facts * added comment to explain list_account_aliases * renamed caller_identity to caller_facts as the content is extended * created changelog * security-policy needs the iam:ListAccountAliases for this module to work * test now checks for the added field account_alias * gracefully handle missing iam:ListAccountAliases permission
* Fix path handling in hacking/env-setup.Matt Clay2018-08-111-3/+19
|
* Remove use of simplejson throughout code base (#43548)Matt Martz2018-08-101-4/+1
| | | | | | | | | | * Remove use of simplejson throughout code base. Fixes #42761 * Address failing tests * Remove simplejson from contrib and other outlying files * Add changelog fragment for simplejson removal
* Surround top-level function and class definitions with two blank lines.Joren Vrancken2018-07-311-0/+1
|
* Port ec2_tag to boto3 (#39712)flowerysong2018-07-271-0/+2
| | | | | | * Add volume manipulation to EC2 integration test policy * Port ec2_tag to boto3
* AnsiballZ improvementsToshio Kuratomi2018-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we don't need to worry about python-2.4 and 2.5, we can make some improvements to the way AnsiballZ handles modules. * Change AnsiballZ wrapper to use import to invoke the module We need the module to think of itself as a script because it could be coded as: main() or as: if __name__ == '__main__': main() Or even as: if __name__ == '__main__': random_function_name() A script will invoke all of those. Prior to this change, we invoked a second Python interpreter on the module so that it really was a script. However, this means that we have to run python twice (once for the AnsiballZ wrapper and once for the module). This change makes the module think that it is a script (because __name__ in the module == '__main__') but it's actually being invoked by us importing the module code. There's three ways we've come up to do this. * The most elegant is to use zipimporter and tell the import mechanism that the module being loaded is __main__: * https://github.com/abadger/ansible/blob/5959f11c9ddb7b6eaa9c3214560bd85e631d4055/lib/ansible/executor/module_common.py#L175 * zipimporter is nice because we do not have to extract the module from the zip file and save it to the disk when we do that. The import machinery does it all for us. * The drawback is that modules do not have a __file__ which points to a real file when they do this. Modules could be using __file__ to for a variety of reasons, most of those probably have replacements (the most common one is to find a writable directory for temporary files. AnsibleModule.tmpdir should be used instead) We can monkeypatch __file__ in fom AnsibleModule initialization but that's kind of gross. There's no way I can see to do this from the wrapper. * Next, there's imp.load_module(): * https://github.com/abadger/ansible/blob/340edf7489/lib/ansible/executor/module_common.py#L151 * imp has the nice property of allowing us to set __name__ to __main__ without changing the name of the file itself * We also don't have to do anything special to set __file__ for backwards compatibility (although the reason for that is the drawback): * Its drawback is that it requires the file to exist on disk so we have to explicitly extract it from the zipfile and save it to a temporary file * The last choice is to use exec to execute the module: * https://github.com/abadger/ansible/blob/f47a4ccc76/lib/ansible/executor/module_common.py#L175 * The code we would have to maintain for this looks pretty clean. In the wrapper we create a ModuleType, set __file__ on it, read the module's contents in from the zip file and then exec it. * Drawbacks: We still have to explicitly extract the file's contents from the zip archive instead of letting python's import mechanism handle it. * Exec also has hidden performance issues and breaks certain assumptions that modules could be making about their own code: http://lucumr.pocoo.org/2011/2/1/exec-in-python/ Our plan is to use imp.load_module() for now, deprecate the use of __file__ in modules, and switch to zipimport once the deprecation period for __file__ is over (without monkeypatching a fake __file__ in via AnsibleModule). * Rename the name of the AnsiBallZ wrapped module This makes it obvious that the wrapped module isn't the module file that we distribute. It's part of trying to mitigate the fact that the module is now named __main)).py in tracebacks. * Shield all wrapper symbols inside of a function With the new import code, all symbols in the wrapper become visible in the module. To mitigate the chance of collisions, move most symbols into a toplevel function. The only symbols left in the global namespace are now _ANSIBALLZ_WRAPPER and _ansiballz_main. revised porting guide entry Integrate code coverage collection into AnsiballZ. ci_coverage ci_complete
* ecs_taskdefinition can absent without containers argument (#41398)Calvin Wu2018-07-121-1/+2
| | | | | | | | * ecs_taskdefinition can absent without containers argument * add regression test for absent with arn * Add PassRole privilege for ecs_cluster to pass
* efs_facts: improve performance by reducing the number of api calls (#36520)Julien Vey2018-07-081-0/+36
| | | | | * efs_facts: improve performance by reducing the number of api calls * Remove efs_facts tests from running in CI
* change OS X to macOS (#41294)Troy Murray2018-06-261-6/+6
| | | | | | | | | | | | * change OS X to macOS <!--- Your description here --> +label: docsite_pr * Update all Mac OS X references to be macOS * Drop extra Mac
* Update additional pypi.python.org URLs to pypi.org (#41373)Jon Dufresne2018-06-171-2/+2
| | | | | For details on the new PyPI, see the blog post: https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
* aws_eks_cluster: New module for managing AWS EKS (#41183)Will Thames2018-06-072-1/+16
| | | | | | | | | | | | | | * aws_eks: New module for managing AWS EKS aws_eks module is used for creating and removing EKS clusters. Includes full test suite and updates to IAM policies to enable it. * Clean up all security groups * appease shippable * Rename aws_eks module to aws_eks_cluster
* Remove ECS policies from AWS compute policyWill Thames2018-06-061-46/+0
| | | | | | | | | | | | The compute policy was exceeding maximum size and contained policies that already exist in ecs-policy. Look up suitable AMIs rather than hardcode We don't want to maintain multiple image IDs for multiple regions so use ec2_ami_facts to set a suitable image ID Improve exception handling
* Fix test-module failing to validate args (#41004)Zhikang Zhang2018-06-011-1/+1
| | | | | | | | | | | | * Fix test-module failing to validate args The test-module pass a wrong argument _ansible_tmp cause the validation failed. Change the argument _ansible_tmp to _ansible_tmpdir to fix this. * Add a integration test for test-module. Prior to this change, we don't have a test for test-module. This change ensure the correctness of test-module script.
* Add two missing VPC permissions (#37896)Will Thames2018-05-252-15/+2
| | | | | Remove VPC permissions from network-policy.json as they mostly duplicate compute-policy.json permissions - separating the VPC and compute permissions would likely lead to further confusion.
* Fix shebangs and file modes and update tests. (#40563)Matt Clay2018-05-221-0/+0
| | | | | | * Add execute bit sanity test and apply fixes. * Add shebang test for `lib` dirs and apply fixes. * Shebang and execute bit cleanup.
* 2.6 changelog gen/version/root dir cleanup (#40421)Matt Davis2018-05-2227-47/+511
| | | | | | | | | | | | | | | | | | | | * patched in changelog gen stuff from stable-2.5 * Makefile updates * release.py as single-source-of-truth * Remove obsolete ansible-core-sitemap.xml file. * Move ROADMAP.rst into README.rst. * dynamic rpm changelog, zap old deb/rpm changelogs * fix changelog in MANIFEST.in * Remove obsolete hacking/update.sh script. * Remove ref to deleted authors script. * Remove ref to removed module-formatter script. * Update headings to match script names. * MANIFEST.in cleanup * removed RELEASES.txt and versions.yml * removed obsolete release generation playbook/bits (not used since 2.5) * misc Makefile cleanup * speculative changes to DEB versioning * allow override of DEB_VERSION/DEB_RELEASE
* Remove the cherrypick scriptToshio Kuratomi2018-05-211-53/+0
| | | | | | We only needed it for migrating cherrypicks between the unified repo and the ansible-modules-* repos. Now that we aren't supporting 2.3, we no longer need this script.
* Fixes incorrect variable name (#40274)Tim Rupp2018-05-161-1/+1
| | | | | Incorrect variable name was causing a NameError NameError: name 'comlpex_args' is not defined
* New Module: ec2_vpc_vpn_facts (#35983)Madhura-CSI2018-05-151-1/+8
| | | | | | | | | | | | | * New module: ec2_vpc_vpn_facts * Add integration tests for ec2_vpc_vpn_facts and the IAM permissions * Add retry to VPC removal * Use unique name for VGW * Always clean up after tests and add retries
* create module tmpdir based on remote_tmp (#39833)Jordan Borean2018-05-151-1/+2
| | | | | | | | | | | | | | | | * create module tmpdir based on remote_tmp * Source remote_tmp from controller if possible * Fixed sanity test and not use lambda * Added expansion of env vars to the remote tmp * Fixed sanity issues * Added note around shell remote_tmp option * Changed fallback tmp dir to ~/.ansible/tmp to make shell defaults
* Fail with nice error message if elb target_type=ip not supported (#38313)Will Thames2018-05-031-2/+4
| | | | | | | | | | | | * Add helpful failure message if target_type=ip is not supported Create test case for target_type=ip not supported * Update elb_target_group module to latest standards Use AnsibleAWSModule Improve exception handling Improve connection handling
* Update test-module (#39331)mwpeterson2018-04-261-0/+1
| | | | Update test-module To use C.DEFAULT_LOCAL_TMP
* [aws]Add VPC configuration to ECS modules (#34381)Will Thames2018-04-251-4/+8
| | | | | | | | | | Enable awsvpc network mode for ECS services and tasks and their underlying task definitions Improve test suite to thoroughly test the changes Use runme.sh technique to run old and new versions of botocore to ensure that the modules work with older botocore and older network modes and fail gracefully if awsvpc network mode is used with older botocore
* Use https for links to ansible.com domains.Matt Clay2018-04-231-1/+1
|
* [cloud]Add aws_ses_identity_policy module for managing SES sending policies ↵Ed Costello2018-04-051-1/+5
| | | | | | | | | | | | | | | | (#36623) * Add aws_ses_identity_policy module for managing SES sending policies * Add option to AnsibleAWSModule for applying a retry decorator to all calls. * Add per-callsite opt in to retry behaviours in AnsibleAWSModule * Update aws_ses_identity_policy module to opt in to retries at all callsites. * Add test for aws_ses_identity_policy module with inline policy. * Remove implicit retrys on boto resources since they're not working yet.
* [cloud][test]Add missing IAM policy for cloudfront (#38248)Will Thames2018-04-052-0/+2
| | | | | | | Cloudfront needs CreateOriginAccessIdentity Add profile parameter to setup-iam.yml. Could arguably just use AWS_PROFILE but given that other tasks are using profile, should be consistent.
* module_common: handle None value for templar (#36651)Pilou2018-03-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * module_common: set required parameter templar Fix the following error (related to b455901): $ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python Traceback (most recent call last): File "./hacking/test-module", line 268, in <module> main() File "./hacking/test-module", line 249, in main (modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename) File "./hacking/test-module", line 152, in boilerplate_module task_vars=task_vars File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module environment=environment) File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar) File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang interpreter = templar.template(task_vars[interpreter_config].strip()) AttributeError: 'NoneType' object has no attribute 'template' * module_common.modify_module: templar is required
* s3_bucket: add integration tests (#36941)Julien Vey2018-03-071-5/+13
| | | Also update testing-policies/storage
* route53_zone: move to boto3, and enable comment update (#36641)Julien Vey2018-03-071-0/+32
|
* Add aws_caller_facts module and use it in setup-iam.yml (#36683)Ed Costello2018-02-281-4/+3
| | | | | | | * Add aws_caller_facts module and use it in setup-iam.yml This removes the dependency on having the command line AWS tools installed.
* Add new aws_waf_condition module (#33110)Will Thames2018-02-021-0/+6
|
* New aws_ses_identity module to manage AWS Simple Email Service Identity (#31140)Ed Costello2018-01-291-0/+31
| | | | | | | * Add aws_ses_identity module * Update CI alias, add BotoCoreError exception handling. * Add SES and SNS permissions to hacking/aws_config to run aws_ses_identity integration tests
* Port sts_assume_role to boto3 (#32569)Marek2018-01-221-0/+23
| | | | | | * Ported sts_assume_role to boto3 * Added integration tests
* Facts distribution clear linux 31501 (#32453)Adrian Likins2018-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The search string used to look for Clear Linux was changed in 45a9f967749ec68e2077fe1d1d32dd37660ab376 to be more specific, but was too specific. Now finding a substring match for 'Clear Linux' in /usr/lib/os-release is enough to consider a match. Since the details of the full name in os-release varies ('Clear Linux Software for Intel Architecture', 'Clear Linux OS for Intel Architecture', etc) the search string match was failing and would fall back to the 'first word in the release file' method resulting in ansible_distribution='NAME="Clear' Also add a meta fact indicating which search string was matched. Test case info from: https://github.com/ansible/ansible/issues/31501#issuecomment-340861535 Fixes #31501
* Add aws_s3 action plugin to find source files as expected (#35028)Will Thames2018-01-191-2/+2
| | | | | | | | | People expect to be able to upload files to s3 using standard locations for files. Providing an action plugin that effectively rewrites the `src` key to the result of finding such a file is a great help. Tests added, and IAM permissions corrected
* [cloud] New module cloudfront_distribution (#31284)Will Thames2018-01-171-0/+28
| | | | | | | | | | | | | | | | | | | | * added cloudfont.py, modified cloudfront_facts.py class name and fixed a minor bug * Improvements to cloudfront_distribution * Reduce the scope of the cloudfront_distribution module * Remove presigning * Remove streaming distribution functionality * Add full test suite for cloudfront distribution * Meet Ansible AWS guidelines * Make requested changes Fix tests Use built-in waiter Update copyright