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
5f791329
Commit
5f791329
authored
Jul 04, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now verbose mode shows config file used
parent
67671e32
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
6 deletions
+22
-6
lib/ansible/cli/__init__.py
+3
-1
lib/ansible/cli/adhoc.py
+3
-0
lib/ansible/cli/doc.py
+2
-0
lib/ansible/cli/galaxy.py
+2
-0
lib/ansible/cli/playbook.py
+2
-0
lib/ansible/cli/pull.py
+2
-0
lib/ansible/cli/vault.py
+2
-0
lib/ansible/constants.py
+6
-5
No files found.
lib/ansible/cli/__init__.py
View file @
5f791329
...
...
@@ -99,7 +99,9 @@ class CLI(object):
raise
Exception
(
"Need to implement!"
)
def
run
(
self
):
raise
Exception
(
"Need to implement!"
)
if
self
.
options
.
verbosity
>
0
:
self
.
display
.
display
(
"Using
%
s as config file"
%
C
.
CONFIG_FILE
)
@staticmethod
def
ask_vault_passwords
(
ask_vault_pass
=
False
,
ask_new_vault_pass
=
False
,
confirm_vault
=
False
,
confirm_new
=
False
):
...
...
lib/ansible/cli/adhoc.py
View file @
5f791329
...
...
@@ -76,6 +76,9 @@ class AdHocCLI(CLI):
def
run
(
self
):
''' use Runner lib to do SSH things '''
super
(
AdHocCLI
,
self
)
.
run
()
# only thing left should be host pattern
pattern
=
self
.
args
[
0
]
...
...
lib/ansible/cli/doc.py
View file @
5f791329
...
...
@@ -61,6 +61,8 @@ class DocCLI(CLI):
def
run
(
self
):
super
(
DocCLI
,
self
)
.
run
()
if
self
.
options
.
module_path
is
not
None
:
for
i
in
self
.
options
.
module_path
.
split
(
os
.
pathsep
):
module_loader
.
add_directory
(
i
)
...
...
lib/ansible/cli/galaxy.py
View file @
5f791329
...
...
@@ -124,6 +124,8 @@ class GalaxyCLI(CLI):
def
run
(
self
):
super
(
GalaxyCLI
,
self
)
.
run
()
# if not offline, get connect to galaxy api
if
self
.
action
in
(
"info"
,
"install"
)
or
(
self
.
action
==
'init'
and
not
self
.
options
.
offline
):
api_server
=
self
.
options
.
api_server
...
...
lib/ansible/cli/playbook.py
View file @
5f791329
...
...
@@ -81,6 +81,8 @@ class PlaybookCLI(CLI):
def
run
(
self
):
super
(
PlaybookCLI
,
self
)
.
run
()
# Note: slightly wrong, this is written so that implicit localhost
# Manage passwords
sshpass
=
None
...
...
lib/ansible/cli/pull.py
View file @
5f791329
...
...
@@ -98,6 +98,8 @@ class PullCLI(CLI):
def
run
(
self
):
''' use Runner lib to do SSH things '''
super
(
PullCLI
,
self
)
.
run
()
# log command line
now
=
datetime
.
datetime
.
now
()
self
.
display
.
display
(
now
.
strftime
(
"Starting Ansible Pull at
%
F
%
T"
))
...
...
lib/ansible/cli/vault.py
View file @
5f791329
...
...
@@ -70,6 +70,8 @@ class VaultCLI(CLI):
def
run
(
self
):
super
(
VaultCLI
,
self
)
.
run
()
if
self
.
options
.
vault_password_file
:
# read vault_pass from a file
self
.
vault_pass
=
read_vault_file
(
self
.
options
.
vault_password_file
)
...
...
lib/ansible/constants.py
View file @
5f791329
...
...
@@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
from
__future__
import
(
absolute_import
,
division
,
print_function
)
from
__future__
import
(
absolute_import
,
division
)
__metaclass__
=
type
import
os
...
...
@@ -26,6 +26,8 @@ import sys
from
six.moves
import
configparser
from
string
import
ascii_letters
,
digits
from
ansible.errors
import
AnsibleOptionsError
# copied from utils, avoid circular reference fun :)
def
mk_boolean
(
value
):
if
value
is
None
:
...
...
@@ -81,9 +83,8 @@ def load_config_file():
try
:
p
.
read
(
path
)
except
configparser
.
Error
as
e
:
print
(
"Error reading config file:
\n
{0}"
.
format
(
e
))
sys
.
exit
(
1
)
return
p
raise
AnsibleOptionsError
(
"Error reading config file:
\n
{0}"
.
format
(
e
))
return
p
,
path
return
None
def
shell_expand_path
(
path
):
...
...
@@ -93,7 +94,7 @@ def shell_expand_path(path):
path
=
os
.
path
.
expanduser
(
os
.
path
.
expandvars
(
path
))
return
path
p
=
load_config_file
()
p
,
CONFIG_FILE
=
load_config_file
()
active_user
=
pwd
.
getpwuid
(
os
.
geteuid
())[
0
]
...
...
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