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
09259cbd
Commit
09259cbd
authored
Mar 28, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6671 from dermute/svr4pkg-G
svr4pkg supports the -G switch for pkgadd
parents
0e8c7b1c
69e09b04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
library/packaging/svr4pkg
+18
-5
No files found.
library/packaging/svr4pkg
View file @
09259cbd
...
@@ -57,6 +57,14 @@ options:
...
@@ -57,6 +57,14 @@ options:
description:
description:
- Specifies the location of a response file to be used if package expects input on install. (added in Ansible 1.4)
- Specifies the location of a response file to be used if package expects input on install. (added in Ansible 1.4)
required: false
required: false
zone:
description:
- Whether to install the package only in the current zone, or install it into all zones.
- The installation into all zones works only if you are working with the global zone.
required: false
default: "all"
choices: ["current", "all"]
version_added: "1.6"
'''
'''
EXAMPLES
=
'''
EXAMPLES
=
'''
...
@@ -64,7 +72,7 @@ EXAMPLES = '''
...
@@ -64,7 +72,7 @@ EXAMPLES = '''
- svr4pkg: name=CSWcommon src=/tmp/cswpkgs.pkg state=present
- svr4pkg: name=CSWcommon src=/tmp/cswpkgs.pkg state=present
# Install a package directly from an http site
# Install a package directly from an http site
- svr4pkg: name=CSWpkgutil src=http://get.opencsw.org/now state=present
- svr4pkg: name=CSWpkgutil src=http://get.opencsw.org/now state=present
zone=current
# Install a package with a response file
# Install a package with a response file
- svr4pkg: name=CSWggrep src=/tmp/third-party.pkg response_file=/tmp/ggrep.response state=present
- svr4pkg: name=CSWggrep src=/tmp/third-party.pkg response_file=/tmp/ggrep.response state=present
...
@@ -116,9 +124,12 @@ def run_command(module, cmd):
...
@@ -116,9 +124,12 @@ def run_command(module, cmd):
cmd
[
0
]
=
module
.
get_bin_path
(
progname
,
True
)
cmd
[
0
]
=
module
.
get_bin_path
(
progname
,
True
)
return
module
.
run_command
(
cmd
)
return
module
.
run_command
(
cmd
)
def
package_install
(
module
,
name
,
src
,
proxy
,
response_file
):
def
package_install
(
module
,
name
,
src
,
proxy
,
response_file
,
zone
):
adminfile
=
create_admin_file
()
adminfile
=
create_admin_file
()
cmd
=
[
'pkgadd'
,
'-na'
,
adminfile
,
'-d'
,
src
]
cmd
=
[
'pkgadd'
,
'-n'
]
if
zone
==
'current'
:
cmd
+=
[
'-G'
]
cmd
+=
[
'-a'
,
adminfile
,
'-d'
,
src
]
if
proxy
is
not
None
:
if
proxy
is
not
None
:
cmd
+=
[
'-x'
,
proxy
]
cmd
+=
[
'-x'
,
proxy
]
if
response_file
is
not
None
:
if
response_file
is
not
None
:
...
@@ -142,7 +153,8 @@ def main():
...
@@ -142,7 +153,8 @@ def main():
state
=
dict
(
required
=
True
,
choices
=
[
'present'
,
'absent'
]),
state
=
dict
(
required
=
True
,
choices
=
[
'present'
,
'absent'
]),
src
=
dict
(
default
=
None
),
src
=
dict
(
default
=
None
),
proxy
=
dict
(
default
=
None
),
proxy
=
dict
(
default
=
None
),
response_file
=
dict
(
default
=
None
)
response_file
=
dict
(
default
=
None
),
zone
=
dict
(
required
=
False
,
default
=
'all'
,
choices
=
[
'current'
,
'all'
])
),
),
supports_check_mode
=
True
supports_check_mode
=
True
)
)
...
@@ -151,6 +163,7 @@ def main():
...
@@ -151,6 +163,7 @@ def main():
src
=
module
.
params
[
'src'
]
src
=
module
.
params
[
'src'
]
proxy
=
module
.
params
[
'proxy'
]
proxy
=
module
.
params
[
'proxy'
]
response_file
=
module
.
params
[
'response_file'
]
response_file
=
module
.
params
[
'response_file'
]
zone
=
module
.
params
[
'zone'
]
rc
=
None
rc
=
None
out
=
''
out
=
''
err
=
''
err
=
''
...
@@ -165,7 +178,7 @@ def main():
...
@@ -165,7 +178,7 @@ def main():
if
not
package_installed
(
module
,
name
):
if
not
package_installed
(
module
,
name
):
if
module
.
check_mode
:
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
module
.
exit_json
(
changed
=
True
)
(
rc
,
out
,
err
)
=
package_install
(
module
,
name
,
src
,
proxy
,
response_file
)
(
rc
,
out
,
err
)
=
package_install
(
module
,
name
,
src
,
proxy
,
response_file
,
zone
)
# Stdout is normally empty but for some packages can be
# Stdout is normally empty but for some packages can be
# very long and is not often useful
# very long and is not often useful
if
len
(
out
)
>
75
:
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