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
e581156d
Commit
e581156d
authored
Oct 09, 2013
by
Jonathan Mainguy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added resp= option for svr4pkg to enable the -r option in pkgadd for response files
parent
3f968ff4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
library/packaging/svr4pkg
+13
-3
No files found.
library/packaging/svr4pkg
View file @
e581156d
...
...
@@ -53,6 +53,9 @@ options:
proxy:
description:
- HTTP[s] proxy to be used if C(src) is a URL.
resp:
description:
- Specifies the location of a response file to be used if package expects input on install.
'''
EXAMPLES
=
'''
...
...
@@ -62,6 +65,9 @@ EXAMPLES = '''
# Install a package directly from an http site
- svr4pkg: name=CSWpkgutil src=http://get.opencsw.org/now state=present
# Install a package with a response file
- svr4pkg: name=CSWggrep src=/tmp/third-party.pkg resp=/tmp/ggrep.response state=present
# Ensure that a package is not installed.
- svr4pkg: name=SUNWgnome-sound-recorder state=absent
'''
...
...
@@ -109,11 +115,13 @@ def run_command(module, cmd):
cmd
[
0
]
=
module
.
get_bin_path
(
progname
,
True
)
return
module
.
run_command
(
cmd
)
def
package_install
(
module
,
name
,
src
,
proxy
):
def
package_install
(
module
,
name
,
src
,
proxy
,
resp
):
adminfile
=
create_admin_file
()
cmd
=
[
'pkgadd'
,
'-na'
,
adminfile
,
'-d'
,
src
]
if
proxy
is
not
None
:
cmd
+=
[
'-x'
,
proxy
]
if
resp
is
not
None
:
cmd
+=
[
'-r'
,
resp
]
cmd
.
append
(
name
)
(
rc
,
out
,
err
)
=
run_command
(
module
,
cmd
)
os
.
unlink
(
adminfile
)
...
...
@@ -132,7 +140,8 @@ def main():
name
=
dict
(
required
=
True
),
state
=
dict
(
required
=
True
,
choices
=
[
'present'
,
'absent'
]),
src
=
dict
(
default
=
None
),
proxy
=
dict
(
default
=
None
)
proxy
=
dict
(
default
=
None
),
resp
=
dict
(
default
=
None
)
),
supports_check_mode
=
True
)
...
...
@@ -140,6 +149,7 @@ def main():
name
=
module
.
params
[
'name'
]
src
=
module
.
params
[
'src'
]
proxy
=
module
.
params
[
'proxy'
]
resp
=
module
.
params
[
'resp'
]
rc
=
None
out
=
''
err
=
''
...
...
@@ -154,7 +164,7 @@ def main():
if
not
package_installed
(
module
,
name
):
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
(
rc
,
out
,
err
)
=
package_install
(
module
,
name
,
src
,
proxy
)
(
rc
,
out
,
err
)
=
package_install
(
module
,
name
,
src
,
proxy
,
resp
)
# Stdout is normally empty but for some packages can be
# very long and is not often useful
if
len
(
out
)
>
75
:
...
...
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