Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
735db177
Commit
735db177
authored
Apr 08, 2013
by
milan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow URL spec for install
parent
c695aa2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
library/yum
+19
-3
No files found.
library/yum
View file @
735db177
...
...
@@ -363,7 +363,7 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
# check if pkgspec is installed (if possible for idempotence)
# localpkg
if
spec
.
endswith
(
'.rpm'
):
if
spec
.
endswith
(
'.rpm'
)
and
'://'
not
in
spec
:
# get the pkg name-v-r.arch
if
not
os
.
path
.
exists
(
spec
):
res
[
'msg'
]
+=
"No Package file matching '
%
s' found on system"
%
spec
...
...
@@ -375,6 +375,11 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
# if they are there, skip it
continue
pkg
=
spec
# URL
elif
'://'
in
spec
:
pkg
=
spec
#groups :(
elif
spec
.
startswith
(
'@'
):
# complete wild ass guess b/c it's a group
...
...
@@ -420,8 +425,18 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
changed
=
True
rc
,
out
,
err
=
module
.
run_command
(
cmd
)
if
rc
!=
0
and
'Nothing to do'
in
err
:
# avoid failing in the 'Nothing To Do' case
# this may happen with an URL spec
rc
=
0
err
=
''
out
=
'
%
s: Nothing to do'
%
spec
changed
=
False
res
[
'rc'
]
+=
rc
res
[
'results'
]
.
append
(
out
)
res
[
'msg'
]
+=
err
...
...
@@ -429,8 +444,9 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
# FIXME - if we did an install - go and check the rpmdb to see if it actually installed
# look for the pkg in rpmdb
# look for the pkg via obsoletes
if
not
rc
:
res
[
'changed'
]
=
True
# accumulate any changes
res
[
'changed'
]
|=
changed
module
.
exit_json
(
**
res
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment