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
540d13cf
Commit
540d13cf
authored
Jan 30, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9404 from mmoya/configure-retry-files
Configure retry file usage and location
parents
363a47b4
c15b47fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
bin/ansible-playbook
+1
-1
lib/ansible/constants.py
+3
-0
lib/ansible/playbook/__init__.py
+14
-5
No files found.
bin/ansible-playbook
View file @
540d13cf
...
...
@@ -298,7 +298,7 @@ def main(args):
retries
=
failed_hosts
+
unreachable_hosts
if
len
(
retries
)
>
0
:
if
C
.
RETRY_FILES_ENABLED
and
len
(
retries
)
>
0
:
filename
=
pb
.
generate_retry_inventory
(
retries
)
if
filename
:
display
(
" to retry, use: --limit @
%
s
\n
"
%
filename
)
...
...
lib/ansible/constants.py
View file @
540d13cf
...
...
@@ -161,6 +161,9 @@ DEFAULT_CALLABLE_WHITELIST = get_config(p, DEFAULTS, 'callable_whitelist', '
COMMAND_WARNINGS
=
get_config
(
p
,
DEFAULTS
,
'command_warnings'
,
'ANSIBLE_COMMAND_WARNINGS'
,
False
,
boolean
=
True
)
DEFAULT_LOAD_CALLBACK_PLUGINS
=
get_config
(
p
,
DEFAULTS
,
'bin_ansible_callbacks'
,
'ANSIBLE_LOAD_CALLBACK_PLUGINS'
,
False
,
boolean
=
True
)
RETRY_FILES_ENABLED
=
get_config
(
p
,
DEFAULTS
,
'retry_files_enabled'
,
'ANSIBLE_RETRY_FILES_ENABLED'
,
True
,
boolean
=
True
)
RETRY_FILES_SAVE_PATH
=
get_config
(
p
,
DEFAULTS
,
'retry_files_save_path'
,
'ANSIBLE_RETRY_FILES_SAVE_PATH'
,
'~/.ansible-retry'
)
# CONNECTION RELATED
ANSIBLE_SSH_ARGS
=
get_config
(
p
,
'ssh_connection'
,
'ssh_args'
,
'ANSIBLE_SSH_ARGS'
,
None
)
ANSIBLE_SSH_CONTROL_PATH
=
get_config
(
p
,
'ssh_connection'
,
'control_path'
,
'ANSIBLE_SSH_CONTROL_PATH'
,
"
%(directory)
s/ansible-ssh-
%%
h-
%%
p-
%%
r"
)
...
...
lib/ansible/playbook/__init__.py
View file @
540d13cf
...
...
@@ -643,19 +643,28 @@ class PlayBook(object):
buf
=
StringIO
.
StringIO
()
for
x
in
replay_hosts
:
buf
.
write
(
"
%
s
\n
"
%
x
)
basedir
=
self
.
inventory
.
basedir
(
)
basedir
=
C
.
shell_expand_path
(
C
.
RETRY_FILES_SAVE_PATH
)
filename
=
"
%
s.retry"
%
os
.
path
.
basename
(
self
.
filename
)
filename
=
filename
.
replace
(
".yml"
,
""
)
filename
=
os
.
path
.
join
(
os
.
path
.
expandvars
(
'$HOME/'
)
,
filename
)
filename
=
os
.
path
.
join
(
basedir
,
filename
)
try
:
if
not
os
.
path
.
exists
(
basedir
):
os
.
makedirs
(
basedir
)
fd
=
open
(
filename
,
'w'
)
fd
.
write
(
buf
.
getvalue
())
fd
.
close
()
return
filename
except
:
pass
return
None
ansible
.
callbacks
.
display
(
"
\n
ERROR: could not create retry file. Check the value of
\n
"
+
"the configuration variable 'retry_files_save_path' or set
\n
"
+
"'retry_files_enabled' to False to avoid this message.
\n
"
,
color
=
'red'
)
return
None
return
filename
# *****************************************************
...
...
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