Commit Graph

1041 Commits (f95fefd8c5d4fe300d7c2fffa21b3c8e80dd2834)

Author SHA1 Message Date
Daniel Hokka Zakrisson f95fefd8c5 Use plugin system to find modules 13 years ago
Daniel Hokka Zakrisson 5dd2ec2cae Add a way to add directories to just one type of loader 13 years ago
Daniel Hokka Zakrisson d2abfb9ff8 Ensure runner adds its basedir, so ansible can benefit from plugins 13 years ago
Daniel Hokka Zakrisson 5183417de8 Reinstate ANSIBLE_KEEP_REMOTE_FILES
Fixes #1395.
13 years ago
Daniel Hokka Zakrisson 11175781b8 Use slurp for fetch is sudo is enabled and needed
Fixes #1020.
13 years ago
Daniel Hokka Zakrisson 11afd84d32 Drop dwim prefix from returned items in fileglob
Fixes #1618.
13 years ago
Michael DeHaan 1b78dabcd4 Merge pull request #1632 from dhozac/use-ssh-conn-section-for-scp
Use the ssh_connection section for scp_if_ssh
13 years ago
Michael DeHaan 3bc0adacbf Merge pull request #1634 from dhozac/ssh-password
Add password support to -c ssh via sshpass
13 years ago
Daniel Hokka Zakrisson e6fed9f216 Add password support to -c ssh via sshpass 13 years ago
Daniel Hokka Zakrisson 021172f78d Use the configured remote_tmp even for root 13 years ago
Daniel Hokka Zakrisson c906f44d90 Use the ssh_connection section for scp_if_ssh 13 years ago
Michael DeHaan ab5c0dfe7e __new__ does not take arguments, remove deprecation warning 13 years ago
Michael DeHaan 096607eea4 Allow fireball to transfer binary files, fixup fireball docs, make fetch work with fireball. 13 years ago
Michael DeHaan d500398e76 Merge pull request #1616 from dagwieers/skip-register
Do not register variable if host has been skipped
13 years ago
Michael DeHaan 52e2654faf Merge pull request #1621 from dhozac/lookup-with-vars
Lookup plugin arguments need to be templated
13 years ago
Daniel Hokka Zakrisson 17e4ce97a4 Create a set of all the hosts in a group to prevent duplicates
Fixes #1516.
13 years ago
Daniel Hokka Zakrisson e74ffd6764 Lookup plugin arguments need to be templated 13 years ago
Dag Wieers 302eeae65d Do not register variable if host has been skipped
Executive summary: skipping a host corrupts a variable (when it is registered)

We have a play existing out of multiple tasks that check a condition, if one of these tasks fails we want to skip all next tasks in the playbook. I noticed that if we skip a task because a certain condition is met, and this task has a register-attribute, I loose the value in the variable. Which means we cannot use that variable in subsequent tasks to evaluate because it was skipped:

```
- action: command test -d /some/directory
  register: task

- action: command test -f /some/directory/file
  register: task
  only_if: '${task.rc} == 0'

- action: do something else
  only_if: '${task.rc} == 0'
```

In the above example, if the second task is skipped (because the first failed), the third action will end with a "SyntaxError: invalid syntax" complaining about the unsubstituted ${task.rc} (even though it was set by the first task and used for skipping the second).

The following play demonstrates the problem:

```
- name: Test register on ignored tasks
  hosts: all
  gather_facts: no

  vars:
    skip: true
    task: { 'rc': 666 }

  tasks:
  - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'

  - name: Skip this task, just to test if task has changed
    action: command ls
    register: task
    only_if: '${skip} != True'

  - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'

  - name: Now use task value
    action: command echo 'Works !'
    only_if: '${task.rc} == 0'
```

And the enclosed fix, fixes the above problem.
13 years ago
Michael DeHaan 44af1408ee Merge pull request #1611 from dhozac/no-hostvars-templating
Keep hostvars from being templated
13 years ago
Michael DeHaan 6793bcbe4d Merge pull request #1613 from dhozac/use-all-vars-for-hosts-template
Use all available vars for hosts:, user: and sudo_user:
13 years ago
Michael DeHaan 2303f65a1a Merge pull request #1614 from dagwieers/missing-action-error
Print the task name (if any) when complaining
13 years ago
Dag Wieers b96877e5aa Print the task name (if any) when complaining
After spending 10 minutes to find which playbook had an action/local_action missing, I changed the error to include the task name (if set). The error eventually was caused because I added a name to a task, but the dash before the existing action was not removed.
13 years ago
Daniel Hokka Zakrisson 0be1f11ed5 Use all available vars for hosts:, user: and sudo_user: 13 years ago
Daniel Hokka Zakrisson eebbbd3f0e Make parameterized playbook includes work with vars as a list
Fixes #1610.
13 years ago
Daniel Hokka Zakrisson c200c26ced Keep hostvars from being templated 13 years ago
Michael DeHaan e3f7f86ac4 Merge pull request #1608 from dhozac/when_set-non-string
Try to ensure the entire value is quoted
13 years ago
Michael DeHaan d5be13c3f0 Merge pull request #1605 from romeotheriault/add-md5-support-to-fetch-module
add bsd md5 support to fetch module
13 years ago
Daniel Hokka Zakrisson 0ca1775bda Try to ensure the entire value is quoted 13 years ago
Daniel Hokka Zakrisson 25a8787e95 Template all variables before returning them to Jinja2 13 years ago
Daniel Hokka Zakrisson d2dce1d63f Make lookup plugin replacements part of the main variable logic 13 years ago
Daniel Hokka Zakrisson a2bb3a09d2 Completely ignore stray $ in input
Previously, "a $ string $var" would not have gotten replaced at all.
13 years ago
Daniel Hokka Zakrisson 24b536d7ed Add some comments to templating system 13 years ago
Romeo Theriault 4cd133ed8f add bsd md5 support to fetch module 13 years ago
Daniel Hokka Zakrisson 233a36b9e8 Template using module_vars early
Since no basedir is available at that time, avoid invoking
lookup plugins since they assume it is present.
13 years ago
Michael DeHaan c890ae18e7 Merge pull request #1575 from dhozac/parameterized-playbook-include
Add parameterized playbook includes
13 years ago
Michael DeHaan 3e855a5fcd Merge pull request #1593 from dhozac/lookup_generic
Add support for generic $XXX() to call $LOOKUP()
13 years ago
Michael DeHaan 451f05fa3d Merge pull request #1594 from sfromm/issue1342
Add ability to specify syslog facility for modules
13 years ago
Romeo Theriault 54b7f59416 remove verbose option on digest call 13 years ago
Stephen Fromm 06e54c0b97 Add ability to specify syslog facility for modules
Update constants.py so that one can specify environmental variable
ANSIBLE_SYSLOG_FACILITY or syslog_facility in ansible.cfg to define
the syslog facility to use.  Alternatively, you can specify
ansible_syslog_facility in inventory.  Runner now replaces
the syslog facility in the openlog() call with the default or
the injected variables ansible_syslog_facility.

This also updates hacking/test-module to behave similarly.
13 years ago
Daniel Hokka Zakrisson 9924555623 Add support for generic $XXX() to call $LOOKUP() 13 years ago
Michael DeHaan 40e49b6a5a Merge pull request #1592 from jpmens/lookup_dnstxt3
$LOOKUP(dnstxt): handle exceptions
13 years ago
Jan-Piet Mens bd55899a60 $LOOKUP(dnstxt): handle exceptions
de-spaced
13 years ago
Michael DeHaan db3e8c0803 Merge pull request #1579 from jpmens/lookup_env
Add environment $LOOKUP plugin
13 years ago
Michael DeHaan 35679e0093 Merge pull request #1578 from jpmens/lookup_redis
Add Redis GET $LOOKUP plugin
13 years ago
Jan-Piet Mens 6efc98e8a3 Add environment $LOOKUP plugin
remove support for multiple vars
13 years ago
Jan-Piet Mens e3e545418d Add Redis GET $LOOKUP plugin
renamed
13 years ago
Jan-Piet Mens e32f4a0564 Move get_docstring from module_formatter into ansible/utils 13 years ago
Daniel Hokka Zakrisson 9c095b72b9 Add parameterized playbook includes
Also makes with_* work with them.

Fixes #1162.
13 years ago
Daniel Hokka Zakrisson 383dc30560 Rename varReplaceWithItems to template_ds 13 years ago
Michael DeHaan 325025a5b6 Merge pull request #1574 from dhozac/ssh-moar-data
Make sure we get all data
13 years ago