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
c2988dfd
Commit
c2988dfd
authored
Jun 30, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'option-updates' of
git://github.com/jlund/ansible
into devel
Conflicts: bin/ansible-pull
parents
c9b6f0d0
dc984d94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
18 deletions
+14
-18
bin/ansible
+0
-2
bin/ansible-playbook
+4
-8
bin/ansible-pull
+6
-6
lib/ansible/utils/__init__.py
+4
-2
No files found.
bin/ansible
View file @
c2988dfd
...
...
@@ -60,8 +60,6 @@ class Cli(object):
parser
.
add_option
(
'-m'
,
'--module-name'
,
dest
=
'module_name'
,
help
=
"module name to execute (default=
%
s)"
%
C
.
DEFAULT_MODULE_NAME
,
default
=
C
.
DEFAULT_MODULE_NAME
)
parser
.
add_option
(
'--list-hosts'
,
dest
=
'listhosts'
,
action
=
'store_true'
,
help
=
"dump out a list of hosts matching input pattern, does not execute any modules!"
)
options
,
args
=
parser
.
parse_args
()
self
.
callbacks
.
options
=
options
...
...
bin/ansible-playbook
View file @
c2988dfd
...
...
@@ -52,10 +52,9 @@ def main(args):
''' run ansible-playbook operations '''
# create parser for CLI options
usage
=
"
%
prog playbook.yml"
parser
=
utils
.
base_parser
(
constants
=
C
,
usage
=
usage
,
usage
=
"
%
prog playbook.yml"
,
connect_opts
=
True
,
runas_opts
=
True
,
subset_opts
=
True
,
...
...
@@ -66,17 +65,14 @@ def main(args):
help
=
"set additional key=value variables from the CLI"
)
parser
.
add_option
(
'-t'
,
'--tags'
,
dest
=
'tags'
,
default
=
'all'
,
help
=
"only run plays and tasks tagged with these values"
)
# FIXME: list hosts is a common option and can be moved to utils/__init__.py
parser
.
add_option
(
'--list-hosts'
,
dest
=
'listhosts'
,
action
=
'store_true'
,
help
=
"dump out a list of hosts, each play will run against, does not run playbook!"
)
parser
.
add_option
(
'--syntax-check'
,
dest
=
'syntax'
,
action
=
'store_true'
,
help
=
"
do a playbook syntax check on the playbook, do not execute the playbook
"
)
help
=
"
perform a syntax check on the playbook, but do not execute it
"
)
parser
.
add_option
(
'--list-tasks'
,
dest
=
'listtasks'
,
action
=
'store_true'
,
help
=
"
do
list all tasks that would be executed"
)
help
=
"list all tasks that would be executed"
)
parser
.
add_option
(
'--step'
,
dest
=
'step'
,
action
=
'store_true'
,
help
=
"one-step-at-a-time: confirm each task before running"
)
parser
.
add_option
(
'--start-at-task'
,
dest
=
'start_at'
,
help
=
"start the playbook
with a
task matching this name"
)
help
=
"start the playbook
at the
task matching this name"
)
options
,
args
=
parser
.
parse_args
(
args
)
...
...
bin/ansible-pull
View file @
c2988dfd
...
...
@@ -98,18 +98,18 @@ def main(args):
usage
=
"
%
prog [options] [playbook.yml]"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
'--purge'
,
default
=
False
,
action
=
'store_true'
,
help
=
'
P
urge git checkout after playbook run'
)
help
=
'
p
urge git checkout after playbook run'
)
parser
.
add_option
(
'-o'
,
'--only-if-changed'
,
dest
=
'ifchanged'
,
default
=
False
,
action
=
'store_true'
,
help
=
'
O
nly run the playbook if the repository has been updated'
)
help
=
'
o
nly run the playbook if the repository has been updated'
)
parser
.
add_option
(
'-d'
,
'--directory'
,
dest
=
'dest'
,
default
=
None
,
help
=
'
Directory to clon
e git repository to'
)
help
=
'
directory to clone th
e git repository to'
)
parser
.
add_option
(
'-U'
,
'--url'
,
dest
=
'url'
,
default
=
None
,
help
=
'URL of git repository'
)
help
=
'URL of
the
git repository'
)
parser
.
add_option
(
'-C'
,
'--checkout'
,
dest
=
'checkout'
,
default
=
"HEAD"
,
help
=
'
Branch/Tag/Commit to checkout. Defaults to HEAD.
'
)
help
=
'
branch/tag/commit to checkout; defaults to HEAD
'
)
parser
.
add_option
(
'-i'
,
'--inventory-file'
,
dest
=
'inventory'
,
help
=
"
specify
inventory host file"
)
help
=
"
location of the
inventory host file"
)
options
,
args
=
parser
.
parse_args
(
args
)
if
not
options
.
dest
:
...
...
lib/ansible/utils/__init__.py
View file @
c2988dfd
...
...
@@ -469,6 +469,8 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False,
help
=
'use this file to authenticate the connection'
)
parser
.
add_option
(
'-K'
,
'--ask-sudo-pass'
,
default
=
False
,
dest
=
'ask_sudo_pass'
,
action
=
'store_true'
,
help
=
'ask for sudo password'
)
parser
.
add_option
(
'--list-hosts'
,
dest
=
'listhosts'
,
action
=
'store_true'
,
help
=
'outputs a list of matching hosts; does not execute anything else'
)
parser
.
add_option
(
'-M'
,
'--module-path'
,
dest
=
'module_path'
,
help
=
"specify path(s) to module library (default=
%
s)"
%
constants
.
DEFAULT_MODULE_PATH
,
default
=
None
)
...
...
@@ -510,12 +512,12 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False,
if
check_opts
:
parser
.
add_option
(
"-C"
,
"--check"
,
default
=
False
,
dest
=
'check'
,
action
=
'store_true'
,
help
=
"don't make any changes
, instead
try to predict some of the changes that may occur"
help
=
"don't make any changes
; instead,
try to predict some of the changes that may occur"
)
if
diff_opts
:
parser
.
add_option
(
"-D"
,
"--diff"
,
default
=
False
,
dest
=
'diff'
,
action
=
'store_true'
,
help
=
"when changing (small) files and templates, show the differences in those files
,
works great with --check"
help
=
"when changing (small) files and templates, show the differences in those files
;
works great with --check"
)
...
...
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