Commit graph

9048 commits

Author SHA1 Message Date
Richard Isaacson
5dfe16ee5a Merge pull request #5964 from sl4mmy/with-dict
lookup_plugins: loop over hashes

Tests good with the global variables:
```
users:
  alice:
    name: Alice
    id: 12345
  luna:
    name: Luna
    id: 23456
```

and playbook tasks:
```
- name: Print records.
  debug: msg="User {{ item.key }} is {{ item.value.name }}  {{ item.value.id }}"
  with_dict: users
```
2014-02-25 12:58:08 -06:00
Kent R. Spillner
1fcc9ff666 lookup_plugins: loop over hashes
Create a lookup plugin named dict that can be used to loop over hashes.
It converts a dict into a list of key-value pairs, with attributes named
"key" and "value."  Also adds a brief explanation and simple example to
the docs.

Signed-off-by: Kent R. Spillner <kspillner@acm.org>
2014-02-25 11:20:15 -06:00
James Tanner
876035c0b1 Fixes #6161 Get the delegate host info properly from the hostvars object 2014-02-25 11:18:06 -05:00
James Tanner
e121ff111d Fix synchronize unit test to handle checkmode 2014-02-25 09:24:14 -05:00
James Tanner
9209581565 Fixes #6155 Inject checkmode into synchronize module args 2014-02-25 08:58:58 -05:00
James Cammarata
6fe369fca0 Merge branch 'usermod_fix' of https://github.com/tknguyen79/ansible into tknguyen79-usermod_fix
Conflicts:
	library/system/user
2014-02-24 23:38:51 -06:00
James Cammarata
97eededc99 Handle unicode content in the uri module properly
Fixes #5869
2014-02-24 23:34:17 -06:00
James Cammarata
a18f811b2d Merge branch 'jimi-c-issue_4620' into devel 2014-02-24 21:38:55 -06:00
James Cammarata
f23ccebbdc Merge branch 'issue_4620' of https://github.com/jimi-c/ansible into jimi-c-issue_4620 2014-02-24 20:30:25 -06:00
James Tanner
0f95a905d9 Fixes #5965 Ensure the inject for each item in a loop is un-altered 2014-02-24 20:54:26 -05:00
Richard Isaacson
abb4f2fbda Merge pull request #6160 from risaacson/pull_5775_2
Fixed up merge for the lvol module.
2014-02-24 18:56:25 -06:00
Stefan J. Betz
789ae4697c Require force for LVM shrink and remove operations in lvol. Fixes #5774
Conflicts:
	library/system/lvol
2014-02-24 18:52:35 -06:00
Michael DeHaan
05bf80751b Merge pull request #6158 from risaacson/issues_5165
If you try to resize a lvol to the current size return a changed=False and don't fail.
2014-02-24 19:17:43 -05:00
Michael DeHaan
031aaa1018 Merge pull request #6157 from rgbkrk/patch-1
Fix expires
2014-02-24 19:17:17 -05:00
Richard C Isaacson
bf30707670 If you try to resize a lvol to the current size return a changed=False and don't fail.
This addresses GH-5165 and adds the ability to check if a lvol exists.

The tests for this don't fit nicely into the current integration tests so they are below.

```
---

- name: remove any existing lv=one of vg=main
  lvol: lv=one vg=main state=absent

- name: remove any existing lv=two of vg=main
  lvol: lv=two vg=main state=absent

- name: check to see if lv=one of vg=main exists
  lvol: lv=one vg=main state=present
  ignore_errors: true
  register: lvol_result0

- name: Assert that we will get a "No size given."
  assert:
    that:
      - "'No size given.' in lvol_result0.msg"

- name: create lv=one of vg=main sized 30g
  lvol: lv=one size=30g vg=main state=present
  register: lvol_result1

- name: Assert that we made changes."
  assert:
    that:
      - "lvol_result1.changed == True"

- name: check to see if lv=one of vg=main exists
  lvol: lv=one vg=main state=present
  register: lvol_result2

- name: Assert that we did not make changes."
  assert:
    that:
      - "lvol_result2.changed == False"

- name: remove lv=one of vg=main
  lvol: lv=one vg=main state=absent

- name: create lv=two of vg=main sized 30G
  lvol: lv=two size=30G vg=main state=present
  register: lvol_result3

- name: Assert that we made changes."
  assert:
    that:
      - "lvol_result3.changed == True"

- name: reduce lv=two of vg=main to 15G
  lvol: lv=two size=15G vg=main state=present
  register: lvol_result4

- name: Assert that we made changes."
  assert:
    that:
      - "lvol_result4.changed == True"

- name: increase lv=two of vg=main to 30G
  lvol: lv=two size=30G vg=main state=present
  register: lvol_result5

- name: Assert that we made changes."
  assert:
    that:
      - "lvol_result5.changed == True"

- name: create lv=two of vg=main sized 30G when already exists at 30G
  lvol: lv=two size=30g vg=main state=present
  register: lvol_result6

- name: Assert that we did not make changes."
  assert:
    that:
      - "lvol_result6.changed == False"

- name: remove lv=two of vg=main
  lvol: lv=two vg=main state=absent
```
2014-02-24 16:56:08 -06:00
Kyle Kelley
b5eb4d2a71 Fix expires 2014-02-24 15:54:55 -06:00
James Cammarata
be0be16e89 Merge branch '5853-python-2.5-apt_repository-fix' of https://github.com/timurbatyrshin/ansible into timurbatyrshin-5853-python-2.5-apt_repository-fix 2014-02-24 15:20:29 -06:00
James Cammarata
7517cd9398 Moving the assemble test to the correct location 2014-02-24 15:19:06 -06:00
James Cammarata
4e49b32419 Adding a version note to the expanduser filter documentation 2014-02-24 14:36:13 -06:00
James Cammarata
3b2d409906 Fixing several bugs in assemble and updating tests
Bugfixes:
* the remote_src param was not being converted to a boolean correctly,
  resulting in it never being used by the module as the default behavior
  was remote_src=True (issue #5581)
* the remote_src param was not listed in the generic file params, leading
  to a failure when the above bug regarding remote_src was fixed
* the delimiter should always end with a newline to ensure that the file
  fragments do not run together on one line

Fixes #5581
2014-02-24 14:27:23 -06:00
James Cammarata
f03d6a67c8 Adding new tests for assemble role 2014-02-24 14:27:23 -06:00
Michael DeHaan
0a83f743c1 Merge pull request #6146 from jlaska/test_synchronize
Correct assert and add with_items test
2014-02-24 15:20:49 -05:00
James Laska
40e0204051 Correct assert and add with_items test 2014-02-24 15:07:23 -05:00
jctanner
8a253bf576 Merge pull request #6151 from jctanner/vault_rewrite
Vault rewrite, pass 1
2014-02-24 14:54:01 -05:00
Michael DeHaan
e999881f81 Merge pull request #6153 from jjshoe/patch-1
Typo/Grammar fix.
2014-02-24 14:38:50 -05:00
James Tanner
39603b06e8 Update changelog for ansible_ssh_private_key_file templating 2014-02-24 14:28:06 -05:00
jctanner
93c746db9c Merge pull request #5651 from nikut/sshfix
allow ansible_ssh_private_key_file to be templated (thanks to benno)
2014-02-24 14:26:48 -05:00
jjshoe
6942e0eea1 Typo/Grammar fix. 2014-02-24 13:03:01 -06:00
James Tanner
9c9f15acb7 Fix decryption error 2014-02-24 13:20:27 -05:00
James Tanner
52a8efefba Vault rewrite, pass 1 2014-02-24 13:09:36 -05:00
Hagai
ae9c0d87a9 Fix incorrect use of .join on list 2014-02-24 19:48:55 +02:00
Richard Isaacson
13604e75f4 Merge pull request #6149 from risaacson/issues_4986
This tests clean with the new integration tests.
2014-02-24 11:15:37 -06:00
Richard C Isaacson
8be8dbc9ed Formatting cleanup. 2014-02-24 11:11:47 -06:00
Richard C Isaacson
087f7c230d Typo fixes. 2014-02-24 11:08:21 -06:00
Richard C Isaacson
0446a030d7 Typo fixes. 2014-02-24 11:06:22 -06:00
Richard C Isaacson
dcbc69b69c Added script to the new integration tests. 2014-02-24 10:57:22 -06:00
Richard C Isaacson
aaf0a182e1 Merge remote-tracking branch 'jeromew/ansible_script_creates' into issues_4986 2014-02-24 10:16:39 -06:00
Richard C Isaacson
e2a47162d0 Added test for failed_when to non_destructive integration tests. 2014-02-24 09:40:44 -06:00
Michael DeHaan
00ed610a34 Merge pull request #6140 from andyhky/fix_typo
Fix typo in guide_rax
2014-02-23 20:09:17 -05:00
Andy Hill
bd90fdae94 Fix typo in guide_rax 2014-02-23 17:25:46 -06:00
Richard C Isaacson
0c33e936d4 Adding tests for the command and shell modules. 2014-02-23 14:51:26 -06:00
Michael DeHaan
7638d8ff46 Update CODING_GUIDELINES.md 2014-02-23 12:22:36 -05:00
Michael DeHaan
c7ae1ee978 Merge pull request #6130 from Azulinho/devel
replace test 'wget' package with 'hello' package
2014-02-23 09:13:30 -05:00
Azul
89cee747d9 replace test 'wget' package with 'hello' package 2014-02-23 10:46:39 +00:00
Michael DeHaan
d7dd04c295 Merge pull request #6121 from lalinsky/fix_dev_docs
Remove obsolete module development docs
2014-02-22 10:21:16 -05:00
Lukáš Lalinský
95d102f5e4 Remove obsolete module development docs 2014-02-22 15:51:59 +01:00
Michael DeHaan
c7a30df574 Merge pull request #6116 from spatten/devel
In the route53 module, documenting that TXT and SPF values must be surrounded by quotes
2014-02-21 23:14:48 -05:00
Scott Patten
dbde446358 In the route53 module, documenting that TXT and SPF requests
must be surrounded by quotes.

Otherwise you get a cryptic error message from Route 53.
2014-02-21 19:36:22 -08:00
Michael DeHaan
9686695170 Assume empty files are unencrypted. 2014-02-21 21:06:04 -05:00
jctanner
719367facb Merge pull request #6113 from jlaska/custom_nose_args
Allow custom nosetest parameters
2014-02-21 16:21:08 -05:00