Commit Graph

794 Commits (f040d63403f6c459a278918fa48fa8cb87754506)

Author SHA1 Message Date
Dag Wieers 20726b94be Ensure yum failures in with-loop result into a failed task
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes #4214, #4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
8 years ago
Michael Scherer 6f15dfd464 Make pip module use pip3 on python 3 8 years ago
Alfredo Solano 845cc1a531 apt: doc: use yaml syntax in examples (#5070) 8 years ago
John R Barker 312f578f93 Bulk spelling improvement to modules-core (#5225)
* Correct spelling mistakes

* Correct more spelling issues

* merge conflict

* Revert typo in parms
8 years ago
John Barker 275fa3f055 Correct functional typos 8 years ago
Kevin Carter 9b2ee881d9 apt: fix cache time handling (#1517)
This change is in response to issue #1497 where the apt module would not properly updating the apt cache in some situations and never returned a state change on cache update when the module was used without or without an item to be installed or upgraded.

The change simply allows the apt module to update the cache when update_cache option is used without or without a set cache_valid_time. 
If cache_valid_time is set and the on disk mtime for apt cache is ">" the provided amount of seconds, which now has a default of 0, the apt cache will be updated. Additionally if no upgrade, package, or deb is installed or changed but the apt cache is updated the module will return a changed state which will help users to know that the state of the environment has changed due to a task operation, even if it was only an apt cache update.

fixes #1497

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
8 years ago
Toshio Kuratomi b4f1d0d0c2 Fix pip freeze workaround with virtualenv (#4951) 8 years ago
Toshio Kuratomi 5b1994cb42 pip list isn't available on pip less than 1.3 so make a fallback (#4947) 8 years ago
Toshio Kuratomi 70d4ff8e38 Fix parsing of pip output 8 years ago
Rob Cutmore 12a7027c49 Pip: use 'pip list' when available for package list (#4644)
* Pip: handle parsing different pip commands

* Pip: use 'pip list' when available

* Pip: explicitly check which command is used

* Pip: add error checking when fetching packages
8 years ago
Will Thames a076309a0f Check whether yum file or URL install is an upgrade (#4547)
Rather than just checking whether a package with the right
name is installed, use `local_nvra` to check whether the
version/release/arch differs too.

Remove `local_name` as it is a shortcut too far.

Fixes #3807
Fixes #4529
8 years ago
Matt Clay 683e5e4d1a Fix python 3 issues with apt* modules. (#4848)
- Use range instead of xrange.
- Use python3-apt package for python 3.
- Eliminate unsupported for/else/raise usage.
- Use list on dict.items when modifying dict.
- Update requirements documentation.

Also made non-intrustive style fixes (adding blank lines).
8 years ago
Matt Clay bf5b3de83e Python 3 fixes for apt_* modules. (#4754) 8 years ago
Toshio Kuratomi 958d894c61 We've decided that pythn 3.5 is the minimum python3 version (#4572) 8 years ago
Guillaume Delpierre 2a25e27979 gem: add support for --env-shebang (#4377)
* gem: add support for --env-shebang

* fix version added
8 years ago
Alexey Sheplyakov 5f1ac88414 apt_key: fix spurious failure to import a subkey (#4366)
Importing a (sign only) subkey with apt_key module always fails,
however the actual keyring gets created and contains the correct keys.
Apparently the all_keys function skips the subkeys, hence the problem.

Fixes #4365
8 years ago
Evan b5ad8b83be pip: Fix uninitialized variable during check_mode (#4379)
During check_mode (`--check`), the variable change could be
used uninitialized, yielding this error:

`UnboundLocalError: local variable 'changed' referenced before assignment`

This changeset simply initializes it to False.
8 years ago
Jan Hutař 8e241a87cc Add way to specify environment (#3453) 8 years ago
Brian Coca 642221414f name was the issue, not pkg 8 years ago
Brian Coca f176b767c6 protect another portion against None name 8 years ago
Brian Coca 3c76c3669e another fix for None in name 8 years ago
Brian Coca 97d70d948d avoid traceback when name is None 8 years ago
Brian Coca a3c5d072e0 allow pip to take a list of names (#4056)
also simplified argspec by removing defaults
8 years ago
Adrian Likins 5c55c6c90a Update docs and internal naming s/RHN/RHSM (#3977) 8 years ago
Adrian Likins f6ee484f33 Add 'force_register' to redhat_subscriptions (#3976)
Fixes #2448
8 years ago
Adrian Likins 8fdb068d7a Fix default perm for apt_repo files. (#4072)
Change the file mode arg to 'raw' ala file args

Following the file_common_args model, change the
type of the 'mode' arg here to type='raw' with no
default arg value.

The default mode for file creation is the module
constant DEFAULT_SOURCES_PER, and is used if no
mode os specified.

A default mode of 0644 (and not specified as int or str)
would get converted to an octal 420, resulting in the
sources file being created with mode '0420' instead of '0644'

Fixes #16370
8 years ago
Brian Coca 5380812b36 removed extra space
as pointed out by @lloydbenson
9 years ago
jctanner d6a834efa0 Cleanup unused variable in yum.py (#4009) 9 years ago
Erik Nadel abaaf3e797 apt remove now recognizes the force parameter (#3756) 9 years ago
mattymo 1f73bef856 Add retries to apt_key with keyserver, fixes #3986 (#3987)
Public SKS gpg servers frequently are unavailable, but a retry
can mitigate frequent failures.
9 years ago
jctanner 71d320ff18 Add local and url support to yum state=latest (#4003)
Fixes #3807
9 years ago
René Moser 218b44d604 apt: fix deb=file with --diff does not show diff on upgrades (#3826) 9 years ago
René Moser 4a727bc44a apt: fix KeyError for deb=file (#3816)
Fix KeyError: 'prepared' while installing dependencies using deb=<file>.deb
This error shows up when --diff was not passed by and the deb files has dependencies not yet installed.
Closes #3752.
9 years ago
james-prior 170ce382af Make explicit that virtualenv is created if needed for pip module. (#3731)
packaging/language/pip.py:
    virtualenv option:
        Mention that virtualenv is created if it does not exist.
            (Explicit is better than implicit.)
        Mention other relevant options.
    notes:
        initialized -> created
    Wrap long lines.
9 years ago
Michael Scherer 75715a1b73 Convert packaging/* to py3/py2.4 syntax (#3702) 9 years ago
Matt Martz 1d87213de1 2 Module fixes (#3611)
* Fix syntax error in azure_rm_virtualmachine.py

* Allow rhn_register to fail gracefully when rhn-client-tools is not installed
9 years ago
René Moser 1f5cf669dd apt: fix always changed when using deb file on Debian 8 (#3541)
Extends d74e82a3f1e3293ffb70c172e5bb2b6e1ff6dbcc with also support
downgrade.
9 years ago
Pomin Wu f78509d0cf Fixed #3577 (#3578)
Initialize `upgradable` before use.
9 years ago
Toshio Kuratomi f3fef24e49 Some beginning python3 porting for modules which have unittests 9 years ago
Michael Scherer 1ac7382dd4 Change gem_source and executable to 'path'
Both of them are file location, so they should be
marked as 'path'.
9 years ago
Adrian Likins d83c269b82 improve redhat_subscription documentation (#3348)
* add subscription-manager's --type, --consumerid, --name option support

* redhat_subscription: More docs on consumerid
9 years ago
Michael Scherer a144663953 Fix error reporting for fetch_key (#2662)
Since fetch_url already take care of the exception, the try/except
clause is no longer working, so replace it with proper status
checking, thus permitting to remove urlib2 from the import list.
9 years ago
Jan Hutař 9ab4780b25 Add support for Satellite/Spacewalk which have slightly different API to Hosted (#3289) 9 years ago
Toshio Kuratomi f39e2343c4 Fix apt module needing another format character 9 years ago
NielsH ab699a0953 Resolve idempotency issue with virtual apt package (#3449)
Virtual packages were always marked as upgradable which caused the changed-state even though nothing changed.
9 years ago
Tobias Wolf dba53b5543 Add diff to apt.py (#2944)
for install, remove, deb_install, and upgrade.

Since apt has very commonly familiar output, just use the normal output
from apt-get or aptitude -- trimmed to the interesting parts -- to show
to the user if she specified --diff on the CLI.

Uses the recent support for the `diff['prepared]` key.

Fixes ansible/ansible#10239
9 years ago
Oleg Senin 377e94f77f Correct misspell (#3454) 9 years ago
Matt Davis 1c01e826d6 Merge pull request #3352 from gundalow/docsrh_subs
ansible-validate-modules part 3: Add copyright notice for Barnaby Court (@barnabycourt)
9 years ago
Adrian Likins 72f6238d04 Update redhat_subscriptions 'server_insecure' docs (#3373)
'server_insecure' maps to the subscription-manager config
(/etc/rhsm/rhsm.conf) value for 'insecure' key in the
'server' stanza. The 'insecure' configures if the https connection
to 'server_hostname' is verified as having been issued by
a CA in 'ca_cert_dir' trust store.

Previous documentation indicating it disables https and
enables http was inaccurate. Connection to server_hostname
always uses https.
9 years ago
John Barker 6b03f4afe6 Add copyright notice for James Laska 9 years ago