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
9ba053c8
Commit
9ba053c8
authored
Feb 19, 2014
by
James Tanner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ansible cli to use vault for group var files
parent
286ca505
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
bin/ansible
+25
-3
No files found.
bin/ansible
View file @
9ba053c8
...
...
@@ -84,6 +84,7 @@ class Cli(object):
pattern
=
args
[
0
]
"""
inventory_manager = inventory.Inventory(options.inventory)
if options.subset:
inventory_manager.subset(options.subset)
...
...
@@ -101,6 +102,7 @@ class Cli(object):
and not options.module_args):
callbacks.display("No argument passed to
%
s module"
%
options.module_name, color='red', stderr=True)
sys.exit(1)
"""
sshpass
=
None
sudopass
=
None
...
...
@@ -111,7 +113,27 @@ class Cli(object):
options
.
ask_pass
=
False
options
.
ask_sudo_pass
=
options
.
ask_sudo_pass
or
C
.
DEFAULT_ASK_SUDO_PASS
options
.
ask_su_pass
=
options
.
ask_su_pass
or
C
.
DEFAULT_ASK_SU_PASS
(
sshpass
,
sudopass
,
su_pass
)
=
utils
.
ask_passwords
(
ask_pass
=
options
.
ask_pass
,
ask_sudo_pass
=
options
.
ask_sudo_pass
,
ask_su_pass
=
options
.
ask_su_pass
)
(
sshpass
,
sudopass
,
su_pass
,
vault_pass
)
=
utils
.
ask_passwords
(
ask_pass
=
options
.
ask_pass
,
ask_sudo_pass
=
options
.
ask_sudo_pass
,
ask_su_pass
=
options
.
ask_su_pass
,
ask_vault_pass
=
options
.
ask_vault_pass
)
inventory_manager
=
inventory
.
Inventory
(
options
.
inventory
)
if
options
.
subset
:
inventory_manager
.
subset
(
options
.
subset
)
hosts
=
inventory_manager
.
list_hosts
(
pattern
)
if
len
(
hosts
)
==
0
:
callbacks
.
display
(
"No hosts matched"
)
sys
.
exit
(
0
)
if
options
.
listhosts
:
for
host
in
hosts
:
callbacks
.
display
(
'
%
s'
%
host
)
sys
.
exit
(
0
)
if
((
options
.
module_name
==
'command'
or
options
.
module_name
==
'shell'
)
and
not
options
.
module_args
):
callbacks
.
display
(
"No argument passed to
%
s module"
%
options
.
module_name
,
color
=
'red'
,
stderr
=
True
)
sys
.
exit
(
1
)
if
options
.
su_user
or
options
.
ask_su_pass
:
options
.
su
=
True
elif
options
.
sudo_user
or
options
.
ask_sudo_pass
:
...
...
@@ -121,7 +143,6 @@ class Cli(object):
if
options
.
tree
:
utils
.
prepare_writeable_dir
(
options
.
tree
)
runner
=
Runner
(
module_name
=
options
.
module_name
,
module_path
=
options
.
module_path
,
...
...
@@ -143,7 +164,8 @@ class Cli(object):
diff
=
options
.
check
,
su
=
options
.
su
,
su_pass
=
su_pass
,
su_user
=
options
.
su_user
su_user
=
options
.
su_user
,
vault_pass
=
vault_pass
)
if
options
.
seconds
:
...
...
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