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
6d585252
Commit
6d585252
authored
Mar 30, 2013
by
mujahideen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppressed output and updated documentation
parent
b70c26dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
library/pacman
+7
-7
No files found.
library/pacman
View file @
6d585252
...
...
@@ -30,17 +30,17 @@ version_added: "1.0"
options:
name:
description:
- name of package to install
/remove
- name of package to install
, upgrade or remove.
required: true
state:
description:
- state of the package
installed or absent.
- state of the package
(installed or absent).
required: false
update_cache:
description:
- update the package d
b first (pacman -Syy)
- update the package d
atabase first (pacman -Syy).
required: false
default: "no"
choices: [ "yes", "no" ]
...
...
@@ -55,7 +55,7 @@ examples:
- code: "pacman: name=foo,bar state=absent"
description: remove packages foo and bar
- code: "pacman: name=bar, state=installed, update_cache=yes"
description: update the package d
b (pacman -Syy) then
install bar (bar will be the updated if a newer version exists)
description: update the package d
atabase (pacman -Syy) and
install bar (bar will be the updated if a newer version exists)
'''
...
...
@@ -81,7 +81,7 @@ def query_package(module, name, state="installed"):
def
update_package_db
(
module
):
rc
=
os
.
system
(
"pacman -Syy"
)
rc
=
os
.
system
(
"pacman -Syy
> /dev/null
"
)
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"could not update package db"
)
...
...
@@ -96,7 +96,7 @@ def remove_packages(module, packages):
if
not
query_package
(
module
,
package
):
continue
rc
=
os
.
system
(
"pacman -R
%
s --noconfirm"
%
(
package
))
rc
=
os
.
system
(
"pacman -R
%
s --noconfirm
> /dev/null
"
%
(
package
))
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"failed to remove
%
s"
%
(
package
))
...
...
@@ -118,7 +118,7 @@ def install_packages(module, packages):
if
query_package
(
module
,
package
):
continue
rc
=
os
.
system
(
"pacman -S
%
s --noconfirm"
%
(
package
))
rc
=
os
.
system
(
"pacman -S
%
s --noconfirm
> /dev/null
"
%
(
package
))
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"failed to install
%
s"
%
(
package
))
...
...
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