Guest User

diff ansible git dir (dev) with ansible latest (1.6.6)

a guest
Jul 14th, 2014
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 167.85 KB | None | 0 0
  1. Only in ansible-1.6.6: ansible.egg-info
  2. diff -r ansible/ansible/bin/ansible ansible-1.6.6/bin/ansible
  3. 139c139
  4. <         inventory_manager = inventory.Inventory(options.inventory, vault_password=vault_pass)
  5. ---
  6. >         inventory_manager = inventory.Inventory(options.inventory)
  7. diff -r ansible/ansible/bin/ansible-playbook ansible-1.6.6/bin/ansible-playbook
  8. 102a103,107
  9. >     inventory = ansible.inventory.Inventory(options.inventory)
  10. >     inventory.subset(options.subset)
  11. >     if len(inventory.list_hosts()) == 0:
  12. >         raise errors.AnsibleError("provided hosts list is empty")
  13. >
  14. 108,112c113
  15. <     options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_PASS
  16. <
  17. <     if options.listhosts or options.syntax or options.listtasks:
  18. <         (_, _, _, vault_pass) = utils.ask_passwords(ask_vault_pass=options.ask_vault_pass)
  19. <     else:
  20. ---
  21. >     if not options.listhosts and not options.syntax and not options.listtasks:
  22. 113a115
  23. >         options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_PASS
  24. 118a121
  25. >         options.ask_vault_pass = options.ask_vault_pass or C.DEFAULT_ASK_VAULT_PASS
  26. 123,130c126,133
  27. <     if options.vault_password_file:
  28. <         this_path = os.path.expanduser(options.vault_password_file)
  29. <         try:
  30. <             f = open(this_path, "rb")
  31. <             tmp_vault_pass=f.read().strip()
  32. <             f.close()
  33. <         except (OSError, IOError), e:
  34. <             raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
  35. ---
  36. >         if options.vault_password_file:
  37. >             this_path = os.path.expanduser(options.vault_password_file)
  38. >             try:
  39. >                 f = open(this_path, "rb")
  40. >                 tmp_vault_pass=f.read().strip()
  41. >                 f.close()
  42. >             except (OSError, IOError), e:
  43. >                 raise errors.AnsibleError("Could not read %s: %s" % (this_path, e))
  44. 132,133c135,136
  45. <         if not options.ask_vault_pass:
  46. <             vault_pass = tmp_vault_pass
  47. ---
  48. >             if not options.ask_vault_pass:
  49. >                 vault_pass = tmp_vault_pass
  50. 158,162d160
  51. <     inventory = ansible.inventory.Inventory(options.inventory, vault_password=vault_pass)
  52. <     inventory.subset(options.subset)
  53. <     if len(inventory.list_hosts()) == 0:
  54. <         raise errors.AnsibleError("provided hosts list is empty")
  55. <
  56. 165a164,166
  57. >         # let inventory know which playbooks are using so it can know the basedirs
  58. >         inventory.set_playbook_basedir(os.path.dirname(playbook))
  59. >
  60. 209,210c210
  61. <                 play = ansible.playbook.Play(pb, play_ds, play_basedir,
  62. <                                               vault_password=pb.vault_password)
  63. ---
  64. >                 play = ansible.playbook.Play(pb, play_ds, play_basedir)
  65. diff -r ansible/ansible/bin/ansible-pull ansible-1.6.6/bin/ansible-pull
  66. 153,156c153
  67. <     if not options.inventory:
  68. <         inv_opts = 'localhost,'
  69. <     else:
  70. <         inv_opts = options.inventory
  71. ---
  72. >     inv_opts = 'localhost,'
  73. Only in ansible/ansible: CHANGELOG.md
  74. Only in ansible/ansible: CODING_GUIDELINES.md
  75. Only in ansible/ansible: CONTRIBUTING.md
  76. Only in ansible-1.6.6: deb-build
  77. Only in ansible-1.6.6: dist
  78. diff -r ansible/ansible/docs/man/man1/ansible.1 ansible-1.6.6/docs/man/man1/ansible.1
  79. 3,5c3,5
  80. < .\"    Author: :doctype:manpage
  81. < .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  82. < .\"      Date: 05/26/2014
  83. ---
  84. > .\"    Author: [see the "AUTHOR" section]
  85. > .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
  86. > .\"      Date: 11/27/2013
  87. 7c7
  88. < .\"    Source: Ansible 1.7
  89. ---
  90. > .\"    Source: Ansible 1.4.1
  91. 10,19c10
  92. < .TH "ANSIBLE" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  93. < .\" -----------------------------------------------------------------
  94. < .\" * Define some portability stuff
  95. < .\" -----------------------------------------------------------------
  96. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. < .\" http://bugs.debian.org/507673
  98. < .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  99. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. < .ie \n(.g .ds Aq \(aq
  101. < .el       .ds Aq '
  102. ---
  103. > .TH "ANSIBLE" "1" "11/27/2013" "Ansible 1\&.4\&.1" "System administration commands"
  104. 37c28
  105. < \fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq over SSH\&.
  106. ---
  107. > \fBAnsible\fR is an extra\-simple tool/framework/API for doing \'remote things\' over SSH\&.
  108. 85c76
  109. < \fB\-a\fR \*(Aq\fIARGUMENTS\fR\*(Aq, \fB\-\-args=\fR\*(Aq\fIARGUMENTS\fR\*(Aq
  110. ---
  111. > \fB\-a\fR \'\fIARGUMENTS\fR\', \fB\-\-args=\fR\'\fIARGUMENTS\fR\'
  112. 177c168
  113. < Ranges of hosts are also supported\&. For more information and additional options, see the documentation on http://docs\&.ansible\&.com/\&.
  114. ---
  115. > Ranges of hosts are also supported\&. For more information and additional options, see the documentation on http://ansible\&.github\&.com/\&.
  116. 208,214c199
  117. < Extensive documentation is available in the documentation site: http://docs\&.ansible\&.com\&. IRC and mailing list info can be found in file CONTRIBUTING\&.md, available in: https://github\&.com/ansible/ansible
  118. < .SH "AUTHOR"
  119. < .PP
  120. < \fB:doctype:manpage\fR
  121. < .RS 4
  122. < Author.
  123. < .RE
  124. ---
  125. > Extensive documentation as well as IRC and mailing list info is available on the ansible home page: https://ansible\&.github\&.com/
  126. diff -r ansible/ansible/docs/man/man1/ansible-doc.1 ansible-1.6.6/docs/man/man1/ansible-doc.1
  127. 3,5c3,5
  128. < .\"    Author: :doctype:manpage
  129. < .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  130. < .\"      Date: 05/26/2014
  131. ---
  132. > .\"    Author: [see the "AUTHOR" section]
  133. > .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
  134. > .\"      Date: 11/27/2013
  135. 7c7
  136. < .\"    Source: Ansible 1.7
  137. ---
  138. > .\"    Source: Ansible 1.4.1
  139. 10,19c10
  140. < .TH "ANSIBLE\-DOC" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  141. < .\" -----------------------------------------------------------------
  142. < .\" * Define some portability stuff
  143. < .\" -----------------------------------------------------------------
  144. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. < .\" http://bugs.debian.org/507673
  146. < .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  147. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  148. < .ie \n(.g .ds Aq \(aq
  149. < .el       .ds Aq '
  150. ---
  151. > .TH "ANSIBLE\-DOC" "1" "11/27/2013" "Ansible 1\&.4\&.1" "System administration commands"
  152. 66,72c57
  153. < Extensive documentation is available in the documentation site: http://docs\&.ansible\&.com\&. IRC and mailing list info can be found in file CONTRIBUTING\&.md, available in: https://github\&.com/ansible/ansible
  154. < .SH "AUTHOR"
  155. < .PP
  156. < \fB:doctype:manpage\fR
  157. < .RS 4
  158. < Author.
  159. < .RE
  160. ---
  161. > Extensive documentation as well as IRC and mailing list info is available on the ansible home page: https://ansible\&.github\&.com/
  162. diff -r ansible/ansible/docs/man/man1/ansible-galaxy.1 ansible-1.6.6/docs/man/man1/ansible-galaxy.1
  163. 4,5c4,5
  164. < .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  165. < .\"      Date: 05/26/2014
  166. ---
  167. > .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
  168. > .\"      Date: 03/16/2014
  169. 7c7
  170. < .\"    Source: Ansible 1.7
  171. ---
  172. > .\"    Source: Ansible 1.6
  173. 10c10
  174. < .TH "ANSIBLE\-GALAXY" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  175. ---
  176. > .TH "ANSIBLE\-GALAXY" "1" "03/16/2014" "Ansible 1\&.6" "System administration commands"
  177. diff -r ansible/ansible/docs/man/man1/ansible-playbook.1 ansible-1.6.6/docs/man/man1/ansible-playbook.1
  178. 4,5c4,5
  179. < .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  180. < .\"      Date: 05/26/2014
  181. ---
  182. > .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
  183. > .\"      Date: 02/12/2014
  184. 7c7
  185. < .\"    Source: Ansible 1.7
  186. ---
  187. > .\"    Source: Ansible 1.5
  188. 10c10
  189. < .TH "ANSIBLE\-PLAYBOOK" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  190. ---
  191. > .TH "ANSIBLE\-PLAYBOOK" "1" "02/12/2014" "Ansible 1\&.5" "System administration commands"
  192. 94c94,154
  193. < \fB\-t\fR, \fITAGS\fR, \fB\-\-tags=\fR\fITAGS\fR
  194. ---
  195. > \fB\-S\fR, \fB\-\-su\fR
  196. > .RS 4
  197. > run operations with su\&.
  198. > .RE
  199. > .PP
  200. > \fB\-\-ask\-su\-pass\fR
  201. > .RS 4
  202. > Prompt for the password to use for playbook plays that request su access, if any\&.
  203. > .RE
  204. > .PP
  205. > \fB\-R\fR, \fISU_USER\fR, \fB\-\-sudo\-user=\fR\fISU_USER\fR
  206. > .RS 4
  207. > Desired su user (default=root)\&.
  208. > .RE
  209. > .PP
  210. > \fB\-\-ask\-vault\-pass\fR
  211. > .RS 4
  212. > Ask for vault password\&.
  213. > .RE
  214. > .PP
  215. > \fB\-\-vault\-password\-file=\fR\fIVAULT_PASSWORD_FILE\fR
  216. > .RS 4
  217. > Vault password file\&.
  218. > .RE
  219. > .PP
  220. > \fB\-\-force\-handlers\fR
  221. > .RS 4
  222. > Run play handlers even if a task fails\&.
  223. > .RE
  224. > .PP
  225. > \fB\-\-list\-hosts\fR
  226. > .RS 4
  227. > Outputs a list of matching hosts without executing anything else\&.
  228. > .RE
  229. > .PP
  230. > \fB\-\-list\-tasks\fR
  231. > .RS 4
  232. > List all tasks that would be executed\&.
  233. > .RE
  234. > .PP
  235. > \fB\-\-start\-at\-task=\fR\fISTART_AT\fR
  236. > .RS 4
  237. > Start the playbook at the task matching this name\&.
  238. > .RE
  239. > .PP
  240. > \fB\-\-step\fR
  241. > .RS 4
  242. > one-step-at-a-time: confirm each task before running\&.
  243. > .RE
  244. > .PP
  245. > \fB\-\-syntax\-check\fR
  246. > .RS 4
  247. > Perform a syntax check on the playbook, but do not execute it\&.
  248. > .RE
  249. > .PP
  250. > \fB\-\-private\-key\fR
  251. > .RS 4
  252. > Use this file to authenticate the connection\&.
  253. > .RE
  254. > .PP
  255. > \fB\-t\fR, \fITAGS\fR, \fB\fI\-\-tags=\fR\fR\fB\*(AqTAGS\fR
  256. 99c159
  257. < \fB\-\-skip\-tags=\fR\fISKIP_TAGS\fR
  258. ---
  259. > \fB\fI\-\-skip\-tags=\fR\fR\fB\*(AqSKIP_TAGS\fR
  260. 149a210,216
  261. >
  262. > .PP
  263. > \fB\-\-version\fR
  264. > .RS 4
  265. > Show program's version number and exit\&.
  266. > .RE
  267. >
  268. diff -r ansible/ansible/docs/man/man1/ansible-pull.1 ansible-1.6.6/docs/man/man1/ansible-pull.1
  269. 5c5
  270. < .\"      Date: 05/26/2014
  271. ---
  272. > .\"      Date: 01/02/2014
  273. 7c7
  274. < .\"    Source: Ansible 1.7
  275. ---
  276. > .\"    Source: Ansible 1.5
  277. 10,19c10
  278. < .TH "ANSIBLE" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  279. < .\" -----------------------------------------------------------------
  280. < .\" * Define some portability stuff
  281. < .\" -----------------------------------------------------------------
  282. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. < .\" http://bugs.debian.org/507673
  284. < .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  285. < .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286. < .ie \n(.g .ds Aq \(aq
  287. < .el       .ds Aq '
  288. ---
  289. > .TH "ANSIBLE" "1" "01/03/2014" "Ansible 1\&.5" "System administration commands"
  290. 106c97
  291. < Extensive documentation is available in the documentation site: http://docs\&.ansible\&.com\&. IRC and mailing list info can be found in file CONTRIBUTING\&.md, available in: https://github\&.com/ansible/ansible
  292. ---
  293. > Extensive documentation as well as IRC and mailing list info is available on the ansible home page: https://ansible\&.github\&.com/
  294. diff -r ansible/ansible/docs/man/man1/ansible-vault.1 ansible-1.6.6/docs/man/man1/ansible-vault.1
  295. 4,5c4,5
  296. < .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  297. < .\"      Date: 05/26/2014
  298. ---
  299. > .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
  300. > .\"      Date: 03/17/2014
  301. 7c7
  302. < .\"    Source: Ansible 1.7
  303. ---
  304. > .\"    Source: Ansible 1.6
  305. 10c10
  306. < .TH "ANSIBLE\-VAULT" "1" "05/26/2014" "Ansible 1\&.7" "System administration commands"
  307. ---
  308. > .TH "ANSIBLE\-VAULT" "1" "03/17/2014" "Ansible 1\&.6" "System administration commands"
  309. Only in ansible/ansible: docsite
  310. Only in ansible/ansible/examples: DOCUMENTATION.yml
  311. Only in ansible/ansible/examples: issues
  312. Only in ansible/ansible/examples: scripts
  313. Only in ansible/ansible: .git
  314. Only in ansible/ansible: .gitignore
  315. Only in ansible/ansible: hacking
  316. Only in ansible/ansible: legacy
  317. diff -r ansible/ansible/lib/ansible/callback_plugins/noop.py ansible-1.6.6/lib/ansible/callback_plugins/noop.py
  318. 43a44,46
  319. >     def runner_on_error(self, host, msg):
  320. >         pass
  321. >
  322. 89c92
  323. <     def playbook_on_play_start(self, name):
  324. ---
  325. >     def playbook_on_play_start(self, pattern):
  326. diff -r ansible/ansible/lib/ansible/callbacks.py ansible-1.6.6/lib/ansible/callbacks.py
  327. 345a346,348
  328. >     def on_error(self, host, msg):
  329. >         call_callback_module('runner_on_error', host, msg)
  330. >
  331. 403a407,410
  332. >     def on_error(self, host, err):
  333. >         display("err: [%s] => %s\n" % (host, err), stderr=True, runner=self.runner)
  334. >         super(CliRunnerCallbacks, self).on_error(host, err)
  335. >
  336. 529a537,548
  337. >     def on_error(self, host, err):
  338. >
  339. >         item = err.get('item', None)
  340. >         msg = ''
  341. >         if item:
  342. >             msg = "err: [%s] => (item=%s) => %s" % (host, item, err)
  343. >         else:
  344. >             msg = "err: [%s] => %s" % (host, err)
  345. >
  346. >         display(msg, color='red', stderr=True, runner=self.runner)
  347. >         super(PlaybookRunnerCallbacks, self).on_error(host, err)
  348. >
  349. 627c646
  350. <         if prompt and default is not None:
  351. ---
  352. >         if prompt and default:
  353. 635d653
  354. <             msg = prompt.encode(sys.stdout.encoding)
  355. 637,638c655,656
  356. <                 return getpass.getpass(msg)
  357. <             return raw_input(msg)
  358. ---
  359. >                 return getpass.getpass(prompt)
  360. >             return raw_input(prompt)
  361. 679,681c697,699
  362. <     def on_play_start(self, name):
  363. <         display(banner("PLAY [%s]" % name))
  364. <         call_callback_module('playbook_on_play_start', name)
  365. ---
  366. >     def on_play_start(self, pattern):
  367. >         display(banner("PLAY [%s]" % pattern))
  368. >         call_callback_module('playbook_on_play_start', pattern)
  369. diff -r ansible/ansible/lib/ansible/constants.py ansible-1.6.6/lib/ansible/constants.py
  370. 107c107
  371. < DEFAULT_ROLES_PATH        = shell_expand_path(get_config(p, DEFAULTS, 'roles_path',       'ANSIBLE_ROLES_PATH',       '/etc/ansible/roles'))
  372. ---
  373. > DEFAULT_ROLES_PATH        = get_config(p, DEFAULTS, 'roles_path',       'ANSIBLE_ROLES_PATH',       '/etc/ansible/roles')
  374. Only in ansible-1.6.6/lib/ansible: constants.pyc
  375. diff -r ansible/ansible/lib/ansible/__init__.py ansible-1.6.6/lib/ansible/__init__.py
  376. 17c17
  377. < __version__ = '1.7'
  378. ---
  379. > __version__ = '1.6.6'
  380. Only in ansible-1.6.6/lib/ansible: __init__.pyc
  381. diff -r ansible/ansible/lib/ansible/inventory/dir.py ansible-1.6.6/lib/ansible/inventory/dir.py
  382. 2d1
  383. < # (c) 2014, Serge van Ginderachter <[email protected]>
  384. 60,221c59,81
  385. <
  386. <             # retrieve all groups and hosts form the parser and add them to
  387. <             # self, don't look at group lists yet, to avoid
  388. <             # recursion trouble, but just make sure all objects exist in self
  389. <             newgroups = parser.groups.values()
  390. <             for group in newgroups:
  391. <                 for host in group.hosts:
  392. <                     self._add_host(host)
  393. <             for group in newgroups:
  394. <                 self._add_group(group)
  395. <
  396. <             # now check the objects lists so they contain only objects from
  397. <             # self; membership data in groups is already fine (except all &
  398. <             # ungrouped, see later), but might still reference objects not in self
  399. <             for group in self.groups.values():
  400. <                 # iterate on a copy of the lists, as those lists get changed in
  401. <                 # the loop
  402. <                 # list with group's child group objects:
  403. <                 for child in group.child_groups[:]:
  404. <                     if child != self.groups[child.name]:
  405. <                         group.child_groups.remove(child)
  406. <                         group.child_groups.append(self.groups[child.name])
  407. <                 # list with group's parent group objects:
  408. <                 for parent in group.parent_groups[:]:
  409. <                     if parent != self.groups[parent.name]:
  410. <                         group.parent_groups.remove(parent)
  411. <                         group.parent_groups.append(self.groups[parent.name])
  412. <                 # list with group's host objects:
  413. <                 for host in group.hosts[:]:
  414. <                     if host != self.hosts[host.name]:
  415. <                         group.hosts.remove(host)
  416. <                         group.hosts.append(self.hosts[host.name])
  417. <                     # also check here that the group that contains host, is
  418. <                     # also contained in the host's group list
  419. <                     if group not in self.hosts[host.name].groups:
  420. <                         self.hosts[host.name].groups.append(group)
  421. <
  422. <         # extra checks on special groups all and ungrouped
  423. <         # remove hosts from 'ungrouped' if they became member of other groups
  424. <         if 'ungrouped' in self.groups:
  425. <             ungrouped = self.groups['ungrouped']
  426. <             # loop on a copy of ungrouped hosts, as we want to change that list
  427. <             for host in ungrouped.hosts[:]:
  428. <                 if len(host.groups) > 1:
  429. <                     host.groups.remove(ungrouped)
  430. <                     ungrouped.hosts.remove(host)
  431. <
  432. <         # remove hosts from 'all' if they became member of other groups
  433. <         # all should only contain direct children, not grandchildren
  434. <         # direct children should have dept == 1
  435. <         if 'all' in self.groups:
  436. <             allgroup = self.groups['all' ]
  437. <             # loop on a copy of all's  child groups, as we want to change that list
  438. <             for group in allgroup.child_groups[:]:
  439. <                 # groups might once have beeen added to all, and later be added
  440. <                 # to another group: we need to remove the link wit all then
  441. <                 if len(group.parent_groups) > 1:
  442. <                     # real children of all have just 1 parent, all
  443. <                     # this one has more, so not a direct child of all anymore
  444. <                     group.parent_groups.remove(allgroup)
  445. <                     allgroup.child_groups.remove(group)
  446. <                 elif allgroup not in group.parent_groups:
  447. <                     # this group was once added to all, but doesn't list it as
  448. <                     # a parent any more; the info in the group is the correct
  449. <                     # info
  450. <                     allgroup.child_groups.remove(group)
  451. <
  452. <
  453. <     def _add_group(self, group):
  454. <         """ Merge an existing group or add a new one;
  455. <             Track parent and child groups, and hosts of the new one """
  456. <
  457. <         if group.name not in self.groups:
  458. <             # it's brand new, add him!
  459. <             self.groups[group.name] = group
  460. <         if self.groups[group.name] != group:
  461. <             # different object, merge
  462. <             self._merge_groups(self.groups[group.name], group)
  463. <
  464. <     def _add_host(self, host):
  465. <         if host.name not in self.hosts:
  466. <             # Papa's got a brand new host
  467. <             self.hosts[host.name] = host
  468. <         if self.hosts[host.name] != host:
  469. <             # different object, merge
  470. <             self._merge_hosts(self.hosts[host.name], host)
  471. <
  472. <     def _merge_groups(self, group, newgroup):
  473. <         """ Merge all of instance newgroup into group,
  474. <             update parent/child relationships
  475. <             group lists may still contain group objects that exist in self with
  476. <             same name, but was instanciated as a different object in some other
  477. <             inventory parser; these are handled later """
  478. <
  479. <         # name
  480. <         if group.name != newgroup.name:
  481. <             raise errors.AnsibleError("Cannot merge group %s with %s" % (group.name, newgroup.name))
  482. <
  483. <         # depth
  484. <         group.depth = max([group.depth, newgroup.depth])
  485. <
  486. <         # hosts list (host objects are by now already added to self.hosts)
  487. <         for host in newgroup.hosts:
  488. <             grouphosts = dict([(h.name, h) for h in group.hosts])
  489. <             if host.name in grouphosts:
  490. <                 # same host name but different object, merge
  491. <                 self._merge_hosts(grouphosts[host.name], host)
  492. <             else:
  493. <                 # new membership, add host to group from self
  494. <                 # group from self will also be added again to host.groups, but
  495. <                 # as different object
  496. <                 group.add_host(self.hosts[host.name])
  497. <                 # now remove this the old object for group in host.groups
  498. <                 for hostgroup in [g for g in host.groups]:
  499. <                     if hostgroup.name == group.name and hostgroup != self.groups[group.name]:
  500. <                         self.hosts[host.name].groups.remove(hostgroup)
  501. <
  502. <
  503. <         # group child membership relation
  504. <         for newchild in newgroup.child_groups:
  505. <             # dict with existing child groups:
  506. <             childgroups = dict([(g.name, g) for g in group.child_groups])
  507. <             # check if child of new group is already known as a child
  508. <             if newchild.name not in childgroups:
  509. <                 self.groups[group.name].add_child_group(newchild)
  510. <
  511. <         # group parent membership relation
  512. <         for newparent in newgroup.parent_groups:
  513. <             # dict with existing parent groups:
  514. <             parentgroups = dict([(g.name, g) for g in group.parent_groups])
  515. <             # check if parent of new group is already known as a parent
  516. <             if newparent.name not in parentgroups:
  517. <                 if newparent.name not in self.groups:
  518. <                     # group does not exist yet in self, import him
  519. <                     self.groups[newparent.name] = newparent
  520. <                 # group now exists but not yet as a parent here
  521. <                 self.groups[newparent.name].add_child_group(group)
  522. <
  523. <         # variables
  524. <         group.vars = utils.combine_vars(group.vars, newgroup.vars)
  525. <
  526. <     def _merge_hosts(self,host, newhost):
  527. <         """ Merge all of instance newhost into host """
  528. <
  529. <         # name
  530. <         if host.name != newhost.name:
  531. <             raise errors.AnsibleError("Cannot merge host %s with %s" % (host.name, newhost.name))
  532. <
  533. <         # group membership relation
  534. <         for newgroup in newhost.groups:
  535. <             # dict with existing groups:
  536. <             hostgroups = dict([(g.name, g) for g in host.groups])
  537. <             # check if new group is already known as a group
  538. <             if newgroup.name not in hostgroups:
  539. <                 if newgroup.name not in self.groups:
  540. <                     # group does not exist yet in self, import him
  541. <                     self.groups[newgroup.name] = newgroup
  542. <                 # group now exists but doesn't have host yet
  543. <                 self.groups[newgroup.name].add_host(host)
  544. <
  545. <         # variables
  546. <         host.vars = utils.combine_vars(host.vars, newhost.vars)
  547. ---
  548. >             # This takes a lot of code because we can't directly use any of the objects, as they have to blend
  549. >             for name, group in parser.groups.iteritems():
  550. >                 if name not in self.groups:
  551. >                     self.groups[name] = group
  552. >                 else:
  553. >                     # group is already there, copy variables
  554. >                     # note: depth numbers on duplicates may be bogus
  555. >                     for k, v in group.get_variables().iteritems():
  556. >                         self.groups[name].set_variable(k, v)
  557. >                 for host in group.get_hosts():
  558. >                     if host.name not in self.hosts:
  559. >                         self.hosts[host.name] = host
  560. >                     else:
  561. >                         # host is already there, copy variables
  562. >                         # note: depth numbers on duplicates may be bogus
  563. >                         for k, v in host.vars.iteritems():
  564. >                             self.hosts[host.name].set_variable(k, v)
  565. >                     self.groups[name].add_host(self.hosts[host.name])
  566. >
  567. >             # This needs to be a second loop to ensure all the parent groups exist
  568. >             for name, group in parser.groups.iteritems():
  569. >                 for ancestor in group.get_ancestors():
  570. >                     self.groups[ancestor.name].add_child_group(self.groups[name])
  571. diff -r ansible/ansible/lib/ansible/inventory/group.py ansible-1.6.6/lib/ansible/inventory/group.py
  572. 31,32c31
  573. <         self._hosts_cache = None
  574. <         #self.clear_hosts_cache()
  575. ---
  576. >         self.clear_hosts_cache()
  577. 44,45d42
  578. <
  579. <             # update the depth of the child
  580. 47,55c44
  581. <
  582. <             # update the depth of the grandchildren
  583. <             group._check_children_depth()
  584. <
  585. <             # now add self to child's parent_groups list, but only if there
  586. <             # isn't already a group with the same name
  587. <             if not self.name in [g.name for g in group.parent_groups]:
  588. <                 group.parent_groups.append(self)
  589. <
  590. ---
  591. >             group.parent_groups.append(self)
  592. 57,62d45
  593. <
  594. <     def _check_children_depth(self):
  595. <
  596. <         for group in self.child_groups:
  597. <             group.depth = max([self.depth+1, group.depth])
  598. <             group._check_children_depth()
  599. diff -r ansible/ansible/lib/ansible/inventory/ini.py ansible-1.6.6/lib/ansible/inventory/ini.py
  600. 48d47
  601. <         self._add_allgroup_children()
  602. 73,79d71
  603. <     def _add_allgroup_children(self):
  604. <
  605. <         for group in self.groups.values():
  606. <             if group.depth == 0 and group.name != 'all':
  607. <                 self.groups['all'].add_child_group(group)
  608. <
  609. <
  610. 97a90
  611. >                         all.add_child_group(new_group)
  612. 100a94
  613. >                     all.add_child_group(new_group)
  614. diff -r ansible/ansible/lib/ansible/inventory/__init__.py ansible-1.6.6/lib/ansible/inventory/__init__.py
  615. 18a19
  616. >
  617. 41c42
  618. <                   '_pattern_cache', '_vault_password', '_vars_plugins', '_playbook_basedir']
  619. ---
  620. >                   '_pattern_cache', '_vars_plugins', '_playbook_basedir']
  621. 43c44
  622. <     def __init__(self, host_list=C.DEFAULT_HOST_LIST, vault_password=None):
  623. ---
  624. >     def __init__(self, host_list=C.DEFAULT_HOST_LIST):
  625. 48d48
  626. <         self._vault_password=vault_password
  627. 59c59
  628. <         # to be set by calling set_playbook_basedir by playbook code
  629. ---
  630. >         # to be set by calling set_playbook_basedir by ansible-playbook
  631. 143,150d142
  632. <         # get group vars from group_vars/ files and vars plugins
  633. <         for group in self.groups:
  634. <             group.vars = utils.combine_vars(group.vars, self.get_group_variables(group.name, self._vault_password))
  635. <
  636. <         # get host vars from host_vars/ files and vars plugins
  637. <         for host in self.get_hosts():
  638. <             host.vars = utils.combine_vars(host.vars, self.get_variables(host.name, self._vault_password))
  639. <
  640. 158,168d149
  641. <     def _match_list(self, items, item_attr, pattern_str):
  642. <         results = []
  643. <         if not pattern_str.startswith('~'):
  644. <             pattern = re.compile(fnmatch.translate(pattern_str))
  645. <         else:
  646. <             pattern = re.compile(pattern_str[1:])
  647. <         for item in items:
  648. <             if pattern.search(getattr(item, item_attr)):
  649. <                 results.append(item)
  650. <         return results
  651. <
  652. 209c190
  653. <             elif p:
  654. ---
  655. >             else:
  656. 224,226c205,209
  657. <             # avoid resolving a pattern that is a plain host
  658. <             if p in self._hosts_cache:
  659. <                 hosts.append(self.get_host(p))
  660. ---
  661. >             that = self.__get_hosts(p)
  662. >             if p.startswith("!"):
  663. >                 hosts = [ h for h in hosts if h not in that ]
  664. >             elif p.startswith("&"):
  665. >                 hosts = [ h for h in hosts if h in that ]
  666. 228,235c211,213
  667. <                 that = self.__get_hosts(p)
  668. <                 if p.startswith("!"):
  669. <                     hosts = [ h for h in hosts if h not in that ]
  670. <                 elif p.startswith("&"):
  671. <                     hosts = [ h for h in hosts if h in that ]
  672. <                 else:
  673. <                     to_append = [ h for h in that if h.name not in [ y.name for y in hosts ] ]
  674. <                     hosts.extend(to_append)
  675. ---
  676. >                 to_append = [ h for h in that if h.name not in [ y.name for y in hosts ] ]
  677. >                 hosts.extend(to_append)
  678. >        
  679. 260,263d237
  680. <         # Do not parse regexes for enumeration info
  681. <         if pattern.startswith('~'):
  682. <             return (pattern, None)
  683. <
  684. 326d299
  685. <         results = []
  686. 333,337c306
  687. <         def __append_host_to_results(host):
  688. <             if host not in results and host.name not in hostnames:
  689. <                 hostnames.add(host.name)
  690. <                 results.append(host)
  691. <
  692. ---
  693. >         results = []
  694. 340,350c309,313
  695. <             if pattern == 'all':
  696. <                 for host in group.get_hosts():
  697. <                     __append_host_to_results(host)
  698. <             else:
  699. <                 if self._match(group.name, pattern):
  700. <                     for host in group.get_hosts():
  701. <                         __append_host_to_results(host)
  702. <                 else:
  703. <                     matching_hosts = self._match_list(group.get_hosts(), 'name', pattern)
  704. <                     for host in matching_hosts:
  705. <                         __append_host_to_results(host)
  706. ---
  707. >             for host in group.get_hosts():
  708. >                 if pattern == 'all' or self._match(group.name, pattern) or self._match(host.name, pattern):
  709. >                     if host not in results and host.name not in hostnames:
  710. >                         results.append(host)
  711. >                         hostnames.add(host.name)
  712. 362,365c325,332
  713. <         if host in self._hosts_cache:
  714. <             return self._hosts_cache[host].get_groups()
  715. <         else:
  716. <             return []
  717. ---
  718. >         results = []
  719. >         groups = self.get_groups()
  720. >         for group in groups:
  721. >             for hostn in group.get_hosts():
  722. >                 if host == hostn.name:
  723. >                     results.append(group)
  724. >                     continue
  725. >         return results
  726. 406,408c373,375
  727. <     def get_group_variables(self, groupname, update_cached=False, vault_password=None):
  728. <         if groupname not in self._vars_per_group or update_cached:
  729. <             self._vars_per_group[groupname] = self._get_group_variables(groupname, vault_password=vault_password)
  730. ---
  731. >     def get_group_variables(self, groupname):
  732. >         if groupname not in self._vars_per_group:
  733. >             self._vars_per_group[groupname] = self._get_group_variables(groupname)
  734. 411,412c378
  735. <     def _get_group_variables(self, groupname, vault_password=None):
  736. <
  737. ---
  738. >     def _get_group_variables(self, groupname):
  739. 415a382
  740. >         return group.get_variables()
  741. 417,434c384,385
  742. <         vars = {}
  743. <
  744. <         # plugin.get_group_vars retrieves just vars for specific group
  745. <         vars_results = [ plugin.get_group_vars(group, vault_password=vault_password) for plugin in self._vars_plugins if hasattr(plugin, 'get_group_vars')]
  746. <         for updated in vars_results:
  747. <             if updated is not None:
  748. <                 vars = utils.combine_vars(vars, updated)
  749. <
  750. <         # get group variables set by Inventory Parsers
  751. <         vars = utils.combine_vars(vars, group.get_variables())
  752. <
  753. <         # Read group_vars/ files
  754. <         vars = utils.combine_vars(vars, self.get_group_vars(group))
  755. <
  756. <         return vars
  757. <
  758. <     def get_variables(self, hostname, update_cached=False, vault_password=None):
  759. <         if hostname not in self._vars_per_host or update_cached:
  760. ---
  761. >     def get_variables(self, hostname, vault_password=None):
  762. >         if hostname not in self._vars_per_host:
  763. 445,447c396
  764. <
  765. <         # plugin.run retrieves all vars (also from groups) for host
  766. <         vars_results = [ plugin.run(host, vault_password=vault_password) for plugin in self._vars_plugins if hasattr(plugin, 'run')]
  767. ---
  768. >         vars_results = [ plugin.run(host, vault_password=vault_password) for plugin in self._vars_plugins ]
  769. 452,458d400
  770. <         # plugin.get_host_vars retrieves just vars for specific host
  771. <         vars_results = [ plugin.get_host_vars(host, vault_password=vault_password) for plugin in self._vars_plugins if hasattr(plugin, 'get_host_vars')]
  772. <         for updated in vars_results:
  773. <             if updated is not None:
  774. <                 vars = utils.combine_vars(vars, updated)
  775. <
  776. <         # get host variables set by Inventory Parsers
  777. 460,463d401
  778. <
  779. <         # still need to check InventoryParser per host vars
  780. <         # which actually means InventoryScript per host,
  781. <         # which is not performant
  782. 466,469d403
  783. <
  784. <         # Read host_vars/ files
  785. <         vars = utils.combine_vars(vars, self.get_host_vars(host))
  786. <
  787. 473,477c407,408
  788. <         if group.name not in self.groups_list():
  789. <             self.groups.append(group)
  790. <             self._groups_list = None  # invalidate internal cache
  791. <         else:
  792. <             raise errors.AnsibleError("group already in inventory: %s" % group.name)
  793. ---
  794. >         self.groups.append(group)
  795. >         self._groups_list = None  # invalidate internal cache
  796. 571a503,505
  797. >         """
  798. >         sets the base directory of the playbook so inventory plugins can use it to find
  799. >         variable files and other things.
  800. 573,612c507
  801. <         sets the base directory of the playbook so inventory can use it as a
  802. <         basedir for host_ and group_vars, and other things.
  803. <         """
  804. <         # Only update things if dir is a different playbook basedir
  805. <         if dir != self._playbook_basedir:
  806. <             self._playbook_basedir = dir
  807. <             # get group vars from group_vars/ files
  808. <             for group in self.groups:
  809. <                 group.vars = utils.combine_vars(group.vars, self.get_group_vars(group, new_pb_basedir=True))
  810. <             # get host vars from host_vars/ files
  811. <             for host in self.get_hosts():
  812. <                 host.vars = utils.combine_vars(host.vars, self.get_host_vars(host, new_pb_basedir=True))
  813. <
  814. <     def get_host_vars(self, host, new_pb_basedir=False):
  815. <         """ Read host_vars/ files """
  816. <         return self._get_hostgroup_vars(host=host, group=None, new_pb_basedir=False)
  817. <
  818. <     def get_group_vars(self, group, new_pb_basedir=False):
  819. <         """ Read group_vars/ files """
  820. <         return self._get_hostgroup_vars(host=None, group=group, new_pb_basedir=False)
  821. <
  822. <     def _get_hostgroup_vars(self, host=None, group=None, new_pb_basedir=False):
  823. <         """
  824. <         Loads variables from group_vars/<groupname> and host_vars/<hostname> in directories parallel
  825. <         to the inventory base directory or in the same directory as the playbook.  Variables in the playbook
  826. <         dir will win over the inventory dir if files are in both.
  827. <         """
  828. <
  829. <         results = {}
  830. <         scan_pass = 0
  831. <         _basedir = self.basedir()
  832. <
  833. <         # look in both the inventory base directory and the playbook base directory
  834. <         # unless we do an update for a new playbook base dir
  835. <         if not new_pb_basedir:
  836. <             basedirs = [_basedir, self._playbook_basedir]
  837. <         else:
  838. <             basedirs = [self._playbook_basedir]
  839. <
  840. <         for basedir in basedirs:
  841. ---
  842. >         self._playbook_basedir = dir
  843. 614,640d508
  844. <             # this can happen from particular API usages, particularly if not run
  845. <             # from /usr/bin/ansible-playbook
  846. <             if basedir is None:
  847. <                 continue
  848. <
  849. <             scan_pass = scan_pass + 1
  850. <
  851. <             # it's not an eror if the directory does not exist, keep moving
  852. <             if not os.path.exists(basedir):
  853. <                 continue
  854. <
  855. <             # save work of second scan if the directories are the same
  856. <             if _basedir == self._playbook_basedir and scan_pass != 1:
  857. <                 continue
  858. <
  859. <             if group and host is None:
  860. <                 # load vars in dir/group_vars/name_of_group
  861. <                 base_path = os.path.join(basedir, "group_vars/%s" % group.name)
  862. <                 results = utils.load_vars(base_path, results, vault_password=self._vault_password)
  863. <
  864. <             elif host and group is None:
  865. <                 # same for hostvars in dir/host_vars/name_of_host
  866. <                 base_path = os.path.join(basedir, "host_vars/%s" % host.name)
  867. <                 results = utils.load_vars(base_path, results, vault_password=self._vault_password)
  868. <
  869. <         # all done, results is a dictionary of variables for this particular host.
  870. <         return results
  871. diff -r ansible/ansible/lib/ansible/inventory/script.py ansible-1.6.6/lib/ansible/inventory/script.py
  872. 49d48
  873. <
  874. 53,56c52
  875. <
  876. <         # not passing from_remote because data from CMDB is trusted
  877. <         self.raw  = utils.parse_json(self.data)
  878. <
  879. ---
  880. >         self.raw  = utils.parse_json(self.data, from_remote=True)
  881. 67c63
  882. <
  883. ---
  884. >  
  885. 103a100,101
  886. >             if group.name != all.name:
  887. >                 all.add_child_group(group)
  888. 113,117d110
  889. <
  890. <         for group in groups.values():
  891. <             if group.depth == 0 and group.name != 'all':
  892. <                 all.add_child_group(group)
  893. <
  894. Only in ansible-1.6.6/lib/ansible/inventory/vars_plugins: group_vars.py
  895. Only in ansible/ansible/lib/ansible/inventory/vars_plugins: noop.py
  896. diff -r ansible/ansible/lib/ansible/module_common.py ansible-1.6.6/lib/ansible/module_common.py
  897. 32d31
  898. < REPLACER_WINDOWS = "# POWERSHELL_COMMON"
  899. 50c49,51
  900. <        ... will result in the insertion basic.py into the module
  901. ---
  902. >     will result in a template evaluation of
  903. >
  904. >     {{ include 'basic.py' }}
  905. 56,60d56
  906. <
  907. <     # POWERSHELL_COMMON
  908. <
  909. <     Also results in the inclusion of the common code in powershell.ps1
  910. <
  911. 104,107d99
  912. <             if REPLACER_WINDOWS in line:
  913. <                 ps_data = self.slurp(os.path.join(self.snippet_path, "powershell.ps1"))
  914. <                 output.write(ps_data)
  915. <                 snippet_names.append('powershell')
  916. 127,134c119,120
  917. <         if not module_path.endswith(".ps1"):
  918. <             # Unixy modules
  919. <             if len(snippet_names) > 0 and not 'basic' in snippet_names:
  920. <                 raise errors.AnsibleError("missing required import in %s: from ansible.module_utils.basic import *" % module_path)
  921. <         else:
  922. <             # Windows modules
  923. <             if len(snippet_names) > 0 and not 'powershell' in snippet_names:
  924. <                 raise errors.AnsibleError("missing required import in %s: # POWERSHELL_COMMON" % module_path)
  925. ---
  926. >         if len(snippet_names) > 0 and not 'basic' in snippet_names:
  927. >             raise errors.AnsibleError("missing required import in %s: from ansible.module_utils.basic import *" % module_path)
  928. diff -r ansible/ansible/lib/ansible/module_utils/basic.py ansible-1.6.6/lib/ansible/module_utils/basic.py
  929. 104,141d103
  930. < try:
  931. <     from ast import literal_eval as _literal_eval
  932. < except ImportError:
  933. <     # a replacement for literal_eval that works with python 2.4. from:
  934. <     # https://mail.python.org/pipermail/python-list/2009-September/551880.html
  935. <     # which is essentially a cut/past from an earlier (2.6) version of python's
  936. <     # ast.py
  937. <     from compiler import parse
  938. <     from compiler.ast import *
  939. <     def _literal_eval(node_or_string):
  940. <         """
  941. <         Safely evaluate an expression node or a string containing a Python
  942. <         expression.  The string or node provided may only consist of the  following
  943. <         Python literal structures: strings, numbers, tuples, lists, dicts,  booleans,
  944. <         and None.
  945. <         """
  946. <         _safe_names = {'None': None, 'True': True, 'False': False}
  947. <         if isinstance(node_or_string, basestring):
  948. <             node_or_string = parse(node_or_string, mode='eval')
  949. <         if isinstance(node_or_string, Expression):
  950. <             node_or_string = node_or_string.node
  951. <         def _convert(node):
  952. <             if isinstance(node, Const) and isinstance(node.value, (basestring, int, float, long, complex)):
  953. <                  return node.value
  954. <             elif isinstance(node, Tuple):
  955. <                 return tuple(map(_convert, node.nodes))
  956. <             elif isinstance(node, List):
  957. <                 return list(map(_convert, node.nodes))
  958. <             elif isinstance(node, Dict):
  959. <                 return dict((_convert(k), _convert(v)) for k, v in node.items)
  960. <             elif isinstance(node, Name):
  961. <                 if node.name in _safe_names:
  962. <                     return _safe_names[node.name]
  963. <             elif isinstance(node, UnarySub):
  964. <                 return -_convert(node.expr)
  965. <             raise ValueError('malformed string')
  966. <         return _convert(node_or_string)
  967. <
  968. 183,194d144
  969. < def get_distribution_version():
  970. <     ''' return the distribution version '''
  971. <     if platform.system() == 'Linux':
  972. <         try:
  973. <             distribution_version = platform.linux_distribution()[1]
  974. <         except:
  975. <             # FIXME: MethodMissing, I assume?
  976. <             distribution_version = platform.dist()[1]
  977. <     else:
  978. <         distribution_version = None
  979. <     return distribution_version
  980. <
  981. 739,770d688
  982. <     def safe_eval(self, str, locals=None, include_exceptions=False):
  983. <
  984. <         # do not allow method calls to modules
  985. <         if not isinstance(str, basestring):
  986. <             # already templated to a datastructure, perhaps?
  987. <             if include_exceptions:
  988. <                 return (str, None)
  989. <             return str
  990. <         if re.search(r'\w\.\w+\(', str):
  991. <             if include_exceptions:
  992. <                 return (str, None)
  993. <             return str
  994. <         # do not allow imports
  995. <         if re.search(r'import \w+', str):
  996. <             if include_exceptions:
  997. <                 return (str, None)
  998. <             return str
  999. <         try:
  1000. <             result = None
  1001. <             if not locals:
  1002. <                 result = _literal_eval(str)
  1003. <             else:
  1004. <                 result = _literal_eval(str, None, locals)
  1005. <             if include_exceptions:
  1006. <                 return (result, None)
  1007. <             else:
  1008. <                 return result
  1009. <         except Exception, e:
  1010. <             if include_exceptions:
  1011. <                 return (str, e)
  1012. <             return str
  1013. <
  1014. 1222d1139
  1015. <             r'^(?P<before>.*:)(?P<password>.*)(?P<after>\@.*)$',
  1016. diff -r ansible/ansible/lib/ansible/module_utils/facts.py ansible-1.6.6/lib/ansible/module_utils/facts.py
  1017. 112,113d111
  1018. <                  { 'path' : '/usr/sbin/pkgadd',     'name' : 'svr4pkg' },
  1019. <                  { 'path' : '/usr/bin/pkg',         'name' : 'pkg' },
  1020. 269c267
  1021. <                 if os.path.exists(path) and os.path.getsize(path) > 0:
  1022. ---
  1023. >                 if os.path.exists(path):
  1024. 742,744c740
  1025. <                     part['sectorsize'] = get_file_content(part_sysdir + "/queue/physical_block_size")
  1026. <                     if not part['sectorsize']:
  1027. <                         part['sectorsize'] = get_file_content(part_sysdir + "/queue/hw_sector_size",512)
  1028. ---
  1029. >                     part['sectorsize'] = get_file_content(part_sysdir + "/queue/hw_sector_size",512)
  1030. 759c755
  1031. <             d['sectorsize'] = get_file_content(sysdir + "/queue/physical_block_size")
  1032. ---
  1033. >             d['sectorsize'] = get_file_content(sysdir + "/queue/hw_sector_size")
  1034. 761c757
  1035. <                 d['sectorsize'] = get_file_content(sysdir + "/queue/hw_sector_size",512)
  1036. ---
  1037. >                 d['sectorsize'] = 512
  1038. 1299,1310c1295,1297
  1039. <             try:
  1040. <                 rc, out, err = module.run_command("grep Physical /var/adm/syslog/syslog.log")
  1041. <                 data = re.search('.*Physical: ([0-9]*) Kbytes.*',out).groups()[0].strip()
  1042. <                 self.facts['memtotal_mb'] = int(data) / 1024
  1043. <             except AttributeError:
  1044. <                 #For systems where memory details aren't sent to syslog or the log has rotated, use parsed
  1045. <                 #adb output. Unfortunatley /dev/kmem doesn't have world-read, so this only works as root.
  1046. <                 if os.access("/dev/kmem", os.R_OK):
  1047. <                     rc, out, err = module.run_command("echo 'phys_mem_pages/D' | adb -k /stand/vmunix /dev/kmem | tail -1 | awk '{print $2}'", use_unsafe_shell=True)
  1048. <                     if not err:
  1049. <                       data = out
  1050. <                       self.facts['memtotal_mb'] = int(data) / 256
  1051. ---
  1052. >             rc, out, err = module.run_command("grep Physical /var/adm/syslog/syslog.log")
  1053. >             data = re.search('.*Physical: ([0-9]*) Kbytes.*',out).groups()[0].strip()
  1054. >             self.facts['memtotal_mb'] = int(data) / 1024
  1055. 1327,1329d1313
  1056. <             separator = ':'
  1057. <             if self.facts['distribution_version'] == "B.11.23":
  1058. <                 separator = '='
  1059. 1331c1315
  1060. <             self.facts['firmware_version'] = out.split(separator)[1].strip()
  1061. ---
  1062. >             self.facts['firmware_version'] = out.split(':')[1].strip()
  1063. diff -r ansible/ansible/lib/ansible/module_utils/known_hosts.py ansible-1.6.6/lib/ansible/module_utils/known_hosts.py
  1064. 30,36c30
  1065. < import urlparse
  1066. <
  1067. < try:
  1068. <     from hashlib import sha1
  1069. < except ImportError:
  1070. <     import sha as sha1
  1071. <
  1072. ---
  1073. > from hashlib import sha1
  1074. 53c47
  1075. <                 module.fail_json(msg="%s has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module" % fqdn)
  1076. ---
  1077. >                 module.fail_json(msg="%s has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module" % fqdn)                    
  1078. 60,61c54
  1079. <     if "@" in repo_url and "://" not in repo_url:
  1080. <         # most likely a git@ or ssh+git@ type URL
  1081. ---
  1082. >     if "@" in repo_url and not repo_url.startswith("http"):
  1083. 69,80d61
  1084. <     elif "://" in repo_url:
  1085. <         # this should be something we can parse with urlparse
  1086. <         parts = urlparse.urlparse(repo_url)
  1087. <         if 'ssh' not in parts[0] and 'git' not in parts[0]:
  1088. <             # don't try and scan a hostname that's not ssh
  1089. <             return None
  1090. <         if parts[1] != '':
  1091. <             result = parts[1]
  1092. <             if ":" in result:
  1093. <                 result = result.split(":")[0]
  1094. <         if "@" in result:
  1095. <             result = result.split("@", 1)[1]
  1096. Only in ansible/ansible/lib/ansible/module_utils: powershell.ps1
  1097. diff -r ansible/ansible/lib/ansible/playbook/__init__.py ansible-1.6.6/lib/ansible/playbook/__init__.py
  1098. 167,170d166
  1099. <
  1100. <         # let inventory know the playbook basedir so it can load more vars
  1101. <         self.inventory.set_playbook_basedir(self.basedir)
  1102. <
  1103. 329,331c325,326
  1104. <
  1105. <         ansible.callbacks.set_play(self.callbacks, None)
  1106. <         ansible.callbacks.set_play(self.runner_callbacks, None)
  1107. ---
  1108. >             ansible.callbacks.set_play(self.callbacks, None)
  1109. >             ansible.callbacks.set_play(self.runner_callbacks, None)
  1110. diff -r ansible/ansible/lib/ansible/playbook/play.py ansible-1.6.6/lib/ansible/playbook/play.py
  1111. 47c47
  1112. <        'any_errors_fatal', 'roles', 'role_names', 'pre_tasks', 'post_tasks', 'max_fail_percentage',
  1113. ---
  1114. >        'any_errors_fatal', 'roles', 'pre_tasks', 'post_tasks', 'max_fail_percentage',
  1115. 334a335
  1116. >
  1117. diff -r ansible/ansible/lib/ansible/runner/action_plugins/assemble.py ansible-1.6.6/lib/ansible/runner/action_plugins/assemble.py
  1118. 122c122
  1119. <                 self.runner._remote_chmod(conn, 'a+r', xfered, tmp)
  1120. ---
  1121. >                 self.runner._low_level_exec_command(conn, "chmod a+r %s" % xfered, tmp)
  1122. diff -r ansible/ansible/lib/ansible/runner/action_plugins/assert.py ansible-1.6.6/lib/ansible/runner/action_plugins/assert.py
  1123. 41c41,42
  1124. <         msg = None
  1125. ---
  1126. >         msg = ''
  1127. >
  1128. 52,61c53,55
  1129. <             test_result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True)
  1130. <             if not test_result:
  1131. <                 result = dict(
  1132. <                    failed       = True,
  1133. <                    evaluated_to = test_result,
  1134. <                    assertion    = that,
  1135. <                 )
  1136. <                 if msg:
  1137. <                     result['msg'] = msg
  1138. <                 return ReturnData(conn=conn, result=result)
  1139. ---
  1140. >             result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True)
  1141. >             if not result:
  1142. >                 return ReturnData(conn=conn, result=dict(failed=True, assertion=that, evaluated_to=result))
  1143. 64d57
  1144. <
  1145. diff -r ansible/ansible/lib/ansible/runner/action_plugins/async.py ansible-1.6.6/lib/ansible/runner/action_plugins/async.py
  1146. 40c40
  1147. <         self.runner._remote_chmod(conn, 'a+rx', module_path, tmp)
  1148. ---
  1149. >         self.runner._low_level_exec_command(conn, "chmod a+rx %s" % module_path, tmp)
  1150. diff -r ansible/ansible/lib/ansible/runner/action_plugins/copy.py ansible-1.6.6/lib/ansible/runner/action_plugins/copy.py
  1151. 139,140c139,140
  1152. <             if not conn.shell.path_has_trailing_slash(dest):
  1153. <                 dest = conn.shell.join_path(dest, '')
  1154. ---
  1155. >             if not dest.endswith("/"):
  1156. >                 dest += "/"
  1157. 172,173c172,173
  1158. <             if conn.shell.path_has_trailing_slash(dest):
  1159. <                 dest_file = conn.shell.join_path(dest, source_rel)
  1160. ---
  1161. >             if dest.endswith("/"):
  1162. >                 dest_file = os.path.join(dest, source_rel)
  1163. 175c175
  1164. <                 dest_file = conn.shell.join_path(dest)
  1165. ---
  1166. >                 dest_file = dest
  1167. 189c189
  1168. <                     dest_file = conn.shell.join_path(dest, source_rel)
  1169. ---
  1170. >                     dest_file = os.path.join(dest, source_rel)
  1171. 231c231
  1172. <                     self.runner._remote_chmod(conn, 'a+r', tmp_src, tmp_path)
  1173. ---
  1174. >                     self.runner._low_level_exec_command(conn, "chmod a+r %s" % tmp_src, tmp_path)
  1175. diff -r ansible/ansible/lib/ansible/runner/action_plugins/fetch.py ansible-1.6.6/lib/ansible/runner/action_plugins/fetch.py
  1176. 60,64d59
  1177. <         source = conn.shell.join_path(source)
  1178. <         if os.path.sep not in conn.shell.join_path('a', ''):
  1179. <             source_local = source.replace('\\', '/')
  1180. <         else:
  1181. <             source_local = source
  1182. 70c65
  1183. <                 base = os.path.basename(source_local)
  1184. ---
  1185. >                 base = os.path.basename(source)
  1186. 77c72
  1187. <             dest = "%s/%s/%s" % (utils.path_dwim(self.runner.basedir, dest), conn.host, source_local)
  1188. ---
  1189. >             dest = "%s/%s/%s" % (utils.path_dwim(self.runner.basedir, dest), conn.host, source)
  1190. diff -r ansible/ansible/lib/ansible/runner/action_plugins/include_vars.py ansible-1.6.6/lib/ansible/runner/action_plugins/include_vars.py
  1191. 47c47
  1192. <             if data and type(data) != dict:
  1193. ---
  1194. >             if type(data) != dict:
  1195. 49,50d48
  1196. <             elif data is None:
  1197. <                 data = {}
  1198. diff -r ansible/ansible/lib/ansible/runner/action_plugins/pause.py ansible-1.6.6/lib/ansible/runner/action_plugins/pause.py
  1199. 104c104
  1200. <                 self.result['user_input'] = raw_input(self.prompt.encode(sys.stdout.encoding))
  1201. ---
  1202. >                 self.result['user_input'] = raw_input(self.prompt)
  1203. diff -r ansible/ansible/lib/ansible/runner/action_plugins/script.py ansible-1.6.6/lib/ansible/runner/action_plugins/script.py
  1204. 109c109
  1205. <         tmp_src = conn.shell.join_path(tmp, os.path.basename(source))
  1206. ---
  1207. >         tmp_src = os.path.join(tmp, os.path.basename(source))
  1208. 118c118
  1209. <             chmod_mode = 'a+rx'
  1210. ---
  1211. >             cmd_args_chmod = "chmod a+rx %s" % tmp_src
  1212. 121,122c121,122
  1213. <             chmod_mode = '+rx'
  1214. <         self.runner._remote_chmod(conn, chmod_mode, tmp_src, tmp, sudoable=sudoable, su=self.runner.su)
  1215. ---
  1216. >             cmd_args_chmod = "chmod +rx %s" % tmp_src
  1217. >         self.runner._low_level_exec_command(conn, cmd_args_chmod, tmp, sudoable=sudoable, su=self.runner.su)
  1218. 125,126c125,126
  1219. <         env_string = self.runner._compute_environment_string(conn, inject)
  1220. <         module_args = ' '.join([env_string, tmp_src, args])
  1221. ---
  1222. >         env_string = self.runner._compute_environment_string(inject)
  1223. >         module_args = env_string + tmp_src + ' ' + args
  1224. 133c133
  1225. <             self.runner._remove_tmp_path(conn, tmp)
  1226. ---
  1227. >             self.runner._low_level_exec_command(conn, 'rm -rf %s >/dev/null 2>&1' % tmp, tmp)
  1228. diff -r ansible/ansible/lib/ansible/runner/action_plugins/template.py ansible-1.6.6/lib/ansible/runner/action_plugins/template.py
  1229. 82c82
  1230. <         if dest.endswith("/"): # CCTODO: Fix path for Windows hosts.
  1231. ---
  1232. >         if dest.endswith("/"):
  1233. 90c90
  1234. <             result = dict(failed=True, msg=type(e).__name__ + ": " + str(e))
  1235. ---
  1236. >             result = dict(failed=True, msg=str(e))
  1237. 117c117
  1238. <                 self.runner._remote_chmod(conn, 'a+r', xfered, tmp)
  1239. ---
  1240. >                 self.runner._low_level_exec_command(conn, "chmod a+r %s" % xfered, tmp)
  1241. diff -r ansible/ansible/lib/ansible/runner/action_plugins/unarchive.py ansible-1.6.6/lib/ansible/runner/action_plugins/unarchive.py
  1242. 57c57
  1243. <         dest = os.path.expanduser(dest) # CCTODO: Fix path for Windows hosts.
  1244. ---
  1245. >         dest = os.path.expanduser(dest)
  1246. 80c80
  1247. <                 self.runner._remote_chmod(conn, 'a+r', tmp_src, tmp)
  1248. ---
  1249. >                 self.runner._low_level_exec_command(conn, "chmod a+r %s" % tmp_src, tmp)
  1250. diff -r ansible/ansible/lib/ansible/runner/connection_plugins/libvirt_lxc.py ansible-1.6.6/lib/ansible/runner/connection_plugins/libvirt_lxc.py
  1251. 68c68
  1252. <     def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False, executable='/bin/sh', in_data=None, su=None, su_user=None):
  1253. ---
  1254. >     def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False, executable='/bin/sh'):
  1255. 70,75d69
  1256. <
  1257. <         if su or su_user:
  1258. <             raise errors.AnsibleError("Internal Error: this module does not support running commands via su")
  1259. <
  1260. <         if in_data:
  1261. <             raise errors.AnsibleError("Internal Error: this module does not support optimized module pipelining")
  1262. diff -r ansible/ansible/lib/ansible/runner/connection_plugins/local.py ansible-1.6.6/lib/ansible/runner/connection_plugins/local.py
  1263. 56c56
  1264. <                 local_cmd = executable.split() + ['-c', cmd]
  1265. ---
  1266. >                 local_cmd = [executable, '-c', cmd]
  1267. 61d60
  1268. <         executable = executable.split()[0] if executable else None
  1269. 65c64
  1270. <                              cwd=self.runner.basedir, executable=executable,
  1271. ---
  1272. >                              cwd=self.runner.basedir, executable=executable or None,
  1273. diff -r ansible/ansible/lib/ansible/runner/connection_plugins/paramiko_ssh.py ansible-1.6.6/lib/ansible/runner/connection_plugins/paramiko_ssh.py
  1274. 34d33
  1275. < import re
  1276. 189d187
  1277. <             self.ssh.get_transport().set_keepalive(5)
  1278. 215d212
  1279. <                 prompt_re = re.compile(prompt)
  1280. 221,225c218
  1281. <                     while True:
  1282. <                         if success_key in sudo_output or \
  1283. <                             (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \
  1284. <                             (self.runner.su_pass and prompt_re.match(sudo_output)):
  1285. <                             break
  1286. ---
  1287. >                     while not sudo_output.endswith(prompt) and success_key not in sudo_output:
  1288. diff -r ansible/ansible/lib/ansible/runner/connection_plugins/ssh.py ansible-1.6.6/lib/ansible/runner/connection_plugins/ssh.py
  1289. 20d19
  1290. < import re
  1291. 45c44
  1292. <         self.user = str(user)
  1293. ---
  1294. >         self.user = user
  1295. 87c86
  1296. <             self.common_args += ["-o", "IdentityFile=\"%s\"" % os.path.expanduser(self.private_key_file)]
  1297. ---
  1298. >             self.common_args += ["-o", "IdentityFile="+os.path.expanduser(self.private_key_file)]
  1299. 89c88
  1300. <             self.common_args += ["-o", "IdentityFile=\"%s\"" % os.path.expanduser(self.runner.private_key_file)]
  1301. ---
  1302. >             self.common_args += ["-o", "IdentityFile="+os.path.expanduser(self.runner.private_key_file)]
  1303. 97c96,97
  1304. <         self.common_args += ["-o", "User=" + (self.user or pwd.getpwuid(os.geteuid())[0])]
  1305. ---
  1306. >         if self.user != pwd.getpwuid(os.geteuid())[0]:
  1307. >             self.common_args += ["-o", "User="+self.user]
  1308. 160,169c160,164
  1309. <             if self.runner.sudo and sudoable:
  1310. <                 if self.runner.sudo_pass:
  1311. <                     incorrect_password = gettext.dgettext(
  1312. <                         "sudo", "Sorry, try again.")
  1313. <                     if stdout.endswith("%s\r\n%s" % (incorrect_password,
  1314. <                                                      prompt)):
  1315. <                         raise errors.AnsibleError('Incorrect sudo password')
  1316. <
  1317. <                 if stdout.endswith(prompt):
  1318. <                     raise errors.AnsibleError('Missing sudo password')
  1319. ---
  1320. >             if self.runner.sudo and sudoable and self.runner.sudo_pass:
  1321. >                 incorrect_password = gettext.dgettext(
  1322. >                     "sudo", "Sorry, try again.")
  1323. >                 if stdout.endswith("%s\r\n%s" % (incorrect_password, prompt)):
  1324. >                     raise errors.AnsibleError('Incorrect sudo password')
  1325. 222,230c217,219
  1326. <             try:
  1327. <                 host_fh = open(hf)
  1328. <             except IOError, e:
  1329. <                 hfiles_not_found += 1
  1330. <                 continue
  1331. <             else:
  1332. <                 data = host_fh.read()
  1333. <                 host_fh.close()
  1334. <                
  1335. ---
  1336. >             host_fh = open(hf)
  1337. >             data = host_fh.read()
  1338. >             host_fh.close()
  1339. 277d265
  1340. <             prompt_re = re.compile(prompt)
  1341. 318,323c306
  1342. <             while True:
  1343. <                 if success_key in sudo_output or \
  1344. <                     (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \
  1345. <                     (self.runner.su_pass and prompt_re.match(sudo_output)):
  1346. <                     break
  1347. <
  1348. ---
  1349. >             while not sudo_output.endswith(prompt) and success_key not in sudo_output:
  1350. Only in ansible/ansible/lib/ansible/runner/connection_plugins: winrm.py
  1351. diff -r ansible/ansible/lib/ansible/runner/connection.py ansible-1.6.6/lib/ansible/runner/connection.py
  1352. 22a23
  1353. > import ansible.constants as C
  1354. 24c25,28
  1355. < class Connector(object):
  1356. ---
  1357. > import os
  1358. > import os.path
  1359. >
  1360. > class Connection(object):
  1361. 30a35
  1362. >         conn = None
  1363. 35a41,42
  1364. >
  1365. >
  1366. diff -r ansible/ansible/lib/ansible/runner/filter_plugins/core.py ansible-1.6.6/lib/ansible/runner/filter_plugins/core.py
  1367. 31d30
  1368. < from jinja2.filters import environmentfilter
  1369. 136,139d134
  1370. <
  1371. <     if not isinstance(value, basestring):
  1372. <         value = str(value)
  1373. <
  1374. 189,190c184
  1375. < @environmentfilter
  1376. < def rand(environment, end, start=None, step=None):
  1377. ---
  1378. > def rand(end, start=None, step=None):
  1379. 229d222
  1380. <             'relpath': os.path.relpath,
  1381. diff -r ansible/ansible/lib/ansible/runner/__init__.py ansible-1.6.6/lib/ansible/runner/__init__.py
  1382. 170c170
  1383. <         self.connector        = connection.Connector(self)
  1384. ---
  1385. >         self.connector        = connection.Connection(self)
  1386. 278c278
  1387. <         remote = conn.shell.join_path(tmp, name)
  1388. ---
  1389. >         remote = os.path.join(tmp, name)
  1390. 287c287
  1391. <     def _compute_environment_string(self, conn, inject=None):
  1392. ---
  1393. >     def _compute_environment_string(self, inject=None):
  1394. 290c290,294
  1395. <         enviro = {}
  1396. ---
  1397. >         default_environment = dict(
  1398. >             LANG     = C.DEFAULT_MODULE_LANG,
  1399. >             LC_CTYPE = C.DEFAULT_MODULE_LANG,
  1400. >         )
  1401. >
  1402. 295a300
  1403. >             default_environment.update(enviro)
  1404. 297c302,305
  1405. <         return conn.shell.env_prefix(**enviro)
  1406. ---
  1407. >         result = ""
  1408. >         for (k,v) in default_environment.iteritems():
  1409. >             result = "%s=%s %s" % (k, pipes.quote(unicode(v)), result)
  1410. >         return result
  1411. 413c421
  1412. <         remote_module_path = conn.shell.join_path(tmp, module_name)
  1413. ---
  1414. >         remote_module_path = os.path.join(tmp, module_name)
  1415. 423c431
  1416. <         environment_string = self._compute_environment_string(conn, inject)
  1417. ---
  1418. >         environment_string = self._compute_environment_string(inject)
  1419. 427c435,436
  1420. <             self._remote_chmod(conn, 'a+r', remote_module_path, tmp)
  1421. ---
  1422. >             cmd_chmod = "chmod a+r %s" % remote_module_path
  1423. >             self._low_level_exec_command(conn, cmd_chmod, tmp, sudoable=False)
  1424. 455c464,465
  1425. <                 self._remote_chmod(conn, 'a+r', argsfile, tmp)
  1426. ---
  1427. >                 cmd_args_chmod = "chmod a+r %s" % argsfile
  1428. >                 self._low_level_exec_command(conn, cmd_args_chmod, tmp, sudoable=False)
  1429. 473c483,486
  1430. <         rm_tmp = None
  1431. ---
  1432. >
  1433. >         cmd = " ".join([environment_string.strip(), shebang.replace("#!","").strip(), cmd])
  1434. >         cmd = cmd.strip()
  1435. >
  1436. 477,480c490
  1437. <                 rm_tmp = tmp
  1438. <
  1439. <         cmd = conn.shell.build_module_command(environment_string, shebang, cmd, rm_tmp)
  1440. <         cmd = cmd.strip()
  1441. ---
  1442. >                 cmd = cmd + "; rm -rf %s >/dev/null 2>&1" % tmp
  1443. 497c507
  1444. <                 cmd2 = conn.shell.remove(tmp, recurse=True)
  1445. ---
  1446. >                 cmd2 = "rm -rf %s >/dev/null 2>&1" % tmp
  1447. 762c772,773
  1448. <         actual_port = inject.get('ansible_ssh_port', port)
  1449. ---
  1450. >         if actual_transport in [ 'paramiko', 'ssh', 'accelerate' ]:
  1451. >             actual_port = inject.get('ansible_ssh_port', port)
  1452. 803,814d813
  1453. <             default_shell = getattr(conn, 'default_shell', '')
  1454. <             shell_type = inject.get('ansible_shell_type')
  1455. <             if not shell_type:
  1456. <                 if default_shell:
  1457. <                     shell_type = default_shell
  1458. <                 else:
  1459. <                     shell_type = os.path.basename(C.DEFAULT_EXECUTABLE)
  1460. <
  1461. <             shell_plugin = utils.plugins.shell_loader.get(shell_type)
  1462. <             if shell_plugin is None:
  1463. <                 shell_plugin = utils.plugins.shell_loader.get('sh')
  1464. <             conn.shell = shell_plugin
  1465. 944,947d942
  1466. <         if not cmd:
  1467. <             # this can happen with powershell modules when there is no analog to a Windows command (like chmod)
  1468. <             return dict(stdout='', stderr='')
  1469. <
  1470. 955,959c950,959
  1471. <         # assume connection type is local if no user attribute
  1472. <         this_user = getattr(conn, 'user', getpass.getuser())
  1473. <         if (not su and this_user == sudo_user) or (su and this_user == su_user):
  1474. <             sudoable = False
  1475. <             su = False
  1476. ---
  1477. >         if hasattr(conn, 'user'):
  1478. >             if (not su and conn.user == sudo_user) or (su and conn.user == su_user):
  1479. >                 sudoable = False
  1480. >                 su = False
  1481. >         else:
  1482. >             # assume connection type is local if no user attribute
  1483. >             this_user = getpass.getuser()
  1484. >             if (not su and this_user == sudo_user) or (su and this_user == su_user):
  1485. >                 sudoable = False
  1486. >                 su = False
  1487. 993,999d992
  1488. <     def _remote_chmod(self, conn, mode, path, tmp, sudoable=False, su=False):
  1489. <         ''' issue a remote chmod command '''
  1490. <         cmd = conn.shell.chmod(mode, path)
  1491. <         return self._low_level_exec_command(conn, cmd, tmp, sudoable=sudoable, su=su)
  1492. <
  1493. <     # *****************************************************
  1494. <
  1495. 1002c995,1012
  1496. <         cmd = conn.shell.md5(path)
  1497. ---
  1498. >
  1499. >         path = pipes.quote(path)
  1500. >         # The following test needs to be SH-compliant.  BASH-isms will
  1501. >         # not work if /bin/sh points to a non-BASH shell.
  1502. >         test = "rc=0; [ -r \"%s\" ] || rc=2; [ -f \"%s\" ] || rc=1; [ -d \"%s\" ] && echo 3 && exit 0" % ((path,) * 3)
  1503. >         md5s = [
  1504. >             "(/usr/bin/md5sum %s 2>/dev/null)" % path,          # Linux
  1505. >             "(/sbin/md5sum -q %s 2>/dev/null)" % path,          # ?
  1506. >             "(/usr/bin/digest -a md5 %s 2>/dev/null)" % path,   # Solaris 10+
  1507. >             "(/sbin/md5 -q %s 2>/dev/null)" % path,             # Freebsd
  1508. >             "(/usr/bin/md5 -n %s 2>/dev/null)" % path,          # Netbsd
  1509. >             "(/bin/md5 -q %s 2>/dev/null)" % path,              # Openbsd
  1510. >             "(/usr/bin/csum -h MD5 %s 2>/dev/null)" % path,     # AIX
  1511. >             "(/bin/csum -h MD5 %s 2>/dev/null)" % path          # AIX also
  1512. >         ]
  1513. >
  1514. >         cmd = " || ".join(md5s)
  1515. >         cmd = "%s; %s || (echo \"${rc}  %s\")" % (test, cmd, path)
  1516. 1024a1035
  1517. >
  1518. 1026,1028c1037,1039
  1519. <         use_system_tmp = False
  1520. <         if (self.sudo and self.sudo_user != 'root') or (self.su and self.su_user != 'root'):
  1521. <             use_system_tmp = True
  1522. ---
  1523. >         basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile)
  1524. >         if (self.sudo and self.sudo_user != 'root') or (self.su and self.su_user != 'root') and basetmp.startswith('$HOME'):
  1525. >             basetmp = os.path.join('/tmp', basefile)
  1526. 1030c1041
  1527. <         tmp_mode = None
  1528. ---
  1529. >         cmd = 'mkdir -p %s' % basetmp
  1530. 1032c1043,1044
  1531. <             tmp_mode = 'a+rx'
  1532. ---
  1533. >             cmd += ' && chmod a+rx %s' % basetmp
  1534. >         cmd += ' && echo %s' % basetmp
  1535. 1034d1045
  1536. <         cmd = conn.shell.mkdtemp(basefile, use_system_tmp, tmp_mode)
  1537. 1052c1063
  1538. <         rc = conn.shell.join_path(utils.last_non_blank_line(result['stdout']).strip(), '')
  1539. ---
  1540. >         rc = utils.last_non_blank_line(result['stdout']).strip() + '/'
  1541. 1062a1074
  1542. >
  1543. 1064c1076
  1544. <             cmd = conn.shell.remove(tmp_path, recurse=True)
  1545. ---
  1546. >             cmd = "rm -rf %s >/dev/null 2>&1" % tmp_path
  1547. 1078c1090
  1548. <         module_remote_path = conn.shell.join_path(tmp, module_name)
  1549. ---
  1550. >         module_remote_path = os.path.join(tmp, module_name)
  1551. 1090,1091c1102
  1552. <         module_suffixes = getattr(conn, 'default_suffixes', None)
  1553. <         module_path = utils.plugins.module_finder.find_plugin(module_name, module_suffixes)
  1554. ---
  1555. >         module_path = utils.plugins.module_finder.find_plugin(module_name)
  1556. diff -r ansible/ansible/lib/ansible/runner/lookup_plugins/file.py ansible-1.6.6/lib/ansible/runner/lookup_plugins/file.py
  1557. 38,40c38,40
  1558. <             basedir_path  = utils.path_dwim(self.basedir, term)
  1559. <             relative_path = None
  1560. <             playbook_path = None
  1561. ---
  1562. >             path = utils.path_dwim(self.basedir, term)
  1563. >             if not os.path.exists(path):
  1564. >                 raise errors.AnsibleError("%s does not exist" % path)
  1565. 42,50c42
  1566. <             # Special handling of the file lookup, used primarily when the
  1567. <             # lookup is done from a role. If the file isn't found in the
  1568. <             # basedir of the current file, use dwim_relative to look in the
  1569. <             # role/files/ directory, and finally the playbook directory
  1570. <             # itself (which will be relative to the current working dir)
  1571. <             if '_original_file' in inject:
  1572. <                 relative_path = utils.path_dwim_relative(inject['_original_file'], 'files', term, self.basedir, check=False)
  1573. <             if 'playbook_dir' in inject:
  1574. <                 playbook_path = os.path.join(inject['playbook_dir'], term)
  1575. ---
  1576. >             ret.append(codecs.open(path, encoding="utf8").read().rstrip())
  1577. 52,57d43
  1578. <             for path in (basedir_path, relative_path, playbook_path):
  1579. <                 if path and os.path.exists(path):
  1580. <                     ret.append(codecs.open(path, encoding="utf8").read().rstrip())
  1581. <                     break
  1582. <             else:
  1583. <                 raise errors.AnsibleError("could not locate file in lookup: %s" % term)
  1584. Only in ansible/ansible/lib/ansible/runner: shell_plugins
  1585. diff -r ansible/ansible/lib/ansible/utils/__init__.py ansible-1.6.6/lib/ansible/utils/__init__.py
  1586. 1c1
  1587. < # (c) 2012-2014, Michael DeHaan <[email protected]>
  1588. ---
  1589. > # (c) 2012, Michael DeHaan <[email protected]>
  1590. 18d17
  1591. < import errno
  1592. 542a542
  1593. >             msg = process_common_errors(msg, probline, mark.column)
  1594. 559a560
  1595. >                 msg = process_common_errors(msg, probline, mark.column)
  1596. 624c625
  1597. <     result = {}
  1598. ---
  1599. >     result = copy.deepcopy(a)
  1600. 626,636c627,636
  1601. <     for dicts in a, b:
  1602. <         # next, iterate over b keys and values
  1603. <         for k, v in dicts.iteritems():
  1604. <             # if there's already such key in a
  1605. <             # and that key contains dict
  1606. <             if k in result and isinstance(result[k], dict):
  1607. <                 # merge those dicts recursively
  1608. <                 result[k] = merge_hash(a[k], v)
  1609. <             else:
  1610. <                 # otherwise, just copy a value from b to a
  1611. <                 result[k] = v
  1612. ---
  1613. >     # next, iterate over b keys and values
  1614. >     for k, v in b.iteritems():
  1615. >         # if there's already such key in a
  1616. >         # and that key contains dict
  1617. >         if k in result and isinstance(result[k], dict):
  1618. >             # merge those dicts recursively
  1619. >             result[k] = merge_hash(a[k], v)
  1620. >         else:
  1621. >             # otherwise, just copy a value from b to a
  1622. >             result[k] = v
  1623. 651c651
  1624. <     ''' Return MD5 hex digest of local file, None if file is not present or a directory. '''
  1625. ---
  1626. >     ''' Return MD5 hex digest of local file, or None if file is not present. '''
  1627. 653c653
  1628. <     if not os.path.exists(filename) or os.path.isdir(filename):
  1629. ---
  1630. >     if not os.path.exists(filename):
  1631. 993c993
  1632. <     prompt = '[Pp]assword: ?$'
  1633. ---
  1634. >     prompt = 'assword: '
  1635. 995c995
  1636. <     sudocmd = '%s %s %s -c "%s -c %s"' % (
  1637. ---
  1638. >     sudocmd = '%s %s %s %s -c %s' % (
  1639. 1213,1222d1212
  1640. < def load_vars(basepath, results, vault_password=None):
  1641. <     """
  1642. <     Load variables from any potential yaml filename combinations of basepath,
  1643. <     returning result.
  1644. <     """
  1645. <
  1646. <     paths_to_check = [ "".join([basepath, ext])
  1647. <                        for ext in C.YAML_FILENAME_EXTENSIONS ]
  1648. <
  1649. <     found_paths = []
  1650. 1224,1322d1213
  1651. <     for path in paths_to_check:
  1652. <         found, results = _load_vars_from_path(path, results, vault_password=vault_password)
  1653. <         if found:
  1654. <             found_paths.append(path)
  1655. <
  1656. <
  1657. <     # disallow the potentially confusing situation that there are multiple
  1658. <     # variable files for the same name. For example if both group_vars/all.yml
  1659. <     # and group_vars/all.yaml
  1660. <     if len(found_paths) > 1:
  1661. <         raise errors.AnsibleError("Multiple variable files found. "
  1662. <             "There should only be one. %s" % ( found_paths, ))
  1663. <
  1664. <     return results
  1665. <
  1666. < ## load variables from yaml files/dirs
  1667. < #  e.g. host/group_vars
  1668. < #
  1669. < def _load_vars_from_path(path, results, vault_password=None):
  1670. <     """
  1671. <     Robustly access the file at path and load variables, carefully reporting
  1672. <     errors in a friendly/informative way.
  1673. <
  1674. <     Return the tuple (found, new_results, )
  1675. <     """
  1676. <
  1677. <     try:
  1678. <         # in the case of a symbolic link, we want the stat of the link itself,
  1679. <         # not its target
  1680. <         pathstat = os.lstat(path)
  1681. <     except os.error, err:
  1682. <         # most common case is that nothing exists at that path.
  1683. <         if err.errno == errno.ENOENT:
  1684. <             return False, results
  1685. <         # otherwise this is a condition we should report to the user
  1686. <         raise errors.AnsibleError(
  1687. <             "%s is not accessible: %s."
  1688. <             " Please check its permissions." % ( path, err.strerror))
  1689. <
  1690. <     # symbolic link
  1691. <     if stat.S_ISLNK(pathstat.st_mode):
  1692. <         try:
  1693. <             target = os.path.realpath(path)
  1694. <         except os.error, err2:
  1695. <             raise errors.AnsibleError("The symbolic link at %s "
  1696. <                 "is not readable: %s.  Please check its permissions."
  1697. <                 % (path, err2.strerror, ))
  1698. <         # follow symbolic link chains by recursing, so we repeat the same
  1699. <         # permissions checks above and provide useful errors.
  1700. <         return _load_vars_from_path(target, results)
  1701. <
  1702. <     # directory
  1703. <     if stat.S_ISDIR(pathstat.st_mode):
  1704. <
  1705. <         # support organizing variables across multiple files in a directory
  1706. <         return True, _load_vars_from_folder(path, results, vault_password=vault_password)
  1707. <
  1708. <     # regular file
  1709. <     elif stat.S_ISREG(pathstat.st_mode):
  1710. <         data = parse_yaml_from_file(path, vault_password=vault_password)
  1711. <         if data and type(data) != dict:
  1712. <             raise errors.AnsibleError(
  1713. <                 "%s must be stored as a dictionary/hash" % path)
  1714. <         elif data is None:
  1715. <             data = {}
  1716. <
  1717. <         # combine vars overrides by default but can be configured to do a
  1718. <         # hash merge in settings
  1719. <         results = combine_vars(results, data)
  1720. <         return True, results
  1721. <
  1722. <     # something else? could be a fifo, socket, device, etc.
  1723. <     else:
  1724. <         raise errors.AnsibleError("Expected a variable file or directory "
  1725. <             "but found a non-file object at path %s" % (path, ))
  1726. <
  1727. < def _load_vars_from_folder(folder_path, results, vault_password=None):
  1728. <     """
  1729. <     Load all variables within a folder recursively.
  1730. <     """
  1731. <
  1732. <     # this function and _load_vars_from_path are mutually recursive
  1733. <
  1734. <     try:
  1735. <         names = os.listdir(folder_path)
  1736. <     except os.error, err:
  1737. <         raise errors.AnsibleError(
  1738. <             "This folder cannot be listed: %s: %s."
  1739. <              % ( folder_path, err.strerror))
  1740. <
  1741. <     # evaluate files in a stable order rather than whatever order the
  1742. <     # filesystem lists them.
  1743. <     names.sort()
  1744. <
  1745. <     # do not parse hidden files or dirs, e.g. .svn/
  1746. <     paths = [os.path.join(folder_path, name) for name in names if not name.startswith('.')]
  1747. <     for path in paths:
  1748. <         _found, results = _load_vars_from_path(path, results, vault_password=vault_password)
  1749. <     return results
  1750. diff -r ansible/ansible/lib/ansible/utils/module_docs_fragments/files.py ansible-1.6.6/lib/ansible/utils/module_docs_fragments/files.py
  1751. 23a24
  1752. > options:
  1753. 33,40c34,41
  1754. <         do not exist, since 1.7 they will be created with the supplied permissions.
  1755. <         If C(file), the file will NOT be created if it does not exist, see the M(copy)
  1756. <         or M(template) module if you want that behavior.  If C(link), the symbolic
  1757. <         link will be created or changed. Use C(hard) for hardlinks. If C(absent),
  1758. <         directories will be recursively deleted, and files or symlinks will be unlinked.
  1759. <         If C(touch) (new in 1.4), an empty file will be created if the c(path) does not
  1760. <         exist, while an existing file or directory will receive updated file access and
  1761. <         modification times (similar to the way `touch` works from the command line).
  1762. ---
  1763. >         do not exist. If C(file), the file will NOT be created if it does not
  1764. >         exist, see the M(copy) or M(template) module if you want that behavior.
  1765. >         If C(link), the symbolic link will be created or changed. Use C(hard)
  1766. >         for hardlinks. If C(absent), directories will be recursively deleted,
  1767. >         and files or symlinks will be unlinked. If C(touch) (new in 1.4), an empty file will
  1768. >         be created if the c(path) does not exist, while an existing file or
  1769. >         directory will receive updated file access and modification times (similar
  1770. >         to the way `touch` works from the command line).
  1771. diff -r ansible/ansible/lib/ansible/utils/plugins.py ansible-1.6.6/lib/ansible/utils/plugins.py
  1772. 142c142
  1773. <     def find_plugin(self, name, suffixes=None):
  1774. ---
  1775. >     def find_plugin(self, name):
  1776. 145,160c145,156
  1777. <         if not suffixes:
  1778. <             if self.class_name:
  1779. <                 suffixes = ['.py']
  1780. <             else:
  1781. <                 suffixes = ['', '.ps1']
  1782. <
  1783. <         for suffix in suffixes:
  1784. <             full_name = '%s%s' % (name, suffix)
  1785. <             if full_name in self._plugin_path_cache:
  1786. <                 return self._plugin_path_cache[full_name]
  1787. <
  1788. <             for i in self._get_paths():
  1789. <                 path = os.path.join(i, full_name)
  1790. <                 if os.path.isfile(path):
  1791. <                     self._plugin_path_cache[full_name] = path
  1792. <                     return path
  1793. ---
  1794. >         if name in self._plugin_path_cache:
  1795. >             return self._plugin_path_cache[name]
  1796. >
  1797. >         suffix = ".py"
  1798. >         if not self.class_name:
  1799. >             suffix = ""
  1800. >
  1801. >         for i in self._get_paths():
  1802. >             path = os.path.join(i, "%s%s" % (name, suffix))
  1803. >             if os.path.isfile(path):
  1804. >                 self._plugin_path_cache[name] = path
  1805. >                 return path
  1806. 217,223d212
  1807. < )
  1808. <
  1809. < shell_loader = PluginLoader(
  1810. <     'ShellModule',
  1811. <     'ansible.runner.shell_plugins',
  1812. <     'shell_plugins',
  1813. <     'shell_plugins',
  1814. diff -r ansible/ansible/lib/ansible/utils/template.py ansible-1.6.6/lib/ansible/utils/template.py
  1815. 83,84d82
  1816. < JINJA2_OVERRIDE = '#jinja2:'
  1817. < JINJA2_ALLOWED_OVERRIDES = ['trim_blocks', 'lstrip_blocks', 'newline_sequence', 'keep_trailing_newline']
  1818. 95,97d92
  1819. <         except errors.AnsibleError:
  1820. <             # Plugin raised this on purpose
  1821. <             raise
  1822. 235,246d229
  1823. <     # Get jinja env overrides from template
  1824. <     if data.startswith(JINJA2_OVERRIDE):
  1825. <         eol = data.find('\n')
  1826. <         line = data[len(JINJA2_OVERRIDE):eol]
  1827. <         data = data[eol+1:]
  1828. <         for pair in line.split(','):
  1829. <             (key,val) = pair.split(':')
  1830. <             key = key.strip()
  1831. <             if key in JINJA2_ALLOWED_OVERRIDES:
  1832. <                 setattr(environment, key, ast.literal_eval(val.strip()))
  1833. <
  1834. <
  1835. 287,296d269
  1836. <     except jinja2.exceptions.TemplateNotFound, e:
  1837. <         # Throw an exception which includes a more user friendly error message
  1838. <         # This likely will happen for included sub-template. Not that besides
  1839. <         # pure "file not found" it may happen due to Jinja2's "security"
  1840. <         # checks on path.
  1841. <         values = {'name': realpath, 'subname': str(e)}
  1842. <         msg = 'file: %(name)s, error: Cannot find/not allowed to load (include) template %(subname)s' % \
  1843. <                values
  1844. <         error = errors.AnsibleError(msg)
  1845. <         raise error
  1846. Only in ansible/ansible/library/cloud: azure
  1847. diff -r ansible/ansible/library/cloud/digital_ocean_domain ansible-1.6.6/library/cloud/digital_ocean_domain
  1848. 62c62
  1849. < - digital_ocean: >
  1850. ---
  1851. > - digital_cean_droplet: >
  1852. 72,73c72,73
  1853. <       name={{ test_droplet.droplet.name }}.my.domain
  1854. <       ip={{ test_droplet.droplet.ip_address }}
  1855. ---
  1856. >       name={{ test_droplet.name }}.my.domain
  1857. >       ip={{ test_droplet.ip_address }}
  1858. diff -r ansible/ansible/library/cloud/docker ansible-1.6.6/library/cloud/docker
  1859. 187c187
  1860. < requirements: [ "docker-py >= 0.3.0", "docker >= 0.10.0" ]
  1861. ---
  1862. > requirements: [ "docker-py >= 0.3.0" ]
  1863. 383c383
  1864. <             self.links = self.get_links(self.module.params.get('links'))
  1865. ---
  1866. >             self.links = dict(map(lambda x: x.split(':'), self.module.params.get('links')))
  1867. 394,409d393
  1868. <     def get_links(self, links):
  1869. <         """
  1870. <         Parse the links passed, if a link is specified without an alias then just create the alias of the same name as the link
  1871. <         """
  1872. <         processed_links = {}
  1873. <
  1874. <         for link in links:
  1875. <             parsed_link = link.split(':', 1)
  1876. <             if(len(parsed_link) == 2):
  1877. <                 processed_links[parsed_link[0]] = parsed_link[1]
  1878. <             else:
  1879. <                 processed_links[parsed_link[0]] = parsed_link[0]
  1880. <
  1881. <         return processed_links
  1882. <
  1883. <
  1884. 468a453
  1885. >
  1886. diff -r ansible/ansible/library/cloud/docker_image ansible-1.6.6/library/cloud/docker_image
  1887. 48c48
  1888. <     default: "latest"
  1889. ---
  1890. >     default: ""
  1891. 100c100
  1892. <   - name: remove image
  1893. ---
  1894. >   - name: run tomcat servers
  1895. 116,120d115
  1896. < try:
  1897. <     from docker.errors import APIError as DockerAPIError
  1898. < except ImportError:
  1899. <     from docker.client import APIError as DockerAPIError
  1900. <
  1901. 148,151c143
  1902. <             try:
  1903. <                 chunk_json = json.loads(chunk)
  1904. <             except ValueError:
  1905. <                 continue
  1906. ---
  1907. >             chunk_json = json.loads(chunk)
  1908. 164,169d155
  1909. <         # Just in case we skipped evaluating the JSON returned from build
  1910. <         # during every iteration, add an error if the image_id was never
  1911. <         # populated
  1912. <         if not image_id:
  1913. <             self.error_msg = 'Unknown error encountered'
  1914. <
  1915. 181c167
  1916. <                 repotag = ':'.join([self.name, self.tag])
  1917. ---
  1918. >                 repotag = '%s:%s' % (getattr(self, 'name', ''), getattr(self, 'tag', 'latest'))
  1919. 195c181
  1920. <             except DockerAPIError as e:
  1921. ---
  1922. >             except docker.APIError as e:
  1923. 205c191
  1924. <             tag             = dict(required=False, default="latest"),
  1925. ---
  1926. >             tag             = dict(required=False, default=""),
  1927. 236c222
  1928. <                 msg = "Image built: %s" % image_id
  1929. ---
  1930. >                 msg = "Image builded: %s" % image_id
  1931. 243c229
  1932. <     except DockerAPIError as e:
  1933. ---
  1934. >     except docker.client.APIError as e:
  1935. diff -r ansible/ansible/library/cloud/ec2 ansible-1.6.6/library/cloud/ec2
  1936. 178c178
  1937. <       - "list of instance ids, currently used for states: absent, running, stopped"
  1938. ---
  1939. >       - list of instance ids, currently used for the states 'absent', 'running', and 'stopped'
  1940. 573c573,574
  1941. <                      'hypervisor': inst.hypervisor}
  1942. ---
  1943. >                      'hypervisor': inst.hypervisor,
  1944. >                      'ebs_optimized': inst.ebs_optimized}
  1945. 579,583d579
  1946. <     try:
  1947. <         instance_info['ebs_optimized'] = getattr(inst, 'ebs_optimized')
  1948. <     except AttributeError:
  1949. <         instance_info['ebs_optimized'] = False
  1950. <
  1951. 919a916,921
  1952. >         if instance_tags:
  1953. >             try:
  1954. >                 ec2.create_tags(instids, instance_tags)
  1955. >             except boto.exception.EC2ResponseError, e:
  1956. >                 module.fail_json(msg = "Instance tagging failed => %s: %s" % (e.error_code, e.error_message))
  1957. >
  1958. 924,932c926
  1959. <             try:
  1960. <                 res_list = ec2.get_all_instances(instids)
  1961. <             except boto.exception.BotoSeverError, e:
  1962. <                 if e.error_code == 'InvalidInstanceID.NotFound':
  1963. <                     time.sleep(1)
  1964. <                     continue
  1965. <                 else:
  1966. <                     raise
  1967. <
  1968. ---
  1969. >             res_list = ec2.get_all_instances(instids)
  1970. 959,965d952
  1971. <         # Leave this as late as possible to try and avoid InvalidInstanceID.NotFound
  1972. <         if instance_tags:
  1973. <             try:
  1974. <                 ec2.create_tags(instids, instance_tags)
  1975. <             except boto.exception.EC2ResponseError, e:
  1976. <                 module.fail_json(msg = "Instance tagging failed => %s: %s" % (e.error_code, e.error_message))
  1977. <
  1978. 1006c993
  1979. <             if inst.state == 'running' or inst.state == 'stopped':
  1980. ---
  1981. >             if inst.state == 'running':
  1982. diff -r ansible/ansible/library/cloud/ec2_asg ansible-1.6.6/library/cloud/ec2_asg
  1983. 70,87d69
  1984. <   tags:
  1985. <     description:
  1986. <       - List of tag dictionaries to use. Required keys are 'key', 'value'. Optional key is 'propagate_at_launch', which defaults to true.
  1987. <     required: false
  1988. <     default: None
  1989. <     version_added: "1.7"
  1990. <   health_check_period:
  1991. <     description:
  1992. <       - Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
  1993. <     required: false
  1994. <     default: 500 seconds
  1995. <     version_added: "1.7"
  1996. <   health_check_type:
  1997. <     description:
  1998. <       - The service you want the health status from, Amazon EC2 or Elastic Load Balancer.
  1999. <     required: false
  2000. <     default: EC2
  2001. <     version_added: "1.7"
  2002. 101,105d82
  2003. <     tags:
  2004. <       - key: environment
  2005. <         value: production
  2006. <         propagate_at_launch: no
  2007. <
  2008. 116c93
  2009. <     from boto.ec2.autoscale import AutoScaleConnection, AutoScalingGroup, Tag
  2010. ---
  2011. >     from boto.ec2.autoscale import AutoScaleConnection, AutoScalingGroup
  2012. 122,123d98
  2013. < ASG_ATTRIBUTES = ('launch_config_name', 'max_size', 'min_size', 'desired_capacity',
  2014. <                      'vpc_zone_identifier', 'availability_zones')
  2015. 137,144d111
  2016. < def get_properties(autoscaling_group):
  2017. <     properties = dict((attr, getattr(autoscaling_group, attr)) for attr in ASG_ATTRIBUTES)
  2018. <     if autoscaling_group.instances:
  2019. <         properties['instances'] = [i.instance_id for i in autoscaling_group.instances]
  2020. <     properties['load_balancers'] = autoscaling_group.load_balancers
  2021. <     return properties
  2022. <
  2023. <
  2024. 145a113
  2025. >     enforce_required_arguments(module)
  2026. 155,157c123,124
  2027. <     set_tags = module.params.get('tags')
  2028. <     health_check_period = module.params.get('health_check_period')
  2029. <     health_check_type = module.params.get('health_check_type')
  2030. ---
  2031. >
  2032. >     launch_configs = connection.get_all_launch_configurations(names=[launch_config_name])
  2033. 167,173c134
  2034. <
  2035. <     asg_tags = []
  2036. <     for tag in set_tags:
  2037. <         asg_tags.append(Tag(key=tag.get('key'),
  2038. <              value=tag.get('value'),
  2039. <              propagate_at_launch=bool(tag.get('propagate_at_launch', True)),
  2040. <              resource_id=group_name))
  2041. ---
  2042. >         module.params['availability_zones'] = [zone.name for zone in ec2_connection.get_all_zones()]
  2043. 176,179d136
  2044. <         if not vpc_zone_identifier and not availability_zones:
  2045. <             availability_zones = module.params['availability_zones'] = [zone.name for zone in ec2_connection.get_all_zones()]
  2046. <         enforce_required_arguments(module)
  2047. <         launch_configs = connection.get_all_launch_configurations(names=[launch_config_name])
  2048. 189,192c146
  2049. <                  connection=connection,
  2050. <                  tags=asg_tags,
  2051. <                  health_check_period=health_check_period,
  2052. <                  health_check_type=health_check_type)
  2053. ---
  2054. >                  connection=connection)
  2055. 196,197c150
  2056. <             asg_properties = get_properties(ag)
  2057. <             module.exit_json(changed=True, **asg_properties)
  2058. ---
  2059. >             module.exit_json(changed=True)
  2060. 203,204c156,158
  2061. <         for attr in ASG_ATTRIBUTES:
  2062. <             if module.params.get(attr) and getattr(as_group, attr) != module.params.get(attr):
  2063. ---
  2064. >         for attr in ('launch_config_name', 'max_size', 'min_size', 'desired_capacity',
  2065. >                      'vpc_zone_identifier', 'availability_zones'):
  2066. >             if getattr(as_group, attr) != module.params.get(attr):
  2067. 207,223d160
  2068. <
  2069. <         if len(set_tags) > 0:
  2070. <             existing_tags = as_group.tags
  2071. <             existing_tag_map = dict((tag.key, tag) for tag in existing_tags)
  2072. <             for tag in set_tags:
  2073. <                 if 'key' not in tag:
  2074. <                     continue
  2075. <                 if ( not tag['key'] in existing_tag_map or
  2076. <                      existing_tag_map[tag['key']].value != tag['value'] or
  2077. <                      ('propagate_at_launch' in tag and
  2078. <                      existing_tag_map[tag['key']].propagate_at_launch != tag['propagate_at_launch']) ):
  2079. <
  2080. <                     changed = True
  2081. <                     continue
  2082. <             if changed:
  2083. <                 connection.create_or_update_tags(asg_tags)
  2084. <
  2085. 226c163
  2086. <         if load_balancers and as_group.load_balancers != load_balancers:
  2087. ---
  2088. >         if as_group.load_balancers != load_balancers:
  2089. 233,234c170
  2090. <             asg_properties = get_properties(as_group)
  2091. <             module.exit_json(changed=changed, **asg_properties)
  2092. ---
  2093. >             module.exit_json(changed=changed)
  2094. 238,255d173
  2095. <     result = as_groups[0]
  2096. <     module.exit_json(changed=changed, name=result.name,
  2097. <         autoscaling_group_arn=result.autoscaling_group_arn,
  2098. <         availability_zones=result.availability_zones,
  2099. <         created_time=str(result.created_time),
  2100. <         default_cooldown=result.default_cooldown,
  2101. <         health_check_period=result.health_check_period,
  2102. <         health_check_type=result.health_check_type,
  2103. <         instance_id=result.instance_id,
  2104. <         instances=[instance.instance_id for instance in result.instances],
  2105. <         launch_config_name=result.launch_config_name,
  2106. <         load_balancers=result.load_balancers,
  2107. <         min_size=result.min_size, max_size=result.max_size,
  2108. <         placement_group=result.placement_group,
  2109. <         tags=result.tags,
  2110. <         termination_policies=result.termination_policies,
  2111. <         vpc_zone_identifier=result.vpc_zone_identifier)
  2112. <
  2113. 266c184
  2114. <             groups = connection.get_all_groups()
  2115. ---
  2116. >             connection.get_all_groups()
  2117. 292,294d209
  2118. <             tags=dict(type='list', default=[]),
  2119. <             health_check_period=dict(type='int', default=300),
  2120. <             health_check_type=dict(default='EC2', choices=['EC2', 'ELB']),
  2121. 304,305d218
  2122. <         if not connection:
  2123. <             module.fail_json(msg="failed to connect to AWS for the given region: %s" % str(region))
  2124. diff -r ansible/ansible/library/cloud/ec2_elb_lb ansible-1.6.6/library/cloud/ec2_elb_lb
  2125. 69,96d68
  2126. <   subnets:
  2127. <     description:
  2128. <       - A list of VPC subnets to use when creating ELB. Zones should be empty if using this.
  2129. <     required: false
  2130. <     default: None
  2131. <     aliases: []
  2132. <     version_added: "1.7"
  2133. <   purge_subnets:
  2134. <     description:
  2135. <       - Purge existing subnet on ELB that are not found in subnets
  2136. <     required: false
  2137. <     default: false  
  2138. <     version_added: "1.7"
  2139. <   scheme:
  2140. <     description:
  2141. <       - The scheme to use when creating the ELB. For a private VPC-visible ELB use 'internal'.
  2142. <     required: false
  2143. <     default: 'internet-facing'
  2144. <     version_added: "1.7"
  2145. <   validate_certs:
  2146. <     description:
  2147. <       - When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.
  2148. <     required: false
  2149. <     default: "yes"
  2150. <     choices: ["yes", "no"]
  2151. <     aliases: []
  2152. <     version_added: "1.5"
  2153. <
  2154. 123,137d94
  2155. <
  2156. < # Basic VPC provisioning example
  2157. < - local_action:
  2158. <     module: ec2_elb_lb
  2159. <     name: "test-vpc"
  2160. <     scheme: internal
  2161. <     state: present
  2162. <     subnets:
  2163. <       - subnet-abcd1234
  2164. <       - subnet-1a2b3c4d
  2165. <     listeners:
  2166. <       - protocol: http # options are http, https, ssl, tcp
  2167. <         load_balancer_port: 80
  2168. <         instance_port: 80
  2169. <
  2170. 195,208d151
  2171. <
  2172. < # Creates a ELB and assigns a list of subnets to it.
  2173. < - local_action:
  2174. <     module: ec2_elb_lb
  2175. <     state: present
  2176. <     name: 'New ELB'
  2177. <     security_group_ids: 'sg-123456, sg-67890'
  2178. <     region: us-west-2
  2179. <     subnets: 'subnet-123456, subnet-67890'
  2180. <     purge_subnets: yes
  2181. <     listeners:
  2182. <       - protocol: http
  2183. <         load_balancer_port: 80
  2184. <         instance_port: 80
  2185. 228,231c171,172
  2186. <                  zones=None, purge_zones=None, security_group_ids=None,
  2187. <                  health_check=None, subnets=None, purge_subnets=None,
  2188. <                  scheme="internet-facing", region=None, **aws_connect_params):
  2189. <
  2190. ---
  2191. >                  zones=None, purge_zones=None, security_group_ids=None, health_check=None,
  2192. >                  region=None, **aws_connect_params):
  2193. 240,242d180
  2194. <         self.subnets = subnets
  2195. <         self.purge_subnets = purge_subnets
  2196. <         self.scheme = scheme
  2197. 261d198
  2198. <             self._set_subnets()
  2199. 286,288c223
  2200. <                 'status': self.status,
  2201. <                 'subnets': self.subnets,
  2202. <                 'scheme': check_elb.scheme
  2203. ---
  2204. >                 'status': self.status
  2205. 322c257
  2206. <             return connect_to_aws(boto.ec2.elb, self.region,
  2207. ---
  2208. >             return connect_to_aws(boto.ec2.elb, self.region,
  2209. 339,341c274
  2210. <                                                       complex_listeners=listeners,
  2211. <                                                       subnets=self.subnets,
  2212. <                                                       scheme=self.scheme)
  2213. ---
  2214. >                                                       complex_listeners=listeners)
  2215. 460,482d392
  2216. <     def _attach_subnets(self, subnets):
  2217. <         self.elb_conn.attach_lb_to_subnets(self.name, subnets)
  2218. <         self.changed = True
  2219. <
  2220. <     def _detach_subnets(self, subnets):
  2221. <         self.elb_conn.detach_lb_from_subnets(self.name, subnets)
  2222. <         self.changed = True
  2223. <
  2224. <     def _set_subnets(self):
  2225. <         """Determine which subnets need to be attached or detached on the ELB"""
  2226. <         if self.subnets:
  2227. <             if self.purge_subnets:
  2228. <                 subnets_to_detach = list(set(self.elb.subnets) - set(self.subnets))
  2229. <                 subnets_to_attach = list(set(self.subnets) - set(self.elb.subnets))
  2230. <             else:
  2231. <                 subnets_to_detach = None
  2232. <                 subnets_to_attach = list(set(self.subnets) - set(self.elb.subnets))
  2233. <
  2234. <             if subnets_to_attach:
  2235. <                 self._attach_subnets(subnets_to_attach)
  2236. <             if subnets_to_detach:
  2237. <                 self._detach_subnets(subnets_to_detach)
  2238. <                
  2239. 485,487c395,396
  2240. <         if self.zones:
  2241. <             if self.purge_zones:
  2242. <                 zones_to_disable = list(set(self.elb.availability_zones) -
  2243. ---
  2244. >         if self.purge_zones:
  2245. >             zones_to_disable = list(set(self.elb.availability_zones) -
  2246. 489,499c398,408
  2247. <                 zones_to_enable = list(set(self.zones) -
  2248. <                                     set(self.elb.availability_zones))
  2249. <             else:
  2250. <                 zones_to_disable = None
  2251. <                 zones_to_enable = list(set(self.zones) -
  2252. <                                     set(self.elb.availability_zones))
  2253. <             if zones_to_enable:
  2254. <                 self._enable_zones(zones_to_enable)
  2255. <             # N.B. This must come second, in case it would have removed all zones
  2256. <             if zones_to_disable:
  2257. <                 self._disable_zones(zones_to_disable)
  2258. ---
  2259. >             zones_to_enable = list(set(self.zones) -
  2260. >                                    set(self.elb.availability_zones))
  2261. >         else:
  2262. >             zones_to_disable = None
  2263. >             zones_to_enable = list(set(self.zones) -
  2264. >                                    set(self.elb.availability_zones))
  2265. >         if zones_to_enable:
  2266. >             self._enable_zones(zones_to_enable)
  2267. >         # N.B. This must come second, in case it would have removed all zones
  2268. >         if zones_to_disable:
  2269. >             self._disable_zones(zones_to_disable)
  2270. 558,560d466
  2271. <             subnets={'default': None, 'required': False, 'type': 'list'},
  2272. <             purge_subnets={'default': False, 'required': False, 'type': 'bool'},
  2273. <             scheme={'default': 'internet-facing', 'required': False}
  2274. 580,582d485
  2275. <     subnets = module.params['subnets']
  2276. <     purge_subnets = module.params['purge_subnets']
  2277. <     scheme = module.params['scheme']
  2278. 587,588c490,491
  2279. <     if state == 'present' and not (zones or subnets):
  2280. <         module.fail_json(msg="At least one availability zone or subnet is required for ELB creation")
  2281. ---
  2282. >     if state == 'present' and not zones:
  2283. >         module.fail_json(msg="At least one availability zone is required for ELB creation")
  2284. 591,593c494,495
  2285. <                          purge_zones, security_group_ids, health_check,
  2286. <                          subnets, purge_subnets,
  2287. <                          scheme, region=region, **aws_connect_params)
  2288. ---
  2289. >                          purge_zones, security_group_ids, health_check,
  2290. >                          region=region, **aws_connect_params)
  2291. diff -r ansible/ansible/library/cloud/ec2_group ansible-1.6.6/library/cloud/ec2_group
  2292. 64,65c64,65
  2293. <     aws_secret_key: SECRET
  2294. <     aws_access_key: ACCESS
  2295. ---
  2296. >     ec2_secret_key: SECRET
  2297. >     ec2_access_key: ACCESS
  2298. 109c109
  2299. < def get_target_from_rule(module, rule, name, group, groups):
  2300. ---
  2301. > def get_target_from_rule(rule, name, groups):
  2302. 252c252
  2303. <                 group_id, ip, target_group_created = get_target_from_rule(module, rule, name, group, groups)
  2304. ---
  2305. >                 group_id, ip, target_group_created = get_target_from_rule(rule, name, groups)
  2306. 292c292
  2307. <                 group_id, ip, target_group_created = get_target_from_rule(module, rule, name, group, groups)
  2308. ---
  2309. >                 group_id, ip, target_group_created = get_target_from_rule(rule, name, groups)
  2310. diff -r ansible/ansible/library/cloud/ec2_lc ansible-1.6.6/library/cloud/ec2_lc
  2311. 71,81d70
  2312. <   spot_price:
  2313. <     description:
  2314. <       - The spot price you are bidding. Only applies for an autoscaling group with spot instances.
  2315. <     required: false
  2316. <     default: null
  2317. <   instance_monitoring:
  2318. <     description:
  2319. <       - whether instances in group are launched with detailed monitoring.
  2320. <     required: false
  2321. <     default: false
  2322. <     aliases: []
  2323. 140,141d128
  2324. <     spot_price = module.params.get('spot_price')
  2325. <     instance_monitoring = module.params.get('instance_monitoring')
  2326. 160,162c147
  2327. <         instance_type=instance_type,
  2328. <         spot_price=spot_price,
  2329. <         instance_monitoring=instance_monitoring)
  2330. ---
  2331. >         instance_type=instance_type)
  2332. 202,203d186
  2333. <             spot_price=dict(type='float'),
  2334. <             instance_monitoring=dict(default=False, type='bool'),
  2335. diff -r ansible/ansible/library/cloud/ec2_metric_alarm ansible-1.6.6/library/cloud/ec2_metric_alarm
  2336. 56,57c56,57
  2337. <     threshold:
  2338. <         description:
  2339. ---
  2340. >     threshold:
  2341. >         description:
  2342. 68c68
  2343. <     unit:
  2344. ---
  2345. >     unit:
  2346. 82c82
  2347. <         description:
  2348. ---
  2349. >         description:
  2350. 132c132
  2351. <
  2352. ---
  2353. >    
  2354. 149c149
  2355. <
  2356. ---
  2357. >  
  2358. 154c154
  2359. <             metric=metric,
  2360. ---
  2361. >             metric=metric,  
  2362. 168c168
  2363. <         try:
  2364. ---
  2365. >         try:            
  2366. 170,171c170
  2367. <             changed = True
  2368. <             alarms = connection.describe_alarms(alarm_names=[name])
  2369. ---
  2370. >             module.exit_json(changed=True)
  2371. 190c189
  2372. <
  2373. ---
  2374. >        
  2375. 196c195
  2376. <                 setattr(alarm, 'dimensions', dim1)
  2377. ---
  2378. >                 setattr(alarm, 'dimensions', dim1)        
  2379. 198c197
  2380. <         for attr in ('alarm_actions','insufficient_data_actions','ok_actions'):
  2381. ---
  2382. >         for attr in ('alarm_actions','insufficient_data_actions','ok_actions'):
  2383. 203c202
  2384. <
  2385. ---
  2386. >        
  2387. 206a206
  2388. >             module.exit_json(changed=changed)
  2389. 209,228c209
  2390. <     result = alarms[0]
  2391. <     module.exit_json(changed=changed, name=result.name,
  2392. <         actions_enabled=result.actions_enabled,
  2393. <         alarm_actions=result.alarm_actions,
  2394. <         alarm_arn=result.alarm_arn,
  2395. <         comparison=result.comparison,
  2396. <         description=result.description,
  2397. <         dimensions=result.dimensions,
  2398. <         evaluation_periods=result.evaluation_periods,
  2399. <         insufficient_data_actions=result.insufficient_data_actions,
  2400. <         last_updated=result.last_updated,
  2401. <         metric=result.metric,
  2402. <         namespace=result.namespace,
  2403. <         ok_actions=result.ok_actions,
  2404. <         period=result.period,
  2405. <         state_reason=result.state_reason,
  2406. <         state_value=result.state_value,
  2407. <         statistic=result.statistic,
  2408. <         threshold=result.threshold,
  2409. <         unit=result.unit)
  2410. ---
  2411. >
  2412. 234c215
  2413. <
  2414. ---
  2415. >    
  2416. diff -r ansible/ansible/library/cloud/ec2_scaling_policy ansible-1.6.6/library/cloud/ec2_scaling_policy
  2417. 26c26
  2418. <     desciption:
  2419. ---
  2420. >     desciption:
  2421. 63c63
  2422. < try:
  2423. ---
  2424. > try:
  2425. 80c80
  2426. <
  2427. ---
  2428. >  
  2429. 82c82
  2430. <
  2431. ---
  2432. >    
  2433. 94,95c94
  2434. <             policy = connection.get_all_policies(policy_names=[sp_name])[0]
  2435. <             module.exit_json(changed=True, name=policy.name, arn=policy.policy_arn, as_name=policy.as_name, scaling_adjustment=policy.scaling_adjustment, cooldown=policy.cooldown, adjustment_type=policy.adjustment_type, min_adjustment_step=policy.min_adjustment_step)
  2436. ---
  2437. >             module.exit_json(changed=True)
  2438. 102,103c101,102
  2439. <         # min_adjustment_step attribute is only relevant if the adjustment_type
  2440. <         # is set to percentage change in capacity, so it is a special case
  2441. ---
  2442. >         #min_adjustment_step attribute is only relevant if the adjustment_type
  2443. >         #is set to percentage change in capacity, so it is a special case
  2444. 107,109c106,107
  2445. <
  2446. <         # set the min adjustment step incase the user decided to change their
  2447. <         # adjustment type to percentage
  2448. ---
  2449. >        
  2450. >         #set the min adjustment step incase the user decided to change their adjustment type to percentage
  2451. 112c110
  2452. <         # check the remaining attributes
  2453. ---
  2454. >         #check the remaining attributes
  2455. 122c120,121
  2456. <             module.exit_json(changed=changed, name=policy.name, arn=policy.policy_arn, as_name=policy.as_name, scaling_adjustment=policy.scaling_adjustment, cooldown=policy.cooldown, adjustment_type=policy.adjustment_type, min_adjustment_step=policy.min_adjustment_step)
  2457. ---
  2458. >                 module.exit_json(changed=changed, name=policy.name, arn=policy.policy_arn, as_name=policy.as_name, scaling_adjustment=policy.scaling_adjustment, cooldown=policy.cooldown, adjustment_type=policy.adjustment_type, min_adjustment_step=policy.min_adjustment_step)
  2459. >             module.exit_json(changed=changed)
  2460. 155c154
  2461. <         )
  2462. ---
  2463. >         )    
  2464. 157c156
  2465. <
  2466. ---
  2467. >    
  2468. 161c160
  2469. <
  2470. ---
  2471. >    
  2472. 166,167d164
  2473. <         if not connection:
  2474. <             module.fail_json(msg="failed to connect to AWS for the given region: %s" % str(region))
  2475. 177a175,180
  2476. >
  2477. >
  2478. >
  2479. >
  2480. >
  2481. >
  2482. diff -r ansible/ansible/library/cloud/ec2_snapshot ansible-1.6.6/library/cloud/ec2_snapshot
  2483. 28a29
  2484. >     default: null
  2485. 33a35,36
  2486. >     default: null
  2487. >     aliases: []
  2488. 37a41,42
  2489. >     default: null
  2490. >     aliases: []
  2491. 41a47,48
  2492. >     default: null
  2493. >     aliases: []
  2494. 45a53,68
  2495. >     default: null
  2496. >     aliases: []
  2497. >   profile:
  2498. >     description:
  2499. >       - uses a boto profile. Only works with boto >= 2.24.0
  2500. >     required: false
  2501. >     default: null
  2502. >     aliases: []
  2503. >     version_added: "1.6"
  2504. >   security_token:
  2505. >     description:
  2506. >       - security token to authenticate against AWS
  2507. >     required: false
  2508. >     default: null
  2509. >     aliases: []
  2510. >     version_added: "1.6"
  2511. 49a73,74
  2512. >     default: null
  2513. >     aliases: []
  2514. 90,92c115,116
  2515. <     argument_spec = ec2_argument_spec()
  2516. <     argument_spec.update(
  2517. <         dict(
  2518. ---
  2519. >     module = AnsibleModule(
  2520. >         argument_spec = dict(
  2521. 96a121,124
  2522. >             region = dict(aliases=['aws_region', 'ec2_region'], choices=AWS_REGIONS),
  2523. >             ec2_url = dict(),
  2524. >             ec2_secret_key = dict(aliases=['aws_secret_key', 'secret_key'], no_log=True),
  2525. >             ec2_access_key = dict(aliases=['aws_access_key', 'access_key']),
  2526. 102d129
  2527. <     module = AnsibleModule(argument_spec=argument_spec)
  2528. diff -r ansible/ansible/library/cloud/ec2_vol ansible-1.6.6/library/cloud/ec2_vol
  2529. 161c161
  2530. < - local_action:
  2531. ---
  2532. > - location: action
  2533. diff -r ansible/ansible/library/cloud/ec2_vpc ansible-1.6.6/library/cloud/ec2_vpc
  2534. 19c19
  2535. < module: ec2_vpc
  2536. ---
  2537. > module: ec2_vpc
  2538. 61,62c61,62
  2539. <       - 'A dictionary array of resource tags of the form: { tag1: value1, tag2: value2 }.  Tags in this list are used in conjunction with CIDR block to uniquely identify a VPC in lieu of vpc_id. Therefore, if CIDR/Tag combination does not exits, a new VPC will be created.  VPC tags not on this list will be ignored. Prior to 1.7, specifying a resource tag was optional.'
  2540. <     required: true
  2541. ---
  2542. >       - 'A dictionary array of resource tags of the form: { tag1: value1, tag2: value2 }.  Tags in this list are used in conjunction with CIDR block to uniquely identify a VPC in lieu of vpc_id. Therefore, if CIDR/Tag combination does not exits, a new VPC will be created.  VPC tags not on this list will be ignored.'
  2543. >     required: false
  2544. 99c99
  2545. <       - region in which the resource exists.
  2546. ---
  2547. >       - region in which the resource exists.
  2548. 105c105
  2549. <       - AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
  2550. ---
  2551. >       - AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
  2552. 146c146
  2553. <         subnets:
  2554. ---
  2555. >         subnets:
  2556. 158c158
  2557. <           - subnets:
  2558. ---
  2559. >           - subnets:
  2560. 161c161
  2561. <             routes:
  2562. ---
  2563. >             routes:
  2564. 176,177c176,177
  2565. <         vpc_id: vpc-aaaaaaa
  2566. <         region: us-west-2
  2567. ---
  2568. >         vpc_id: vpc-aaaaaaa
  2569. >         region: us-west-2  
  2570. 218c218
  2571. <
  2572. ---
  2573. >    
  2574. 221c221
  2575. <             msg='You must specify either a vpc_id or a cidr block + list of unique tags, aborting'
  2576. ---
  2577. >             msg='You must specify either a vpc id or a cidr block + list of unique tags, aborting'
  2578. 231c231
  2579. <
  2580. ---
  2581. >    
  2582. 234c234
  2583. <
  2584. ---
  2585. >        
  2586. 262c262
  2587. <         about the VPC and subnets that were launched
  2588. ---
  2589. >         about the VPC and subnets that were launched
  2590. 264,265c264,265
  2591. <
  2592. <     id = module.params.get('vpc_id')
  2593. ---
  2594. >    
  2595. >     id = module.params.get('id')
  2596. 273d272
  2597. <     vpc_spec_tags = module.params.get('resource_tags')
  2598. 278,282d276
  2599. <     if subnets is None:
  2600. <         subnets = []
  2601. <     if route_tables is None:
  2602. <         route_tables = []
  2603. <
  2604. 297,311c291,298
  2605. <                 try:
  2606. <                     pvpc = vpc_conn.get_all_vpcs(vpc.id)
  2607. <                     if hasattr(pvpc, 'state'):
  2608. <                         if pvpc.state == "available":
  2609. <                             pending = False
  2610. <                     elif hasattr(pvpc[0], 'state'):
  2611. <                         if pvpc[0].state == "available":
  2612. <                             pending = False
  2613. <                 # sometimes vpc_conn.create_vpc() will return a vpc that can't be found yet by vpc_conn.get_all_vpcs()
  2614. <                 # when that happens, just wait a bit longer and try again
  2615. <                 except boto.exception.BotoServerError, e:
  2616. <                     if e.error_code != 'InvalidVpcID.NotFound':
  2617. <                         raise
  2618. <                 if pending:
  2619. <                     time.sleep(5)
  2620. ---
  2621. >                 pvpc = vpc_conn.get_all_vpcs(vpc.id)
  2622. >                 if hasattr(pvpc, 'state'):
  2623. >                     if pvpc.state == "available":
  2624. >                         pending = False
  2625. >                 elif hasattr(pvpc[0], 'state'):
  2626. >                     if pvpc[0].state == "available":
  2627. >                         pending = False
  2628. >                 time.sleep(5)
  2629. 321a309
  2630. >     vpc_spec_tags = module.params.get('resource_tags')
  2631. 324c312
  2632. <     if not set(vpc_spec_tags.items()).issubset(set(vpc_tags.items())):
  2633. ---
  2634. >     if vpc_spec_tags and not set(vpc_spec_tags.items()).issubset(set(vpc_tags.items())):
  2635. 327c315
  2636. <         for (key, value) in set(vpc_spec_tags.items()):
  2637. ---
  2638. >         for (key, value) in set(vpc_spec_tags.items()):
  2639. 330c318
  2640. <
  2641. ---
  2642. >      
  2643. 345c333
  2644. <
  2645. ---
  2646. >    
  2647. 347c335
  2648. <
  2649. ---
  2650. >    
  2651. 371c359
  2652. <
  2653. ---
  2654. >    
  2655. 388c376
  2656. <     if len(igws) > 1:
  2657. ---
  2658. >     if len(igws) > 1:
  2659. 422,423c410,411
  2660. <
  2661. <     # Work through each route table and update/create to match dictionary array
  2662. ---
  2663. >    
  2664. > # Work through each route table and update/create to match dictionary array
  2665. 429,430c417,418
  2666. <                 route_kwargs = {}
  2667. <                 if route['gw'] == 'igw':
  2668. ---
  2669. >                 r_gateway = route['gw']
  2670. >                 if r_gateway == 'igw':
  2671. 436,441c424,425
  2672. <                     route_kwargs['gateway_id'] = igw.id
  2673. <                 elif route['gw'].startswith('i-'):
  2674. <                     route_kwargs['instance_id'] = route['gw']
  2675. <                 else:
  2676. <                     route_kwargs['gateway_id'] = route['gw']
  2677. <                 vpc_conn.create_route(new_rt.id, route['dest'], **route_kwargs)
  2678. ---
  2679. >                     r_gateway = igw.id
  2680. >                 vpc_conn.create_route(new_rt.id, route['dest'], r_gateway)
  2681. 473c457
  2682. <
  2683. ---
  2684. >        
  2685. 500c484
  2686. <
  2687. ---
  2688. >    
  2689. 504c488
  2690. <             'cidr': sn.cidr_block,
  2691. ---
  2692. >             'cidr': sn.cidr_block,
  2693. 530c514
  2694. <
  2695. ---
  2696. >    
  2697. 532c516
  2698. <
  2699. ---
  2700. >    
  2701. 578c562
  2702. <             subnets = dict(type='list', default=[]),
  2703. ---
  2704. >             subnets = dict(type='list'),
  2705. 581,582c565,566
  2706. <             resource_tags = dict(type='dict', required=True),
  2707. <             route_tables = dict(type='list', default=[]),
  2708. ---
  2709. >             resource_tags = dict(type='dict'),
  2710. >             route_tables = dict(type='list'),
  2711. 594c578
  2712. <
  2713. ---
  2714. >    
  2715. 596c580
  2716. <     if region:
  2717. ---
  2718. >     if region:
  2719. 599c583
  2720. <                 region,
  2721. ---
  2722. >                 region,
  2723. 607c591
  2724. <
  2725. ---
  2726. >    
  2727. diff -r ansible/ansible/library/cloud/glance_image ansible-1.6.6/library/cloud/glance_image
  2728. 107,112d106
  2729. <    endpoint_type:
  2730. <      description:
  2731. <         - endpoint URL type
  2732. <      choices: [publicURL, internalURL]
  2733. <      required: false
  2734. <      default: publicURL
  2735. 123c117
  2736. <                 container_format=bare
  2737. ---
  2738. >                 container_format=bare
  2739. 136d129
  2740. <
  2741. 143,144c136,137
  2742. <     except Exception, e:
  2743. <         module.fail_json(msg="Error authenticating to the keystone: %s " % e.message)
  2744. ---
  2745. >     except Exception, e:  
  2746. >         module.fail_json(msg = "Error authenticating to the keystone: %s " % e.message)
  2747. 145a139
  2748. >  
  2749. 147,148c141
  2750. <
  2751. < def _get_endpoint(module, client, endpoint_type):
  2752. ---
  2753. > def _get_endpoint(module, client):
  2754. 150c143
  2755. <         endpoint = client.service_catalog.url_for(service_type='image', endpoint_type=endpoint_type)
  2756. ---
  2757. >         endpoint = client.service_catalog.url_for(service_type='image', endpoint_type='publicURL')
  2758. 152c145
  2759. <         module.fail_json(msg="Error getting endpoint for glance: %s" % e.message)
  2760. ---
  2761. >         module.fail_json(msg = "Error getting endpoint for glance: %s" % e.message)
  2762. 155d147
  2763. <
  2764. 159c151
  2765. <     endpoint =_get_endpoint(module, _ksclient, kwargs.get('endpoint_type'))
  2766. ---
  2767. >     endpoint =_get_endpoint(module, _ksclient)
  2768. 166c158
  2769. <         module.fail_json(msg="Error in connecting to glance: %s" % e.message)
  2770. ---
  2771. >         module.fail_json(msg = "Error in connecting to glance: %s" %e.message)
  2772. 169d160
  2773. <
  2774. 175c166
  2775. <         return None
  2776. ---
  2777. >         return None
  2778. 177,178c168
  2779. <         module.fail_json(msg="Error in fetching image list: %s" % e.message)
  2780. <
  2781. ---
  2782. >         module.fail_json(msg = "Error in fetching image list: %s" %e.message)
  2783. 189c179
  2784. <     try:
  2785. ---
  2786. >     try:                
  2787. 200,201c190,191
  2788. <     except Exception, e:
  2789. <         module.fail_json(msg="Error in creating image: %s" % e.message)
  2790. ---
  2791. >     except Exception, e:              
  2792. >         module.fail_json(msg = "Error in creating image: %s" %e.message)                
  2793. 203c193
  2794. <         module.exit_json(changed=True, result=image.status, id=image.id)
  2795. ---
  2796. >         module.exit_json(changed = True, result = image.status, id=image.id)
  2797. 205,206c195
  2798. <         module.fail_json(msg=" The module timed out, please check manually " + image.status)
  2799. <
  2800. ---
  2801. >         module.fail_json(msg = " The module timed out, please check manually " + image.status)
  2802. 209c198
  2803. <     try:
  2804. ---
  2805. >     try:                
  2806. 214,217c203,205
  2807. <         module.fail_json(msg="Error in deleting image: %s" % e.message)
  2808. <     module.exit_json(changed=True, result="Deleted")
  2809. <
  2810. <
  2811. ---
  2812. >         module.fail_json(msg = "Error in deleting image: %s" %e.message)
  2813. >     module.exit_json(changed = True, result = "Deleted")
  2814. >        
  2815. 219c207
  2816. <
  2817. ---
  2818. >    
  2819. 235,238c223,225
  2820. <             timeout           = dict(default=180),
  2821. <             file              = dict(default=None),
  2822. <             endpoint_type     = dict(default='publicURL', choices=['publicURL', 'internalURL']),
  2823. <             state             = dict(default='present', choices=['absent', 'present'])
  2824. ---
  2825. >             timeout           = dict(default=180),
  2826. >             file              = dict(default=None),
  2827. >             state            = dict(default='present', choices=['absent', 'present'])
  2828. 244c231
  2829. <             module.fail_json(msg="Either file or copy_from variable should be set to create the image")
  2830. ---
  2831. >             module.fail_json(msg = "Either file or copy_from variable should be set to create the image")
  2832. 249c236
  2833. <         module.exit_json(changed=False, id=id, result="success")
  2834. ---
  2835. >         module.exit_json(changed = False, id = id, result = "success")
  2836. 254,255c241,242
  2837. <         if not id:
  2838. <             module.exit_json(changed=False, result="Success")
  2839. ---
  2840. >         if not id:      
  2841. >             module.exit_json(changed = False, result = "Success")
  2842. 261a249
  2843. >
  2844. diff -r ansible/ansible/library/cloud/keystone_user ansible-1.6.6/library/cloud/keystone_user
  2845. 340c340
  2846. <                              msg="exception: %s" % e)
  2847. ---
  2848. >                              msg="exception: %s" % e.message)
  2849. 342c342
  2850. <             module.fail_json(msg="exception: %s" % e)
  2851. ---
  2852. >             module.fail_json(msg=e.message)
  2853. diff -r ansible/ansible/library/cloud/linode ansible-1.6.6/library/cloud/linode
  2854. 91c91
  2855. < requirements: [ "linode-python", "pycurl" ]
  2856. ---
  2857. > requirements: [ "linode-python" ]
  2858. 159,165c159,161
  2859. <     import pycurl
  2860. < except ImportError:
  2861. <     print("failed=True msg='pycurl required for this module'")
  2862. <     sys.exit(1)
  2863. <
  2864. <
  2865. < try:
  2866. ---
  2867. >     # linode module raise warning due to ssl - silently ignore them ...
  2868. >     import warnings
  2869. >     warnings.simplefilter("ignore")
  2870. 170d165
  2871. <
  2872. diff -r ansible/ansible/library/cloud/nova_keypair ansible-1.6.6/library/cloud/nova_keypair
  2873. 22c22
  2874. <     from novaclient import exceptions as exc
  2875. ---
  2876. >     from novaclient import exceptions
  2877. 118,121c118
  2878. <                 if module.params['public_key'] and (module.params['public_key'] != key.public_key ):
  2879. <                     module.fail_json(msg = "name {} present but key hash not the same as offered.  Delete key first.".format(key['name']))
  2880. <                 else:
  2881. <                     module.exit_json(changed = False, result = "Key present")            
  2882. ---
  2883. >                 module.exit_json(changed = False, result = "Key present")
  2884. diff -r ansible/ansible/library/cloud/quantum_floating_ip ansible-1.6.6/library/cloud/quantum_floating_ip
  2885. 145d144
  2886. <     subnet_id = None
  2887. 147,149d145
  2888. <         kwargs = {'name': internal_network_name}
  2889. <         networks = neutron.list_networks(**kwargs)
  2890. <         network_id = networks['networks'][0]['id']
  2891. 151,152c147
  2892. <             'network_id': network_id,
  2893. <             'ip_version': 4
  2894. ---
  2895. >             'name': internal_network_name,
  2896. 154,155c149,150
  2897. <         subnets = neutron.list_subnets(**kwargs)
  2898. <         subnet_id = subnets['subnets'][0]['id']
  2899. ---
  2900. >         networks = neutron.list_networks(**kwargs)
  2901. >         subnet_id = networks['networks'][0]['subnets'][0]
  2902. 186c181
  2903. < def _create_floating_ip(neutron, module, port_id, net_id, fixed_ip):
  2904. ---
  2905. > def _create_floating_ip(neutron, module, port_id, net_id):
  2906. 189,190c184
  2907. <             'floating_network_id': net_id,
  2908. <             'fixed_ip_address': fixed_ip
  2909. ---
  2910. >             'floating_network_id': net_id
  2911. 260c254
  2912. <         _create_floating_ip(neutron, module, port_id, net_id, fixed_ip)
  2913. ---
  2914. >         _create_floating_ip(neutron, module, port_id, net_id)
  2915. diff -r ansible/ansible/library/cloud/quantum_subnet ansible-1.6.6/library/cloud/quantum_subnet
  2916. 71,75d70
  2917. <    name:
  2918. <      description:
  2919. <        - The name of the subnet that should be created
  2920. <      required: true
  2921. <      default: None
  2922. diff -r ansible/ansible/library/cloud/rax ansible-1.6.6/library/cloud/rax
  2923. 203c203
  2924. < def server_to_dict(obj):
  2925. ---
  2926. > def pyrax_object_to_dict(obj):
  2927. 219c219
  2928. <            extra_create_args, existing=[]):
  2929. ---
  2930. >            extra_create_args):
  2931. 269c269
  2932. <         instance = server_to_dict(server)
  2933. ---
  2934. >         instance = pyrax_object_to_dict(server)
  2935. 277,279d276
  2936. <     untouched = [server_to_dict(s) for s in existing]
  2937. <     instances = success + untouched
  2938. <
  2939. 283c280
  2940. <         'instances': instances,
  2941. ---
  2942. >         'instances': success + error + timeout,
  2943. 288c285
  2944. <             'instances': [i['id'] for i in instances],
  2945. ---
  2946. >             'instances': [i['id'] for i in success + error + timeout],
  2947. 306c303
  2948. < def delete(module, instance_ids, wait, wait_timeout, kept=[]):
  2949. ---
  2950. > def delete(module, instance_ids, wait, wait_timeout):
  2951. 324c321
  2952. <         instance = server_to_dict(server)
  2953. ---
  2954. >         instance = pyrax_object_to_dict(server)
  2955. 338d334
  2956. <                     instances[instance_id]['rax_status'] = 'DELETED'
  2957. 354,355d349
  2958. <     instances = [server_to_dict(s) for s in kept]
  2959. <
  2960. 359c353
  2961. <         'instances': instances,
  2962. ---
  2963. >         'instances': success + error + timeout,
  2964. 364c358
  2965. <             'instances': [i['id'] for i in instances],
  2966. ---
  2967. >             'instances': [i['id'] for i in success + error + timeout],
  2968. 394a389,391
  2969. >     for key, value in meta.items():
  2970. >         meta[key] = repr(value)
  2971. >
  2972. 401,409d397
  2973. <     # Normalize and ensure all metadata values are strings
  2974. <     for k, v in meta.items():
  2975. <         if isinstance(v, list):
  2976. <             meta[k] = ','.join(['%s' % i for i in v])
  2977. <         elif isinstance(v, dict):
  2978. <             meta[k] = json.dumps(v)
  2979. <         elif not isinstance(v, basestring):
  2980. <             meta[k] = '%s' % v
  2981. <
  2982. 516d503
  2983. <                     kept = servers[:count]
  2984. 521,522c508
  2985. <                     delete(module, instance_ids, wait, wait_timeout,
  2986. <                            kept=kept)
  2987. ---
  2988. >                     delete(module, instance_ids, wait, wait_timeout)
  2989. 533,539c519
  2990. <                     instances = []
  2991. <                     instance_ids = []
  2992. <                     for server in servers:
  2993. <                         instances.append(server_to_dict(server))
  2994. <                         instance_ids.append(server.id)
  2995. <                     module.exit_json(changed=False, action=None,
  2996. <                                      instances=instances,
  2997. ---
  2998. >                     module.exit_json(changed=False, action=None, instances=[],
  2999. 541c521
  3000. <                                      instance_ids={'instances': instance_ids,
  3001. ---
  3002. >                                      instance_ids={'instances': [],
  3003. 591c571
  3004. <                         instances.append(server_to_dict(server))
  3005. ---
  3006. >                         instances.append(pyrax_object_to_dict(server))
  3007. 604,605c584
  3008. <                wait, wait_timeout, disk_config, group, nics, extra_create_args,
  3009. <                existing=servers)
  3010. ---
  3011. >                wait, wait_timeout, disk_config, group, nics, extra_create_args)
  3012. diff -r ansible/ansible/library/cloud/rax_cbs ansible-1.6.6/library/cloud/rax_cbs
  3013. 144,145d143
  3014. <         except pyrax.exc.NotFound:
  3015. <             pass
  3016. diff -r ansible/ansible/library/cloud/rax_dns ansible-1.6.6/library/cloud/rax_dns
  3017. 47,50d46
  3018. < notes:
  3019. <   - "It is recommended that plays utilizing this module be run with C(serial: 1)
  3020. <     to avoid exceeding the API request limit imposed by the Rackspace CloudDNS
  3021. <     API"
  3022. 129c125
  3023. <                 module.fail_json(msg='%s' % e.message)
  3024. ---
  3025. >                 module.fail_json('%s' % e.message)
  3026. diff -r ansible/ansible/library/cloud/rax_dns_record ansible-1.6.6/library/cloud/rax_dns_record
  3027. 70,73d69
  3028. < notes:
  3029. <   - "It is recommended that plays utilizing this module be run with C(serial: 1)
  3030. <     to avoid exceeding the API request limit imposed by the Rackspace CloudDNS
  3031. <     API"
  3032. Only in ansible/ansible/library/cloud: rax_meta
  3033. Only in ansible/ansible/library/cloud: rax_scaling_group
  3034. Only in ansible/ansible/library/cloud: rax_scaling_policy
  3035. diff -r ansible/ansible/library/cloud/rds ansible-1.6.6/library/cloud/rds
  3036. 62a63
  3037. >     choices: [ 'db.t1.micro', 'db.m1.small', 'db.m1.medium', 'db.m1.large', 'db.m1.xlarge', 'db.m2.xlarge', 'db.m2.2xlarge', 'db.m2.4xlarge', 'db.m3.medium', 'db.m3.large', 'db.m3.xlarge', 'db.m3.2xlarge', 'db.cr1.8xlarge' ]
  3038. 292c293
  3039. <             instance_type     = dict(aliases=['type'], required=False),
  3040. ---
  3041. >             instance_type     = dict(aliases=['type'], choices=['db.t1.micro', 'db.m1.small', 'db.m1.medium', 'db.m1.large', 'db.m1.xlarge', 'db.m2.xlarge', 'db.m2.2xlarge', 'db.m2.4xlarge', 'db.m3.medium', 'db.m3.large', 'db.m3.xlarge', 'db.m3.2xlarge', 'db.cr1.8xlarge'], required=False),
  3042. 302c303
  3043. <             vpc_security_groups = dict(type='list', required=False),
  3044. ---
  3045. >             vpc_security_groups = dict(required=False),
  3046. 467,470c468
  3047. <         groups_list = []
  3048. <         for x in vpc_security_groups:
  3049. <             groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x))
  3050. <         params["vpc_security_groups"] = groups_list
  3051. ---
  3052. >         params["vpc_security_groups"] = vpc_security_groups.split(',')
  3053. 545,550d542
  3054. <
  3055. <                 # The name of the database has now changed, so we have
  3056. <                 # to force result to contain the new instance, otherwise
  3057. <                 # the call below to get_current_resource will fail since it
  3058. <                 # will be looking for the old instance name.
  3059. <                 result.id = new_instance_name
  3060. 629,632d620
  3061. <         if resource.vpc_security_groups is not None:
  3062. <             d["vpc_security_groups"] = ','.join(x.vpc_group for x in resource.vpc_security_groups)
  3063. <         else:
  3064. <             d["vpc_security_groups"] = None
  3065. 636d623
  3066. <         d["vpc_security_groups"] = None
  3067. diff -r ansible/ansible/library/cloud/rds_param_group ansible-1.6.6/library/cloud/rds_param_group
  3068. 162,170c162,165
  3069. <             try:
  3070. <                 for modifier in INT_MODIFIERS.keys():
  3071. <                     if value.endswith(modifier):
  3072. <                         converted_value = int(value[:-1]) * INT_MODIFIERS[modifier]
  3073. <                 converted_value = int(converted_value)
  3074. <             except ValueError:
  3075. <                 # may be based on a variable (ie. {foo*3/4}) so
  3076. <                 # just pass it on through to boto
  3077. <                 converted_value = str(value)
  3078. ---
  3079. >             for modifier in INT_MODIFIERS.keys():
  3080. >                 if value.endswith(modifier):
  3081. >                     converted_value = int(value[:-1]) * INT_MODIFIERS[modifier]
  3082. >             converted_value = int(converted_value)
  3083. 198,207c193
  3084. <             try:
  3085. <                 old_value = param.value
  3086. <             except ValueError:
  3087. <                 # some versions of boto have problems with retrieving
  3088. <                 # integer values from params that may have their value
  3089. <                 # based on a variable (ie. {foo*3/4}), so grab it in a
  3090. <                 # way that bypasses the property functions
  3091. <                 old_value = param._value
  3092. <
  3093. <             if old_value != new_value:
  3094. ---
  3095. >             if param.value != new_value:
  3096. diff -r ansible/ansible/library/cloud/vsphere_guest ansible-1.6.6/library/cloud/vsphere_guest
  3097. 91,96d90
  3098. <   vm_hw_version:
  3099. <     description:
  3100. <       - Desired hardware version identifier (for example, "vmx-08" for vms that needs to be managed with vSphere Client). Note that changing hardware version of existing vm is not supported.
  3101. <     required: false
  3102. <     default: null
  3103. <     version_added: "1.7"
  3104. 505c499
  3105. <         if int(vm_hardware['memory_mb']) != vm.properties.config.hardware.memoryMB:
  3106. ---
  3107. >         if vm_hardware['memory_mb'] != vm.properties.config.hardware.memoryMB:
  3108. 513c507
  3109. <                     elif int(vm_hardware['memory_mb']) < vm.properties.config.hardware.memoryMB:
  3110. ---
  3111. >                     elif vm_hardware['memory_mb'] < vm.properties.config.hardware.memoryMB:
  3112. 523c517
  3113. <                     elif int(vm_hardware['memory_mb']) < vm.properties.config.hardware.memoryMB:
  3114. ---
  3115. >                     elif vm_hardware['memory_mb'] < vm.properties.config.hardware.memoryMB:
  3116. 534c528
  3117. <         if int(vm_hardware['num_cpus']) != vm.properties.config.hardware.numCPU:
  3118. ---
  3119. >         if vm_hardware['num_cpus'] != vm.properties.config.hardware.numCPU:
  3120. 542c536
  3121. <                     elif int(vm_hardware['num_cpus']) < vm.properties.config.hardware.numCPU:
  3122. ---
  3123. >                     elif vm_hardware['num_cpus'] < vm.properties.config.hardware.numCPU:
  3124. 553c547
  3125. <                     elif int(vm_hardware['num_cpus']) < vm.properties.config.hardware.numCPU:
  3126. ---
  3127. >                     elif vm_hardware['num_cpus'] < vm.properties.config.hardware.numCPU:
  3128. 602c596
  3129. < def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest, vm_extra_config, vm_hardware, vm_disk, vm_nic, vm_hw_version, state):
  3130. ---
  3131. > def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest, vm_extra_config, vm_hardware, vm_disk, vm_nic, state):
  3132. 607,611c601,604
  3133. <     dclist = [k for k,
  3134. <              v in vsphere_client.get_datacenters().items() if v == datacenter]
  3135. <     if dclist:
  3136. <         dcmor=dclist[0]
  3137. <     else:
  3138. ---
  3139. >     dcmor = [k for k,
  3140. >              v in vsphere_client.get_datacenters().items() if v == datacenter][0]
  3141. >
  3142. >     if dcmor is None:
  3143. 706,707d698
  3144. <     if vm_hw_version:
  3145. <         config.set_element_version(vm_hw_version)
  3146. 714c705
  3147. <     if 'notes' in vm_extra_config:
  3148. ---
  3149. >     if vm_extra_config['notes'] is not None:
  3150. 737c728
  3151. <                 disksize = int(vm_disk[disk]['size_gb'])
  3152. ---
  3153. >                 disksize = vm_disk[disk]['size_gb']
  3154. 740c731
  3155. <             except (KeyError, ValueError):
  3156. ---
  3157. >             except KeyError:
  3158. 742c733,735
  3159. <                 module.fail_json(msg="Error on %s definition. size needs to be specified as an integer." % disk)
  3160. ---
  3161. >                 module.fail_json(
  3162. >                     msg="Error on %s definition. size needs to be"
  3163. >                     " specified." % disk)
  3164. 826,827c819,821
  3165. <         # We always need to get the vm because we are going to gather facts
  3166. <         vm = vsphere_client.get_vm_by_name(guest)
  3167. ---
  3168. >         vm = None
  3169. >         if vm_extra_config or state in ['powered_on', 'powered_off']:
  3170. >             vm = vsphere_client.get_vm_by_name(guest)
  3171. 1074d1067
  3172. <             vm_hw_version=dict(required=False, default=None, type='str'),
  3173. 1111d1103
  3174. <     vm_hw_version = module.params['vm_hw_version']
  3175. 1213d1204
  3176. <                 vm_hw_version=vm_hw_version,
  3177. diff -r ansible/ansible/library/commands/command ansible-1.6.6/library/commands/command
  3178. 80c80
  3179. < # Example from Ansible Playbooks.
  3180. ---
  3181. > # Example from Ansible Playbooks
  3182. 83c83
  3183. < # Run the command if the specified file does not exist.
  3184. ---
  3185. > # Run the command if the specified file does not exist
  3186. 85,92d84
  3187. <
  3188. < # You can also use the 'args' form to provide the options. This command
  3189. < # will change the working directory to somedir/ and will only run when
  3190. < # /path/to/database doesn't exist.
  3191. < - command: /usr/bin/make_database.sh arg1 arg2
  3192. <   args:
  3193. <     chdir: somedir/
  3194. <     creates: /path/to/database
  3195. diff -r ansible/ansible/library/commands/shell ansible-1.6.6/library/commands/shell
  3196. 56c56
  3197. < # file on the remote.
  3198. ---
  3199. > # file on the remote
  3200. 58,68d57
  3201. <
  3202. < # Change the working directory to somedir/ before executing the command.
  3203. < - shell: somescript.sh >> somelog.txt chdir=somedir/
  3204. <
  3205. < # You can also use the 'args' form to provide the options. This command
  3206. < # will change the working directory to somedir/ and will only run when
  3207. < # somedir/somelog.txt doesn't exist.
  3208. < - shell: somescript.sh >> somelog.txt
  3209. <   args:
  3210. <     chdir: somedir/
  3211. <     creates: somelog.txt
  3212. diff -r ansible/ansible/library/database/mysql_db ansible-1.6.6/library/database/mysql_db
  3213. 53c53
  3214. <       - Port of the MySQL server. Requires login_host be defined as other then localhost if login_port is used
  3215. ---
  3216. >       - Port of the MySQL server
  3217. 143,145d142
  3218. <     if not os.path.exists(target):
  3219. <         return module.fail_json(msg="target %s does not exist on the host" % target)
  3220. <
  3221. 154,169c151
  3222. <         gunzip_path = module.get_bin_path('gunzip')
  3223. <         if gunzip_path:
  3224. <             rc, stdout, stderr = module.run_command('%s %s' % (gunzip_path, target))
  3225. <             if rc != 0:
  3226. <                 return rc, stdout, stderr
  3227. <             cmd += " < %s" % pipes.quote(os.path.splitext(target)[0])
  3228. <             rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True)
  3229. <             if rc != 0:
  3230. <                 return rc, stdout, stderr
  3231. <             gzip_path = module.get_bin_path('gzip')
  3232. <             if gzip_path:
  3233. <                 rc, stdout, stderr = module.run_command('%s %s' % (gzip_path, os.path.splitext(target)[0]))
  3234. <             else:
  3235. <                 module.fail_json(msg="gzip command not found")
  3236. <         else:
  3237. <             module.fail_json(msg="gunzip command not found")
  3238. ---
  3239. >         cmd = 'gunzip < ' + pipes.quote(target) + ' | ' + cmd
  3240. 171,186c153
  3241. <         bunzip2_path = module.get_bin_path('bunzip2')
  3242. <         if bunzip2_path:
  3243. <             rc, stdout, stderr = module.run_command('%s %s' % (bunzip2_path, target))
  3244. <             if rc != 0:
  3245. <                 return rc, stdout, stderr
  3246. <             cmd += " < %s" % pipes.quote(os.path.splitext(target)[0])
  3247. <             rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True)
  3248. <             if rc != 0:
  3249. <                 return rc, stdout, stderr
  3250. <             bzip2_path = module.get_bin_path('bzip2')
  3251. <             if bzip2_path:
  3252. <                 rc, stdout, stderr = module.run_command('%s %s' % (bzip2_path, os.path.splitext(target)[0]))
  3253. <             else:
  3254. <                 module.fail_json(msg="bzip2 command not found")
  3255. <         else:
  3256. <             module.fail_json(msg="bunzip2 command not found")
  3257. ---
  3258. >         cmd = 'bunzip2 < ' + pipes.quote(target) + ' | ' + cmd
  3259. 189c156
  3260. <         rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True)
  3261. ---
  3262. >     rc, stdout, stderr = module.run_command(cmd, use_unsafe_shell=True)
  3263. 268c235
  3264. <             name=dict(required=True, aliases=['db']),
  3265. ---
  3266. >             db=dict(required=True, aliases=['name']),
  3267. 279c246
  3268. <     db = module.params["name"]
  3269. ---
  3270. >     db = module.params["db"]
  3271. 311,312d277
  3272. <         elif module.params["login_port"] != "3306" and module.params["login_host"] == "localhost":
  3273. <             module.fail_json(msg="login_host is required when login_port is defined, login_host cannot be localhost when login_port is defined")
  3274. 317,321c282
  3275. <         if "Unknown database" in str(e):
  3276. <                 errno, errstr = e.args
  3277. <                 module.fail_json(msg="ERROR: %s %s" % (errno, errstr))
  3278. <         else:
  3279. <                 module.fail_json(msg="unable to connect, check login_user and login_password are correct, or alternatively check ~/.my.cnf contains credentials")
  3280. ---
  3281. >         module.fail_json(msg="unable to connect, check login_user and login_password are correct, or alternatively check ~/.my.cnf contains credentials")
  3282. 326,329c287
  3283. <             try:
  3284. <                 changed = db_delete(cursor, db)
  3285. <             except Exception, e:
  3286. <                 module.fail_json(msg="error deleting database: " + str(e))
  3287. ---
  3288. >             changed = db_delete(cursor, db)
  3289. 350,353c308
  3290. <             try:
  3291. <                 changed = db_create(cursor, db, encoding, collation)
  3292. <             except Exception, e:
  3293. <                 module.fail_json(msg="error creating database: " + str(e))
  3294. ---
  3295. >             changed = db_create(cursor, db, encoding, collation)
  3296. diff -r ansible/ansible/library/database/mysql_user ansible-1.6.6/library/database/mysql_user
  3297. 123,125d122
  3298. < # Specify grants composed of more than one word
  3299. < - mysql_user: name=replication password=12345 priv=*.*:"REPLICATION CLIENT" state=present
  3300. <
  3301. diff -r ansible/ansible/library/database/mysql_variables ansible-1.6.6/library/database/mysql_variables
  3302. 59,60c59,60
  3303. < # Check for sync_binlog setting
  3304. < - mysql_variables: variable=sync_binlog
  3305. ---
  3306. > # Check for sync_binary_log setting
  3307. > - mysql_variables: variable=sync_binary_log
  3308. diff -r ansible/ansible/library/database/postgresql_user ansible-1.6.6/library/database/postgresql_user
  3309. 47c47
  3310. <       - "When passing an encrypted password, the encrypted parameter must also be true, and it must be generated with the format C('str[\\"md5\\"] + md5[ password + username ]'), resulting in a total of 35 characters.  An easy way to do this is: C(echo \\"md5`echo -n \\"verysecretpasswordJOE\\" | md5`\\")."
  3311. ---
  3312. >       - "When passing an encrypted password it must be generated with the format C('str[\\"md5\\"] + md5[ password + username ]'), resulting in a total of 35 characters.  An easy way to do this is: C(echo \\"md5`echo -n \\"verysecretpasswordJOE\\" | md5`\\")."
  3313. diff -r ansible/ansible/library/files/acl ansible-1.6.6/library/files/acl
  3314. 66c66
  3315. <       - the entity type of the ACL to apply, see setfacl documentation for more info.
  3316. ---
  3317. >       - if the target is a directory, setting this to yes will make it the default acl for entities created inside the directory. It causes an error if name is a file.
  3318. diff -r ansible/ansible/library/files/assemble ansible-1.6.6/library/files/assemble
  3319. 77c77
  3320. <         all files are assembled. All "\\" (backslash) must be escaped as
  3321. ---
  3322. >         all files are assembled. All "\" (backslash) must be escaped as
  3323. 195c195
  3324. <     changed = module.set_fs_attributes_if_different(file_args, changed)
  3325. ---
  3326. >     changed = module.set_file_attributes_if_different(file_args, changed)
  3327. diff -r ansible/ansible/library/files/copy ansible-1.6.6/library/files/copy
  3328. 86d85
  3329. < extends_documentation_fragment: files
  3330. 127c126
  3331. <         changed = module.set_fs_attributes_if_different(directory_args, changed)
  3332. ---
  3333. >         changed = module.set_directory_attributes_if_different(directory_args, changed)
  3334. 193,201d191
  3335. <             try:
  3336. <                 # os.path.exists() can return false in some
  3337. <                 # circumstances where the directory does not have
  3338. <                 # the execute bit for the current user set, in
  3339. <                 # which case the stat() call will raise an OSError
  3340. <                 os.stat(os.path.dirname(dest))
  3341. <             except OSError, e:
  3342. <                 if "permission denied" in str(e).lower():
  3343. <                     module.fail_json(msg="Destination directory %s is not accessible" % (os.path.dirname(dest)))
  3344. 237c227
  3345. <     res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed'])
  3346. ---
  3347. >     res_args['changed'] = module.set_file_attributes_if_different(file_args, res_args['changed'])
  3348. diff -r ansible/ansible/library/files/file ansible-1.6.6/library/files/file
  3349. 167a168
  3350. >             os.makedirs(path)
  3351. 169,176d169
  3352. <             curpath = ''
  3353. <             for dirname in path.split('/'):
  3354. <                 curpath = '/'.join([curpath, dirname])
  3355. <                 if not os.path.exists(curpath):
  3356. <                     os.mkdir(curpath)
  3357. <                     tmp_file_args = file_args.copy()
  3358. <                     tmp_file_args['path']=curpath
  3359. <                     changed = module.set_fs_attributes_if_different(tmp_file_args, changed)
  3360. 206c199
  3361. <                 module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, path))
  3362. ---
  3363. >                 module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, src))
  3364. 211c204
  3365. <             module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, path))
  3366. ---
  3367. >             module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, src))
  3368. 253,255d245
  3369. <
  3370. <         if module.check_mode and not os.path.exists(path):
  3371. <             module.exit_json(dest=path, src=src, changed=changed)
  3372. diff -r ansible/ansible/library/files/ini_file ansible-1.6.6/library/files/ini_file
  3373. 98d97
  3374. <     cp.optionxform = identity
  3375. 155,167d153
  3376. < # identity
  3377. <
  3378. < def identity(arg):
  3379. <     """
  3380. <     This function simply returns its argument. It serves as a
  3381. <     replacement for ConfigParser.optionxform, which by default
  3382. <     changes arguments to lower case. The identity function is a
  3383. <     better choice than str() or unicode(), because it is
  3384. <     encoding-agnostic.
  3385. <     """
  3386. <     return arg
  3387. <
  3388. < # ==============================================================
  3389. 196c182
  3390. <     changed = module.set_fs_attributes_if_different(file_args, changed)
  3391. ---
  3392. >     changed = module.set_file_attributes_if_different(file_args, changed)
  3393. diff -r ansible/ansible/library/files/lineinfile ansible-1.6.6/library/files/lineinfile
  3394. 5d4
  3395. < # (c) 2014, Ahti Kitsik <[email protected]>
  3396. 22d20
  3397. < import pipes
  3398. 30c28
  3399. < author: Daniel Hokka Zakrisson, Ahti Kitsik
  3400. ---
  3401. > author: Daniel Hokka Zakrisson
  3402. 115c113
  3403. <        - validation to run before copying into place. The command is passed
  3404. ---
  3405. >        - validation to run before copying into place. The command is passed
  3406. 167c165
  3407. <         module.atomic_move(tmpfile, os.path.realpath(dest))
  3408. ---
  3409. >         module.atomic_move(tmpfile, dest)
  3410. 172c170
  3411. <     if module.set_fs_attributes_if_different(file_args, False):
  3412. ---
  3413. >     if module.set_file_attributes_if_different(file_args, False):
  3414. 256,260d253
  3415. <
  3416. <         # If the file is not empty then ensure there's a newline before the added line
  3417. <         if len(lines)>0 and not (lines[-1].endswith('\n') or lines[-1].endswith('\r')):
  3418. <             lines.append(os.linesep)
  3419. <
  3420. 363,370c356,358
  3421. <         # Replace escape sequences like '\n' while being sure
  3422. <         # not to replace octal escape sequences (\ooo) since they
  3423. <         # match the backref syntax
  3424. <         if backrefs:
  3425. <             line = re.sub(r'(\\[0-9]{1,3})', r'\\\1', params['line'])
  3426. <         else:
  3427. <             line = params['line']
  3428. <         line = module.safe_eval(pipes.quote(line))
  3429. ---
  3430. >         # Replace the newline character with an actual newline. Don't replace
  3431. >       # escaped \\n, hence sub and not str.replace.
  3432. >         line = re.sub(r'\n', os.linesep, params['line'])
  3433. diff -r ansible/ansible/library/files/replace ansible-1.6.6/library/files/replace
  3434. 144c144
  3435. <     if result[1] > 0 and contents != result[0]:
  3436. ---
  3437. >     if result[1] > 0:
  3438. diff -r ansible/ansible/library/files/synchronize ansible-1.6.6/library/files/synchronize
  3439. 224,225c224,225
  3440. <     source = '"' + module.params['src'] + '"'
  3441. <     dest = '"' + module.params['dest'] + '"'
  3442. ---
  3443. >     source = module.params['src']
  3444. >     dest = module.params['dest']
  3445. diff -r ansible/ansible/library/files/unarchive ansible-1.6.6/library/files/unarchive
  3446. 123,124c123,124
  3447. <         cmd = '%s -x%sf "%s"' % (self.cmd_path, self.zipflag, self.src)
  3448. <         rc, out, err = self.module.run_command(cmd, cwd=self.dest)
  3449. ---
  3450. >         cmd = '%s -C "%s" -x%sf "%s"' % (self.cmd_path, self.dest, self.zipflag, self.src)
  3451. >         rc, out, err = self.module.run_command(cmd)
  3452. 237,239c237
  3453. <         res_args['extract_results'] = handler.unarchive()
  3454. <         if res_args['extract_results']['rc'] != 0:
  3455. <             module.fail_json(msg="failed to unpack %s to %s" % (src, dest), **res_args)
  3456. ---
  3457. >         results = handler.unarchive()
  3458. diff -r ansible/ansible/library/monitoring/monit ansible-1.6.6/library/monitoring/monit
  3459. 49a50,51
  3460. > import pipes
  3461. >
  3462. 67,68d68
  3463. <         if rc != 0:
  3464. <             module.fail_json(msg='monit reload failed', stdout=out, stderr=err)
  3465. 71,89c71,72
  3466. <     def status():
  3467. <         """Return the status of the process in monit, or the empty string if not present."""
  3468. <         rc, out, err = module.run_command('%s summary' % MONIT, check_rc=True)
  3469. <         for line in out.split('\n'):
  3470. <             # Sample output lines:
  3471. <             # Process 'name'    Running
  3472. <             # Process 'name'    Running - restart pending
  3473. <             parts = line.lower().split()
  3474. <             if len(parts) > 2 and parts[0] == 'process' and parts[1] == "'%s'" % name:
  3475. <                 return ' '.join(parts[2:])
  3476. <         else:
  3477. <             return ''
  3478. <
  3479. <     def run_command(command):
  3480. <         """Runs a monit command, and returns the new status."""
  3481. <         module.run_command('%s %s %s' % (MONIT, command, name), check_rc=True)
  3482. <         return status()
  3483. <
  3484. <     present = status() != ''
  3485. ---
  3486. >     rc, out, err = module.run_command('%s summary | grep "Process \'%s\'"' % (MONIT, pipes.quote(name)), use_unsafe_shell=True)
  3487. >     present = name in out
  3488. 98,101c81,83
  3489. <             status = run_command('reload')
  3490. <             if status == '':
  3491. <                 module.fail_json(msg='%s process not configured with monit' % name, name=name, state=state)
  3492. <             else:
  3493. ---
  3494. >             module.run_command('%s reload' % MONIT, check_rc=True)
  3495. >             rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, pipes.quote(name)), use_unsafe_shell=True)
  3496. >             if name in out:
  3497. 102a85,87
  3498. >             else:
  3499. >                 module.fail_json(msg=out, name=name, state=state)
  3500. >
  3501. 105c90,94
  3502. <     running = 'running' in status()
  3503. ---
  3504. >     rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, pipes.quote(name)), use_unsafe_shell=True)
  3505. >     running = 'running' in out.lower()
  3506. >
  3507. >     if running and (state == 'started' or state == 'monitored'):
  3508. >         module.exit_json(changed=False, name=name, state=state)
  3509. 107c96
  3510. <     if running and state in ['started', 'monitored']:
  3511. ---
  3512. >     if running and state == 'monitored':
  3513. 113,114c102,104
  3514. <         status = run_command('stop')
  3515. <         if status in ['not monitored'] or 'stop pending' in status:
  3516. ---
  3517. >         module.run_command('%s stop %s' % (MONIT, name))
  3518. >         rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, pipes.quote(name)), use_unsafe_shell=True)
  3519. >         if 'not monitored' in out.lower() or 'stop pending' in out.lower():
  3520. 116c106
  3521. <         module.fail_json(msg='%s process not stopped' % name, status=status)
  3522. ---
  3523. >         module.fail_json(msg=out)
  3524. 121,122c111,114
  3525. <         status = run_command('unmonitor')
  3526. <         if status in ['not monitored']:
  3527. ---
  3528. >         module.run_command('%s unmonitor %s' % (MONIT, name))
  3529. >         # FIXME: DRY FOLKS!
  3530. >         rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, pipes.quote(name)), use_unsafe_shell=True)
  3531. >         if 'not monitored' in out.lower():
  3532. 124c116
  3533. <         module.fail_json(msg='%s process not unmonitored' % name, status=status)
  3534. ---
  3535. >         module.fail_json(msg=out)
  3536. 129,130c121,123
  3537. <         status = run_command('restart')
  3538. <         if status in ['initializing', 'running'] or 'restart pending' in status:
  3539. ---
  3540. >         module.run_command('%s restart %s' % (MONIT, name))
  3541. >         rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, name))
  3542. >         if 'initializing' in out.lower() or 'restart pending' in out.lower():
  3543. 132c125
  3544. <         module.fail_json(msg='%s process not restarted' % name, status=status)
  3545. ---
  3546. >         module.fail_json(msg=out)
  3547. 137,138c130,132
  3548. <         status = run_command('start')
  3549. <         if status in ['initializing', 'running'] or 'start pending' in status:
  3550. ---
  3551. >         module.run_command('%s start %s' % (MONIT, name))
  3552. >         rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, name))
  3553. >         if 'initializing' in out.lower() or 'start pending' in out.lower():
  3554. 140c134
  3555. <         module.fail_json(msg='%s process not started' % name, status=status)
  3556. ---
  3557. >         module.fail_json(msg=out)
  3558. 145,146c139,141
  3559. <         status = run_command('monitor')
  3560. <         if status not in ['not monitored']:
  3561. ---
  3562. >         module.run_command('%s monitor %s' % (MONIT, name))
  3563. >         rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, name))
  3564. >         if 'initializing' in out.lower() or 'start pending' in out.lower():
  3565. 148c143
  3566. <         module.fail_json(msg='%s process not monitored' % name, status=status)
  3567. ---
  3568. >         module.fail_json(msg=out)
  3569. Only in ansible/ansible/library/monitoring: stackdriver
  3570. diff -r ansible/ansible/library/net_infrastructure/bigip_facts ansible-1.6.6/library/net_infrastructure/bigip_facts
  3571. 108d107
  3572. <     from suds import MethodNotFound
  3573. 116a116
  3574. > from suds import MethodNotFound
  3575. 1583c1583
  3576. <         module.fail_json(msg="the python suds and bigsuds modules is required")
  3577. ---
  3578. >         module.fail_json(msg="the python bigsuds module is required")
  3579. diff -r ansible/ansible/library/net_infrastructure/bigip_monitor_http ansible-1.6.6/library/net_infrastructure/bigip_monitor_http
  3580. 229,237c229
  3581. <     try:
  3582. <         return str_property == api.LocalLB.Monitor.get_template_string_property([monitor], [str_property['type']])[0]
  3583. <     except bigsuds.OperationFailed, e:
  3584. <         # happens in check mode if not created yet
  3585. <         if "was not found" in str(e):
  3586. <             return True
  3587. <         else:
  3588. <             # genuine exception
  3589. <             raise
  3590. ---
  3591. >     return str_property == api.LocalLB.Monitor.get_template_string_property([monitor], [str_property['type']])[0]
  3592. 247,256c239
  3593. <     try:
  3594. <         return int_property == api.LocalLB.Monitor.get_template_integer_property([monitor], [int_property['type']])[0]
  3595. <     except bigsuds.OperationFailed, e:
  3596. <         # happens in check mode if not created yet
  3597. <         if "was not found" in str(e):
  3598. <             return True
  3599. <         else:
  3600. <             # genuine exception
  3601. <             raise
  3602. <
  3603. ---
  3604. >     return int_property == api.LocalLB.Monitor.get_template_integer_property([monitor], [int_property['type']])[0]
  3605. diff -r ansible/ansible/library/net_infrastructure/bigip_monitor_tcp ansible-1.6.6/library/net_infrastructure/bigip_monitor_tcp
  3606. 248,257c248
  3607. <     try:
  3608. <         return str_property == api.LocalLB.Monitor.get_template_string_property([monitor], [str_property['type']])[0]
  3609. <     except bigsuds.OperationFailed, e:
  3610. <         # happens in check mode if not created yet
  3611. <         if "was not found" in str(e):
  3612. <             return True
  3613. <         else:
  3614. <             # genuine exception
  3615. <             raise
  3616. <     return True
  3617. ---
  3618. >     return str_property == api.LocalLB.Monitor.get_template_string_property([monitor], [str_property['type']])[0]
  3619. 267,276c258
  3620. <     try:
  3621. <         return int_property == api.LocalLB.Monitor.get_template_integer_property([monitor], [int_property['type']])[0]
  3622. <     except bigsuds.OperationFailed, e:
  3623. <         # happens in check mode if not created yet
  3624. <         if "was not found" in str(e):
  3625. <             return True
  3626. <         else:
  3627. <             # genuine exception
  3628. <             raise
  3629. <     return True
  3630. ---
  3631. >     return int_property == api.LocalLB.Monitor.get_template_integer_property([monitor], [int_property['type']])[0]
  3632. diff -r ansible/ansible/library/net_infrastructure/openvswitch_bridge ansible-1.6.6/library/net_infrastructure/openvswitch_bridge
  3633. 4,7d3
  3634. < # (c) 2013, David Stygstra <[email protected]>
  3635. < #
  3636. < # This file is part of Ansible
  3637. < #
  3638. 25d20
  3639. < author: David Stygstra
  3640. diff -r ansible/ansible/library/net_infrastructure/openvswitch_port ansible-1.6.6/library/net_infrastructure/openvswitch_port
  3641. 4,7d3
  3642. < # (c) 2013, David Stygstra <[email protected]>
  3643. < #
  3644. < # This file is part of Ansible
  3645. < #
  3646. 25d20
  3647. < author: David Stygstra
  3648. diff -r ansible/ansible/library/network/get_url ansible-1.6.6/library/network/get_url
  3649. 286c286
  3650. <         if stripped_sha256sum.lower() != destination_checksum:
  3651. ---
  3652. >         if stripped_sha256sum != destination_checksum:
  3653. 296c296
  3654. <     changed = module.set_fs_attributes_if_different(file_args, changed)
  3655. ---
  3656. >     changed = module.set_file_attributes_if_different(file_args, changed)
  3657. diff -r ansible/ansible/library/network/uri ansible-1.6.6/library/network/uri
  3658. 417c417
  3659. <             changed = module.set_fs_attributes_if_different(file_args, changed)
  3660. ---
  3661. >             changed = module.set_file_attributes_if_different(file_args, changed)
  3662. Only in ansible-1.6.6/library/notification: stackdriver
  3663. diff -r ansible/ansible/library/packaging/apt ansible-1.6.6/library/packaging/apt
  3664. 93c93
  3665. <        - Path to a .deb package on the remote machine.
  3666. ---
  3667. >        - Path to a local .deb package file to install.
  3668. 128c128
  3669. < # Only run "update_cache=yes" if the last one is more than 3600 seconds ago
  3670. ---
  3671. > # Only run "update_cache=yes" if the last one is more than more than 3600 seconds ago
  3672. 370c370
  3673. < def upgrade(m, mode="yes", force=False, default_release=None,
  3674. ---
  3675. > def upgrade(m, mode="yes", force=False,
  3676. 406,409d405
  3677. <
  3678. <     if default_release:
  3679. <         cmd += " -t '%s'" % (default_release,)
  3680. <
  3681. 424c420
  3682. <             package = dict(default=None, aliases=['pkg', 'name'], type='list'),
  3683. ---
  3684. >             package = dict(default=None, aliases=['pkg', 'name']),
  3685. 504,505c500
  3686. <             upgrade(module, p['upgrade'], force_yes,
  3687. <                     p['default_release'], dpkg_options)
  3688. ---
  3689. >             upgrade(module, p['upgrade'], force_yes, dpkg_options)
  3690. 514c509
  3691. <         packages = p['package']
  3692. ---
  3693. >         packages = p['package'].split(',')
  3694. diff -r ansible/ansible/library/packaging/apt_key ansible-1.6.6/library/packaging/apt_key
  3695. 156d155
  3696. <
  3697. 159,161d157
  3698. <         if info['status'] != 200:
  3699. <             module.fail_json(msg="Failed to download key at %s: %s" % (url, info['msg']))
  3700. <
  3701. diff -r ansible/ansible/library/packaging/composer ansible-1.6.6/library/packaging/composer
  3702. 88c88
  3703. < - composer: working_dir=/path/to/project
  3704. ---
  3705. > - composer: command=install working_dir=/path/to/project
  3706. diff -r ansible/ansible/library/packaging/gem ansible-1.6.6/library/packaging/gem
  3707. 94c94
  3708. <         return module.params['executable'].split(' ')
  3709. ---
  3710. >         return module.params['executable']
  3711. 96c96
  3712. <         return [ module.get_bin_path('gem', True) ]
  3713. ---
  3714. >         return module.get_bin_path('gem', True)
  3715. 99c99
  3716. <     cmd = get_rubygems_path(module) + [ '--version' ]
  3717. ---
  3718. >     cmd = [ get_rubygems_path(module), '--version' ]
  3719. 110c110
  3720. <     cmd = get_rubygems_path(module)
  3721. ---
  3722. >     cmd = [ get_rubygems_path(module) ]
  3723. 147c147
  3724. <     cmd = get_rubygems_path(module)
  3725. ---
  3726. >     cmd = [ get_rubygems_path(module) ]
  3727. 168c168
  3728. <     cmd = get_rubygems_path(module)
  3729. ---
  3730. >     cmd = [ get_rubygems_path(module) ]
  3731. diff -r ansible/ansible/library/packaging/homebrew ansible-1.6.6/library/packaging/homebrew
  3732. 47,52d46
  3733. <     upgrade_all:
  3734. <         description:
  3735. <             - upgrade all homebrew packages
  3736. <         required: false
  3737. <         default: no
  3738. <         choices: [ "yes", "no" ]
  3739. 65c59
  3740. < - homebrew: update_homebrew=yes upgrade_all=yes
  3741. ---
  3742. > - homebrew: update_homebrew=yes upgrade=yes
  3743. 101d94
  3744. <         .                   # dots
  3745. 109d101
  3746. <         .                   # dots
  3747. 132d123
  3748. <              - dots
  3749. 157d147
  3750. <              - dots
  3751. 298,299c288
  3752. <                  update_homebrew=False, upgrade_all=False,
  3753. <                  install_options=None):
  3754. ---
  3755. >                  update_homebrew=False, install_options=None):
  3756. 305d293
  3757. <                                   upgrade_all=upgrade_all,
  3758. 429,431d416
  3759. <         if self.upgrade_all:
  3760. <             self._upgrade_all()
  3761. <
  3762. 472,492d456
  3763. <     # _upgrade_all --------------------------- {{{
  3764. <     def _upgrade_all(self):
  3765. <         rc, out, err = self.module.run_command([
  3766. <             self.brew_path,
  3767. <             'upgrade',
  3768. <         ])
  3769. <         if rc == 0:
  3770. <             if not out:
  3771. <                 self.message = 'Homebrew packages already upgraded.'
  3772. <
  3773. <             else:
  3774. <                 self.changed = True
  3775. <                 self.message = 'Homebrew upgraded.'
  3776. <
  3777. <             return True
  3778. <         else:
  3779. <             self.failed = True
  3780. <             self.message = err.strip()
  3781. <             raise HomebrewException(self.message)
  3782. <     # /_upgrade_all -------------------------- }}}
  3783. <
  3784. 776,780d739
  3785. <             upgrade_all=dict(
  3786. <                 default="no",
  3787. <                 aliases=["upgrade"],
  3788. <                 type='bool',
  3789. <             ),
  3790. 805c764
  3791. <     if state in ('head', ):
  3792. ---
  3793. >     if state in ('head'):
  3794. 817d775
  3795. <     upgrade_all = p['upgrade_all']
  3796. 824c782
  3797. <                     upgrade_all=upgrade_all, install_options=install_options)
  3798. ---
  3799. >                     install_options=install_options)
  3800. diff -r ansible/ansible/library/packaging/npm ansible-1.6.6/library/packaging/npm
  3801. 116c116
  3802. <             self.executable = kwargs['executable'].split(' ')
  3803. ---
  3804. >             self.executable = kwargs['executable']
  3805. 118c118
  3806. <             self.executable = [module.get_bin_path('npm', True)]
  3807. ---
  3808. >             self.executable = module.get_bin_path('npm', True)
  3809. 127c127
  3810. <             cmd = self.executable + args
  3811. ---
  3812. >             cmd = [self.executable] + args
  3813. diff -r ansible/ansible/library/packaging/openbsd_pkg ansible-1.6.6/library/packaging/openbsd_pkg
  3814. 56,61d55
  3815. <
  3816. < # Specify a pkg flavour with '--'
  3817. < - openbsd_pkg: name=vim--nox11 state=present
  3818. <
  3819. < # Specify the default flavour to avoid ambiguity errors
  3820. < - openbsd_pkg: name=vim-- state=present
  3821. diff -r ansible/ansible/library/packaging/pkgutil ansible-1.6.6/library/packaging/pkgutil
  3822. 76a77,78
  3823. >     name = pipes.quote(name)
  3824. >     site = pipes.quote(site)
  3825. 79,80c81,82
  3826. <         cmd += [ '-t', pipes.quote(site) ]
  3827. <     cmd.append(pipes.quote(name))
  3828. ---
  3829. >         cmd += [ '-t', site ]
  3830. >     cmd.append(name)
  3831. diff -r ansible/ansible/library/packaging/portage ansible-1.6.6/library/packaging/portage
  3832. 365c365
  3833. <             module.exit_json(msg='Sync successfully finished.')
  3834. ---
  3835. >             return
  3836. diff -r ansible/ansible/library/packaging/portinstall ansible-1.6.6/library/packaging/portinstall
  3837. 102,104c102,104
  3838. <     rc, out, err = module.run_command("%s %s" % (ports_glob_path, name))
  3839. <     #counts the numer of packages found
  3840. <     occurrences = out.count('\n')
  3841. ---
  3842. >     rc, out, err = module.run_command("%s %s | wc" % (ports_glob_path, name))
  3843. >     parts = out.split()
  3844. >     occurrences = int(parts[0])
  3845. 108,109c108,110
  3846. <             rc, out, err = module.run_command("%s %s" % (ports_glob_path, name_without_digits))
  3847. <             occurrences = out.count('\n')
  3848. ---
  3849. >             rc, out, err = module.run_command("%s %s | wc" % (ports_glob_path, name_without_digits))
  3850. >             parts = out.split()
  3851. >             occurrences = int(parts[0])
  3852. diff -r ansible/ansible/library/packaging/redhat_subscription ansible-1.6.6/library/packaging/redhat_subscription
  3853. 375c375
  3854. <             except Exception, e:
  3855. ---
  3856. >             except CommandException, e:
  3857. 388c388
  3858. <             except Exception, e:
  3859. ---
  3860. >             except CommandException, e:
  3861. diff -r ansible/ansible/library/packaging/rhn_register ansible-1.6.6/library/packaging/rhn_register
  3862. 272c272
  3863. <             for available_channel in stdout.rstrip().split('\n'): # .rstrip() because of \n at the end -> empty string at the end
  3864. ---
  3865. >             for availaible_channel in stdout.rstrip().split('\n'): # .rstrip() because of \n at the end -> empty string at the end
  3866. diff -r ansible/ansible/library/packaging/rpm_key ansible-1.6.6/library/packaging/rpm_key
  3867. 159c159
  3868. <         return re.match('(0x)?[0-9a-f]{8}', keystr, flags=re.IGNORECASE)
  3869. ---
  3870. >         return re.match('(0x)?(0-9a-f){8}', keystr, flags=re.IGNORECASE)
  3871. diff -r ansible/ansible/library/packaging/yum ansible-1.6.6/library/packaging/yum
  3872. 63,65c63,65
  3873. <       - I(Repoid) of repositories to enable for the install/update operation.
  3874. <         These repos will not persist beyond the transaction.
  3875. <         When specifying multiple repos, separate them with a ",".
  3876. ---
  3877. >       - Repoid of repositories to enable for the install/update operation.
  3878. >         These repos will not persist beyond the transaction
  3879. >         multiple repos separated with a ','
  3880. 73,75c73,75
  3881. <       - I(Repoid) of repositories to disable for the install/update operation.
  3882. <         These repos will not persist beyond the transaction.
  3883. <         When specifying multiple repos, separate them with a ",".
  3884. ---
  3885. >       - I(repoid) of repositories to disable for the install/update operation
  3886. >         These repos will not persist beyond the transaction
  3887. >         Multiple repos separated with a ','
  3888. 110c110
  3889. <   yum: name=httpd state=absent
  3890. ---
  3891. >   yum: name=httpd state=removed
  3892. 113c113
  3893. <   yum: name=httpd enablerepo=testing state=present
  3894. ---
  3895. >   yum: name=httpd enablerepo=testing state=installed
  3896. diff -r ansible/ansible/library/source_control/git ansible-1.6.6/library/source_control/git
  3897. 64c64
  3898. <         required: false
  3899. ---
  3900. >         requird: false
  3901. 104c104,106
  3902. <             - If C(no), just returns information about the repository without updating.
  3903. ---
  3904. >             - If C(yes), repository will be updated using the supplied
  3905. >               remote.  Otherwise the repo will be left untouched.
  3906. >               Prior to 1.2, this was always 'yes' and could not be disabled.
  3907. 402,404d403
  3908. <     (rc, out0, err0) = module.run_command([git_path, 'remote', 'set-url', remote, repo], cwd=dest)
  3909. <     if rc != 0:
  3910. <         module.fail_json(msg="Failed to set a new url %s for %s: %s" % (repo, remote, out0 + err0))
  3911. 441c440
  3912. < def switch_version(git_path, module, dest, remote, version, recursive):
  3913. ---
  3914. > def switch_version(git_path, module, dest, remote, version):
  3915. 467,471c466,467
  3916. <     if recursive:
  3917. <         (rc, out2, err2) = submodule_update(git_path, module, dest)
  3918. <         out1 += out2
  3919. <         err1 += err1
  3920. <     return (rc, out1, err1)
  3921. ---
  3922. >     (rc, out2, err2) = submodule_update(git_path, module, dest)
  3923. >     return (rc, out1 + out2, err1 + err2)
  3924. 581c577
  3925. <         switch_version(git_path, module, dest, remote, version, recursive)
  3926. ---
  3927. >         switch_version(git_path, module, dest, remote, version)
  3928. diff -r ansible/ansible/library/source_control/subversion ansible-1.6.6/library/source_control/subversion
  3929. 75,76c75
  3930. <     default: "no"
  3931. <     choices: [ "yes", "no" ]
  3932. ---
  3933. >     default: False
  3934. 79c78
  3935. <       - If C(yes), do export instead of checkout/update.
  3936. ---
  3937. >       - If True, do export instead of checkout/update.
  3938. 180c179
  3939. <             export=dict(default=False, required=False, type='bool'),
  3940. ---
  3941. >             export=dict(default=False, required=False),
  3942. diff -r ansible/ansible/library/system/alternatives ansible-1.6.6/library/system/alternatives
  3943. 113,114d112
  3944. <                 elif key == 'Link' and not link:
  3945. <                     link = value
  3946. 132c130
  3947. <         except subprocess.CalledProcessError, cpe:
  3948. ---
  3949. >         except subprocess.CalledProcessError as cpe:
  3950. diff -r ansible/ansible/library/system/cron ansible-1.6.6/library/system/cron
  3951. 50c50
  3952. <       - The specific user whose crontab should be modified.
  3953. ---
  3954. >       - The specific user who's crontab should be modified.
  3955. 98c98
  3956. <       - Day of the week that the job should run ( 0-6 for Sunday-Saturday, *, etc )
  3957. ---
  3958. >       - Day of the week that the job should run ( 0-7 for Sunday - Saturday, *, etc )
  3959. 357,358d356
  3960. <             elif platform.system() == 'HP-UX':
  3961. <                 return "%s %s %s" % (CRONCMD , '-l', pipes.quote(self.user))
  3962. 369c367
  3963. <             if platform.system() in ['SunOS', 'HP-UX', 'AIX']:
  3964. ---
  3965. >             if platform.system() in [ 'SunOS', 'AIX' ]:
  3966. diff -r ansible/ansible/library/system/group ansible-1.6.6/library/system/group
  3967. 124c124
  3968. <       return (0, '', '')
  3969. ---
  3970. >             return (True, '', '')
  3971. 209c209
  3972. <             return (0, '', '')
  3973. ---
  3974. >             return (True, '', '')
  3975. 248c248
  3976. <                 return (0, '', '')
  3977. ---
  3978. >                 return (True, '', '')
  3979. 290c290
  3980. <             return (0, '', '')
  3981. ---
  3982. >             return (True, '', '')
  3983. 332c332
  3984. <             return (0, '', '')
  3985. ---
  3986. >             return (True, '', '')
  3987. diff -r ansible/ansible/library/system/hostname ansible-1.6.6/library/system/hostname
  3988. 42,45d41
  3989. < # import module snippets
  3990. < from ansible.module_utils.basic import *
  3991. <
  3992. <
  3993. 142d137
  3994. <
  3995. 158c153
  3996. <                 self.module.fail_json(msg="failed to write file: %s" %
  3997. ---
  3998. >                 self.module.fail_json(msg="failed to write file: %s" %
  3999. 180a176,184
  4000. > class DebianHostname(Hostname):
  4001. >     platform = 'Linux'
  4002. >     distribution = 'Debian'
  4003. >     strategy_class = DebianStrategy
  4004. >
  4005. > class UbuntuHostname(Hostname):
  4006. >     platform = 'Linux'
  4007. >     distribution = 'Ubuntu'
  4008. >     strategy_class = DebianStrategy
  4009. 229a234,237
  4010. > class RedHat5Hostname(Hostname):
  4011. >     platform = 'Linux'
  4012. >     distribution = 'Redhat'
  4013. >     strategy_class = RedHatStrategy
  4014. 230a239,263
  4015. > class RedHatServerHostname(Hostname):
  4016. >     platform = 'Linux'
  4017. >     distribution = 'Red hat enterprise linux server'
  4018. >     strategy_class = RedHatStrategy
  4019. >
  4020. > class RedHatWorkstationHostname(Hostname):
  4021. >     platform = 'Linux'
  4022. >     distribution = 'Red hat enterprise linux workstation'
  4023. >     strategy_class = RedHatStrategy
  4024. >
  4025. > class CentOSHostname(Hostname):
  4026. >     platform = 'Linux'
  4027. >     distribution = 'Centos'
  4028. >     strategy_class = RedHatStrategy
  4029. >
  4030. > class AmazonLinuxHostname(Hostname):
  4031. >     platform = 'Linux'
  4032. >     distribution = 'Amazon'
  4033. >     strategy_class = RedHatStrategy
  4034. >
  4035. > class ScientificLinuxHostname(Hostname):
  4036. >     platform = 'Linux'
  4037. >     distribution = 'Scientific'
  4038. >     strategy_class = RedHatStrategy
  4039. >    
  4040. 274,276d306
  4041. <
  4042. < # ===========================================
  4043. <
  4044. 292,348d321
  4045. < class RedHat5Hostname(Hostname):
  4046. <     platform = 'Linux'
  4047. <     distribution = 'Redhat'
  4048. <     strategy_class = RedHatStrategy
  4049. <
  4050. < class RedHatServerHostname(Hostname):
  4051. <     platform = 'Linux'
  4052. <     distribution = 'Red hat enterprise linux server'
  4053. <     if float(get_distribution_version()) >= 7:
  4054. <         strategy_class = FedoraStrategy
  4055. <     else:
  4056. <         strategy_class = RedHatStrategy
  4057. <
  4058. < class RedHatWorkstationHostname(Hostname):
  4059. <     platform = 'Linux'
  4060. <     distribution = 'Red hat enterprise linux workstation'
  4061. <     if float(get_distribution_version()) >= 7:
  4062. <         strategy_class = FedoraStrategy
  4063. <     else:
  4064. <         strategy_class = RedHatStrategy
  4065. <
  4066. < class CentOSHostname(Hostname):
  4067. <     platform = 'Linux'
  4068. <     distribution = 'Centos'
  4069. <     if float(get_distribution_version()) >= 7:
  4070. <         strategy_class = FedoraStrategy
  4071. <     else:
  4072. <         strategy_class = RedHatStrategy
  4073. <
  4074. < class ScientificLinuxHostname(Hostname):
  4075. <     platform = 'Linux'
  4076. <     distribution = 'Scientific'
  4077. <     if float(get_distribution_version()) >= 7:
  4078. <         strategy_class = FedoraStrategy
  4079. <     else:
  4080. <         strategy_class = RedHatStrategy
  4081. <
  4082. < class AmazonLinuxHostname(Hostname):
  4083. <     platform = 'Linux'
  4084. <     distribution = 'Amazon'
  4085. <     strategy_class = RedHatStrategy
  4086. <
  4087. < class DebianHostname(Hostname):
  4088. <     platform = 'Linux'
  4089. <     distribution = 'Debian'
  4090. <     strategy_class = DebianStrategy
  4091. <
  4092. < class UbuntuHostname(Hostname):
  4093. <     platform = 'Linux'
  4094. <     distribution = 'Ubuntu'
  4095. <     strategy_class = DebianStrategy
  4096. <
  4097. < class LinaroHostname(Hostname):
  4098. <     platform = 'Linux'
  4099. <     distribution = 'Linaro'
  4100. <     strategy_class = DebianStrategy
  4101. <
  4102. 373a347,348
  4103. > # import module snippets
  4104. > from ansible.module_utils.basic import *
  4105. diff -r ansible/ansible/library/system/lvg ansible-1.6.6/library/system/lvg
  4106. 70c70
  4107. < # Create or resize a volume group on top of /dev/sdb1 and /dev/sdc5.
  4108. ---
  4109. > # Create or resize a volume group on top of /dev/sdb1 and /dev/sdc5.
  4110. 92,101c92
  4111. < def find_mapper_device_name(module, dm_device):
  4112. <         dmsetup_cmd = module.get_bin_path('dmsetup', True)
  4113. <         mapper_prefix = '/dev/mapper/'
  4114. <         rc, dm_name, err = module.run_command("%s info -C --noheadings -o name %s" % (dmsetup_cmd, dm_device))
  4115. <         if rc != 0:
  4116. <             module.fail_json(msg="Failed executing dmsetup command.", rc=rc, err=err)
  4117. <         mapper_device = mapper_prefix + dm_name.rstrip()
  4118. <         return mapper_device
  4119. <
  4120. < def parse_pvs(module, data):
  4121. ---
  4122. > def parse_pvs(data):
  4123. 103d93
  4124. <     dm_prefix = '/dev/dm-'
  4125. 106,107d95
  4126. <         if parts[0].startswith(dm_prefix):
  4127. <             parts[0] = find_mapper_device_name(module, parts[0])
  4128. 120c108
  4129. <             vg_options=dict(default=''),
  4130. ---
  4131. >             vg_options=dict(),
  4132. 131c119
  4133. <     vgoptions = module.params['vg_options'].split()
  4134. ---
  4135. >     vgoptions = module.params.get('vg_options', '').split()
  4136. 140c128
  4137. <
  4138. ---
  4139. >    
  4140. 154c142
  4141. <         pvs = parse_pvs(module, current_pvs)
  4142. ---
  4143. >         pvs = parse_pvs(current_pvs)
  4144. diff -r ansible/ansible/library/system/modprobe ansible-1.6.6/library/system/modprobe
  4145. 4,7d3
  4146. < # (c) 2013, David Stygstra <[email protected]>
  4147. < #
  4148. < # This file is part of Ansible
  4149. < #
  4150. 28d23
  4151. < author: David Stygstra, Julien Dauphant, Matt Jeffery
  4152. diff -r ansible/ansible/library/system/open_iscsi ansible-1.6.6/library/system/open_iscsi
  4153. 165,166d164
  4154. <     elif rc == 21:
  4155. <         return False
  4156. diff -r ansible/ansible/library/system/service ansible-1.6.6/library/system/service
  4157. 391a392,393
  4158. >             location[binary] = None
  4159. >         for binary in binaries:
  4160. 481c483
  4161. <             self.module.fail_json(msg='failure %d running systemctl show for %r: %s' % (rc, self.__systemd_unit, err))
  4162. ---
  4163. >             self.module.fail_json('failure %d running systemctl show for %r: %s' % (self.__systemd_unit, rc, err))
  4164. diff -r ansible/ansible/library/system/setup ansible-1.6.6/library/system/setup
  4165. 57,59d56
  4166. <     - If the target host is Windows, you will not currently have the ability to use
  4167. <       C(fact_path) or C(filter) as this is provided by a simpler implementation of the module.
  4168. <       Different facts are returned for Windows hosts.
  4169. diff -r ansible/ansible/library/system/ufw ansible-1.6.6/library/system/ufw
  4170. 208,210d207
  4171. <     if('interface' in params and 'direction' not in params):
  4172. <       module.fail_json(msg="Direction must be specified when creating a rule on an interface")
  4173. <
  4174. diff -r ansible/ansible/library/system/user ansible-1.6.6/library/system/user
  4175. 184c184
  4176. < - user: name=johnd comment="John Doe" uid=1040 group=admin
  4177. ---
  4178. > - user: name=johnd comment="John Doe" uid=1040
  4179. diff -r ansible/ansible/library/system/zfs ansible-1.6.6/library/system/zfs
  4180. 313,325c313,320
  4181. <         def get_properties_by_name(propname):
  4182. <             cmd = [self.module.get_bin_path('zfs', True)]
  4183. <             cmd += ['get', '-H', propname, self.name]
  4184. <             rc, out, err = self.module.run_command(cmd)
  4185. <             return [l.split('\t')[1:3] for l in out.splitlines()]
  4186. <         properties = dict(get_properties_by_name('all'))
  4187. <         if 'share.*' in properties:
  4188. <             # Some ZFS pools list the sharenfs and sharesmb properties
  4189. <             # hierarchically as share.nfs and share.smb respectively.
  4190. <             del properties['share.*']
  4191. <             for p, v in get_properties_by_name('share.all'):
  4192. <                 alias = p.replace('.', '')  # share.nfs -> sharenfs (etc)
  4193. <                 properties[alias] = v
  4194. ---
  4195. >         cmd = [self.module.get_bin_path('zfs', True)]
  4196. >         cmd.append('get -H all')
  4197. >         cmd.append(self.name)
  4198. >         rc, out, err = self.module.run_command(' '.join(cmd))
  4199. >         properties = dict()
  4200. >         for l in out.splitlines():
  4201. >             p, v = l.split('\t')[1:3]
  4202. >             properties[p] = v
  4203. diff -r ansible/ansible/library/utilities/include_vars ansible-1.6.6/library/utilities/include_vars
  4204. 35,36c35
  4205. <    - "{{ ansible_distribution }}.yml"
  4206. <    - "{{ ansible_os_family }}.yml"
  4207. ---
  4208. >    - "{{ ansible_os_distribution }}.yml"
  4209. 38c37
  4210. <
  4211. ---
  4212. >  
  4213. diff -r ansible/ansible/library/utilities/wait_for ansible-1.6.6/library/utilities/wait_for
  4214. 180,202c180,193
  4215. <                     os.stat(path)
  4216. <                     if search_regex:
  4217. <                         try:
  4218. <                             f = open(path)
  4219. <                             try:
  4220. <                                 if re.search(search_regex, f.read(), re.MULTILINE):
  4221. <                                     break
  4222. <                                 else:
  4223. <                                     time.sleep(1)
  4224. <                             finally:
  4225. <                                 f.close()
  4226. <                         except IOError:
  4227. <                             time.sleep(1)
  4228. <                             pass
  4229. <                     else:
  4230. <                         break
  4231. <                 except OSError, e:
  4232. <                     # File not present
  4233. <                     if os.errno == 2:
  4234. <                         time.sleep(1)
  4235. <                     else:
  4236. <                         elapsed = datetime.datetime.now() - start
  4237. <                         module.fail_json(msg="Failed to stat %s, %s" % (path, e.strerror), elapsed=elapsed.seconds)
  4238. ---
  4239. >                     f = open(path)
  4240. >                     try:
  4241. >                         if search_regex:
  4242. >                             if re.search(search_regex, f.read(), re.MULTILINE):
  4243. >                                 break
  4244. >                             else:
  4245. >                                 time.sleep(1)
  4246. >                         else:
  4247. >                             break
  4248. >                     finally:
  4249. >                         f.close()
  4250. >                 except IOError:
  4251. >                     time.sleep(1)
  4252. >                     pass
  4253. diff -r ansible/ansible/library/web_infrastructure/django_manage ansible-1.6.6/library/web_infrastructure/django_manage
  4254. 31c31
  4255. <     choices: [ 'cleanup', 'collectstatic', 'flush', 'loaddata', 'migrate', 'runfcgi', 'syncdb', 'test', 'validate', ]
  4256. ---
  4257. >     choices: [ 'cleanup', 'flush', 'loaddata', 'runfcgi', 'syncdb', 'test', 'validate', 'migrate', 'collectstatic' ]
  4258. 33c33
  4259. <       - The name of the Django management command to run. Built in commands are cleanup, collectstatic, flush, loaddata, migrate, runfcgi, syncdb, test, and validate. Other commands can be entered, but will fail if they're unknown to Django.
  4260. ---
  4261. >       - The name of the Django management command to run. Allowed commands are cleanup, createcachetable, flush, loaddata, syncdb, test, validate.
  4262. 147d146
  4263. <     os.environ["VIRTUAL_ENV"] = venv_param
  4264. diff -r ansible/ansible/library/web_infrastructure/htpasswd ansible-1.6.6/library/web_infrastructure/htpasswd
  4265. 166c166
  4266. <     if module.set_fs_attributes_if_different(file_args, False):
  4267. ---
  4268. >     if module.set_file_attributes_if_different(file_args, False):
  4269. Only in ansible/ansible/library: windows
  4270. diff -r ansible/ansible/Makefile ansible-1.6.6/Makefile
  4271. 78c78
  4272. < ifneq ($(OFFICIAL),yes)
  4273. ---
  4274. > ifeq ($(OFFICIAL),)
  4275. diff -r ansible/ansible/MANIFEST.in ansible-1.6.6/MANIFEST.in
  4276. 6d5
  4277. < include lib/ansible/module_common/*.ps1
  4278. 10,11d8
  4279. < include VERSION
  4280. < include MANIFEST.in
  4281. Only in ansible/ansible/packaging: arch
  4282. Only in ansible/ansible/packaging: debian
  4283. Only in ansible/ansible/packaging: gentoo
  4284. Only in ansible/ansible/packaging: macports
  4285. Only in ansible/ansible/packaging: port
  4286. Only in ansible-1.6.6: PKG-INFO
  4287. Only in ansible/ansible: plugins
  4288. diff -r ansible/ansible/README.md ansible-1.6.6/README.md
  4289. 45,46c45
  4290. < Ansible was created by Michael DeHaan ([email protected]) and has contributions from over
  4291. < 700 users (and growing).  Thanks everyone!
  4292. ---
  4293. > Michael DeHaan -- [email protected]
  4294. Only in ansible/ansible: RELEASES.txt
  4295. Only in ansible-1.6.6: setup.cfg
  4296. diff -r ansible/ansible/setup.py ansible-1.6.6/setup.py
  4297. 50d49
  4298. <          'ansible.runner.shell_plugins',
  4299. Only in ansible/ansible: test
  4300. Only in ansible/ansible: VERSION
Add Comment
Please, Sign In to add comment