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
7454038d
Commit
7454038d
authored
Sep 07, 2013
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve logic in setting parameters in check mode (monitor might not exist)
parent
ad5247b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
library/net_infrastructure/bigip_monitor_http
+11
-7
No files found.
library/net_infrastructure/bigip_monitor_http
View file @
7454038d
...
@@ -386,6 +386,7 @@ def main():
...
@@ -386,6 +386,7 @@ def main():
result
[
'changed'
]
|=
True
result
[
'changed'
]
|=
True
else
:
# state present
else
:
# state present
## check for monitor itself
if
not
monitor_exists
:
# create it
if
not
monitor_exists
:
# create it
if
not
module
.
check_mode
:
if
not
module
.
check_mode
:
# again, check changed status here b/c race conditions
# again, check changed status here b/c race conditions
...
@@ -394,19 +395,22 @@ def main():
...
@@ -394,19 +395,22 @@ def main():
else
:
else
:
result
[
'changed'
]
|=
True
result
[
'changed'
]
|=
True
## check for monitor parameters
# whether it already existed, or was just created, now update
# whether it already existed, or was just created, now update
# attributes and properties
# the update functions need to check for check mode but
# the update functions need to check for check mode
# cannot update settings if it doesn't exist which happens in check mode
result
[
'changed'
]
|=
update_monitor_properties
(
api
,
module
,
monitor
,
if
monitor_exists
and
not
module
.
check_mode
:
template_string_properties
,
result
[
'changed'
]
|=
update_monitor_properties
(
api
,
module
,
monitor
,
template_integer_properties
)
template_string_properties
,
template_integer_properties
)
# else assume nothing changed
# monitor specific stuff
# monitor specific stuff
# we just have to update the ipport if monitor already exists and it's different
# we just have to update the ipport if monitor already exists and it's different
if
monitor_exists
and
cur_ipport
!=
ipport
:
if
monitor_exists
and
cur_ipport
!=
ipport
:
if
not
monitor_exists
:
set_ipport
(
api
,
monitor
,
ipport
)
set_ipport
(
api
,
monitor
,
ipport
)
result
[
'changed'
]
|=
True
result
[
'changed'
]
|=
True
#else: monitor doesn't exist (check mode) or ipport is already ok
# monitor specific stuff
# monitor specific stuff
...
...
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