Commit graph

898 commits

Author SHA1 Message Date
Lindsay Hill
4a98802b52 Ironware: Deprecate provider, support network_cli (#43285) 2018-07-27 12:51:45 +05:30
Toshio Kuratomi
52449cc01a AnsiballZ improvements
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__:
    * 5959f11c9d/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
2018-07-26 20:07:25 -07:00
John R Barker
3ab9030f05 Document more tools (#43053)
* Document more tools
2018-07-26 17:23:00 -05:00
Yanis Guenane
d94cc3568a CloudStack: Fix typos in the Guide (#43303) 2018-07-26 16:08:32 -04:00
Yuma Inaura (稲浦悠馬)
1199dff246 Update porting_guide_2.0.rst
Fix indent

+label: docsite_pr
2018-07-26 14:59:43 -04:00
Sam Doran
2a1a8585f3
Add reboot module stuff to 2.7 roadmap (#43232) 2018-07-25 16:37:57 -04:00
Fabian von Feilitzsch
d27de6acd9 Add from_yaml_all to support multi document yaml strings (#43037)
* Support multi-doc yaml in the from_yaml filter

* Most automatic method of handling multidoc

* Only use safe_load_all

* Implement separate filter

* Update plugin docs and changelog
2018-07-25 16:12:22 -04:00
Jordan Borean
2c9cbae3f9
Removed deprecated Windows items slated for removed in 2.7 (#43231) 2018-07-25 12:02:49 +10:00
Toshio Kuratomi
09142f791c Change the schedule to allow slip time.
We have to have time to slip release in case of major bugs.
2018-07-24 08:54:26 -07:00
Toshio Kuratomi
fb94857a83 Update roadmap with links to PRs 2018-07-24 08:54:26 -07:00
Matt Clay
4e489d1be8
Update Shippable integration test groups. (#43118)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
2018-07-23 20:46:22 -07:00
Donghyun Kang
1b86d598fc fixed typo(removed duplicated 'you') (#43158) 2018-07-24 07:50:09 +05:30
Jordan Borean
93c05074ee
win_chocolatey: refactor module to fix bugs and add new features (#43013)
* win_chocolatey: refactor module to fix bugs and add new features

* Fix some typos and only emit install warning not in check mode

* Fixes when testing out installing chocolatey from a server

* Added changelog fragment
2018-07-24 07:52:13 +10:00
Jarryd Tilbrook
460f858640 Enable check_mode in command module (#40428)
* Enable check_mode in command module

This only works if supplying creates or removes since it needs
something to base the heuristic off. If none are supplied it will just
skip as usual.
Fixes #15828

* Add documentation for new check_mode behavior
2018-07-23 14:06:41 -07:00
AJ Acevedo
e423436ed7 Minor grammatical update
Minor grammatical update.
2018-07-23 12:04:04 -04:00
augustkang
6db074e7af ansible/docs/docsite/rst/inventory/implicit_localhost.rst typo 2018-07-23 10:33:47 -04:00
Nathaniel Case
f6160c675d Add links to network roadmap items 2018-07-20 10:36:24 -07:00
Sandra McCann
2e93eab920 pr 42271 - fixed merge conflicts 2018-07-20 11:22:30 -04:00
Sloane Hertel
fdf51f2a43
Add AWS links for 2.7 roadmap (#43093) 2018-07-20 10:37:25 -04:00
Ryan S. Brown
859ef3d134 Add CFN Stackset roadmap link 2018-07-20 09:48:34 -04:00
Jordan Borean
5e20ef1d89
Add missing links for Windows items on the roadmap (#43061) 2018-07-20 13:12:37 +10:00
Chris Smolen
1e2b332001 Update the regex_findall example (#43052)
<!--- Your description here -->
The example has:
`{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b') }}`

It needs be double backslashes to escape the backslashes:
`{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b') }}`
+label: docsite_pr
2018-07-19 19:02:49 -04:00
Brian Coca
18aa87803f remove dupe entries 2018-07-19 12:16:33 -04:00
Sergiu Marsavela
8d194fa5f7 Update Openstack dynamic inventory reference (#41459)
* Update Openstack dynamic inventory link

* Add note for change of script name

* Change name of script to prevent Python module import errors.

Fixes #41562
2018-07-18 21:34:11 +05:30
John R Barker
5bcdf4f204
cli_config, not net_config (#42903) 2018-07-17 10:18:23 -07:00
Sandra McCann
1900635409 fixed typo (#42900) 2018-07-17 12:13:20 -04:00
Matt Davis
1c420f160a add links to roadmap projects/issues/PRs (#42771)
* add links to roadmap projects/issues/PRs
2018-07-17 09:11:05 -07:00
Taranjeet Singh
58d6044251 Docs: Update sentence structure in user guide (#42884)
This commit fixes the information about become keyword in
Introduction to Playbook part under User Guide.
2018-07-17 21:16:03 +05:30
Matt Martz
27b4d7ed31
Add feature to expose vars/defaults with include/import_role (#41330)
* First pass at making 'private' work on include_role, imports are always public

* Prevent dupe task execution and overwriting handlers

* New functionality will use public instead of deprecated private

* Add tests for public exposure

* Validate vars before import/include to ensure they don't expose too early

* Add porting guide docs about public argument and change to import_role

* Add additional docs about public and vars exposure to module docs

* Insert role handlers at parse time, exposing them globally
2018-07-15 09:59:30 -05:00
Dylan Silva
65643dfc8c Updated winrm details for more clarity (#42574) 2018-07-12 13:44:41 -07:00
Sviatoslav Sydorenko
97cc0cce7f
🚸 🐍 🍒 ⛏ Integrate cherry picker (#41403)
This enables developers to use cherry-picker for backporting purposes.
This tool originally comes from Core Python Development Workflow.

Ref: https://pypi.org/p/cherry-picker
Ref: https://github.com/python/core-workflow/tree/master/cherry_picker

Also:
* 📝 Add docs about supporting cherry-picker
2018-07-12 19:34:02 +03:00
Jiri Tyr
028f79a86b Adding the Ansible way how to create a password hash 2018-07-11 20:30:26 -04:00
Fran Fitzpatrick
5928ec04ca Adds an ipmath filter (#41985) 2018-07-11 10:52:31 -07:00
Brian Coca
a37f27a243 removed note from already removed 1.x api comment
fixes #39888
2018-07-11 11:55:57 -04:00
saidmu
52fe9aaf04 Update intro_inventory.rst
<!--- I think a colon is missing-->

+label: docsite_pr
2018-07-10 12:08:21 -04:00
Abhijeet Kasurde
ef67f580cc VMware: Add scenario guide for renaming VM (#42094)
This adds new sceario guide for renaming an existing virtual machine
to new name.

Fixes: #42084

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-07-10 09:22:52 -05:00
Dylan Silva
c227a0c8bb
Initial upload of roadmap for 2.7 (#41845)
* Initial upload of roadmap for 2.7

* Update ROADMAP_2_7.rst

* Uses regular quotes, rather than smart quotes

* Fix broken link
2018-07-09 12:29:08 -07:00
Sam Doran
7b0dea45e9 Update JSON Query filter examples (#42432)
* Update JSON Query filter examples

Correct syntax on one example
Add more examples of escaping
Change example to show joining list to string
2018-07-09 15:09:52 -04:00
Eugene Korekin
07adeff665 Fix typo (#42433)
+label: docsite_pr
2018-07-07 15:04:05 -04:00
Abhijeet Kasurde
6339e37abd VMware: Remove VM using vmware_guest (#42100)
* VMware: Remove VM using vmware_guest

This adds scenario guide for removing VM using vmware_guest module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* code review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-07-06 12:29:52 -05:00
Alex Stephen
2916adc88a New doc guide for GCP (#41753)
* New doc guide for GCP

* Changes per PR

* Addressing PR comments on GCE scenario guide
2018-07-06 09:09:13 -05:00
Sachidananda Urs
fecda03066 Fix typos in documentation (#42406)
Fix typos in unit test documentation

Fixes:  #42405
2018-07-06 17:37:57 +05:30
Brian Coca
475abc0af7
inventory plugin docs (#42022)
* inventory plugin docs
* added set options
* minor wording and formatting fixes
* changed headers to std as per #35520, also added to main readme
* unified inventory plugin devel, referenced from generic plugin dev
* fixed typos and update as per feedback
2018-07-05 17:30:46 -04:00
Sam Doran
3e2a4f67cf
Update link to GitHub admin process (#42364) 2018-07-05 15:38:52 -04:00
John R Barker
6366df700d Document module links (#42308) 2018-07-05 14:19:09 -05:00
John R Barker
d962611528 Allow documentation of module options type (#42285)
* Allow documentation of module options

Pass through the `type` of a modules option so it's displayed on the
html module docs

* docs
2018-07-05 09:57:58 -04:00
Alexandre Vicenzi
df2e0c7c00 Fix broken links. (#42323) 2018-07-04 18:54:49 -07:00
Alexandre Vicenzi
1dafd92c8e Fix Ansible Galaxy documentation link. (#42316)
More info: https://github.com/ansible/galaxy/issues/830
2018-07-04 09:52:47 -07:00
Ganesh B. Nalawade
78b1980474 More CI failure fixes 2018-07-04 18:42:54 +05:30
Ganesh B. Nalawade
c43beef258 Minor changes 2018-07-04 17:45:12 +05:30