@ -18,6 +18,8 @@ DOCUMENTATION = '''
- - -
- - -
module : ecs_service_facts
module : ecs_service_facts
short_description : list or describe services in ecs
short_description : list or describe services in ecs
notes :
- for details of the parameters and returns see U ( http : / / boto3 . readthedocs . org / en / latest / reference / services / ecs . html )
description :
description :
- Lists or describes services in ecs .
- Lists or describes services in ecs .
version_added : " 2.0 "
version_added : " 2.0 "
@ -34,51 +36,44 @@ options:
- The cluster ARNS in which to list the services .
- The cluster ARNS in which to list the services .
required : false
required : false
default : ' default '
default : ' default '
service :
description :
- The service to get details for ( required if details is true )
required : false
'''
'''
EXAMPLES = '''
EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Basic listing example
# Basic listing example
- ecs_task :
- ecs_service_facts :
cluster = test - cluster
cluster : test - cluster
task_list = 123456789012345678901234567890123456
service : console - test - service
details : " true "
# Basic example of deregistering task
- ecs_task :
# Basic listing example
state : absent
- ecs_service_facts :
family : console - test - tdn
cluster : test - cluster
revision : 1
'''
'''
RETURN = '''
RETURN = '''
cache_updated :
services : When details is false , returns an array of service ARNs , else an array of these fields
description : if the cache was updated or not
clusterArn : The Amazon Resource Name ( ARN ) of the of the cluster that hosts the service .
returned : success , in some cases
desiredCount : The desired number of instantiations of the task definition to keep running on the service .
type : boolean
loadBalancers : A list of load balancer objects
sample : True
loadBalancerName : the name
cache_update_time :
containerName : The name of the container to associate with the load balancer .
description : time of the last cache update ( 0 if unknown )
containerPort : The port on the container to associate with the load balancer .
returned : success , in some cases
pendingCount : The number of tasks in the cluster that are in the PENDING state .
type : datetime
runningCount : The number of tasks in the cluster that are in the RUNNING state .
sample : 1425828348000
serviceArn : The Amazon Resource Name ( ARN ) that identifies the service . The ARN contains the arn : aws : ecs namespace , followed by the region of the service , the AWS account ID of the service owner , the service namespace , and then the service name . For example , arn : aws : ecs : region : 012345678910 : service / my - service .
stdout :
serviceName : A user - generated string used to identify the service
description : output from apt
status : The valid values are ACTIVE , DRAINING , or INACTIVE .
returned : success , when needed
taskDefinition : The ARN of a task definition to use for tasks in the service .
type : string
sample : " Reading package lists... \n Building dependency tree... \n Reading state information... \n The following extra packages will be installed: \n apache2-bin ... "
stderr :
description : error output from apt
returned : success , when needed
type : string
sample : " AH00558: apache2: Could not reliably determine the server ' s fully qualified domain name, using 127.0.1.1. Set the ' ServerName ' directive globally to ... "
'''
'''
try :
try :
import json , os
import json , os
import boto
import boto
import botocore
import botocore
# import module snippets
from ansible . module_utils . basic import *
from ansible . module_utils . ec2 import *
HAS_BOTO = True
HAS_BOTO = True
except ImportError :
except ImportError :
HAS_BOTO = False
HAS_BOTO = False
@ -171,6 +166,7 @@ def main():
# import module snippets
# import module snippets
from ansible . module_utils . basic import *
from ansible . module_utils . basic import *
from ansible . module_utils . urls import *
from ansible . module_utils . urls import *
from ansible . module_utils . ec2 import *
if __name__ == ' __main__ ' :
if __name__ == ' __main__ ' :
main ( )
main ( )