??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
 Udac@sidd6dgd6dd6ZdZdZdd lZdd lZdd lZdd lmZdd lm Z dd l m Z dd l m Z mZmZddlmZmZddlmZmZy\dd lZddlmZmZddlmZddlmZddlmZeZ Wne!k r;e"Z nXe#dZ$dZ%e#e#e#dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.e#dZ/d Z0d!Z1d"Z2d#Z3d$Z4d%Z5d&Z6e7d'kr e6nd S((s1.1tmetadata_versiontstableinterfacetstatustcoret supported_bys! --- module: ec2 short_description: create, terminate, start or stop an instance in ec2 description: - Creates or terminates ec2 instances. version_added: "0.9" options: key_name: description: - key pair to use on the instance. The SSH key must exist on AWS in order to use this argument. If you want to generate keys from Ansible, take a look at `ec2_key` module. aliases: ['keypair'] type: str id: version_added: "1.1" description: - Identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances. - This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on. - For details, see the description of client token at U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). type: str group: description: - Security group (or list of groups) to use with the instance. aliases: [ 'groups' ] type: list group_id: version_added: "1.1" description: - Security group id (or list of ids) to use with the instance. type: list region: version_added: "1.2" description: - The AWS region to use. Must be specified if ec2_url is not used. - If not specified then the value of the C(AWS_REGION) or C(EC2_REGION) environment variable, if any, is used. - See U(https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). aliases: [ 'aws_region', 'ec2_region' ] type: str zone: version_added: "1.2" description: - AWS availability zone in which to launch the instance. aliases: [ 'aws_zone', 'ec2_zone' ] type: str instance_type: description: - Instance type to use for the instance, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). required: true type: str tenancy: version_added: "1.9" description: - An instance with a tenancy of "dedicated" runs on single-tenant hardware and can only be launched into a VPC. - Note that to use dedicated tenancy you MUST specify a I(vpc_subnet_id) as well. - Dedicated tenancy is not available for EC2 "micro" instances. default: default choices: [ "default", "dedicated" ] type: str spot_price: version_added: "1.5" description: - Maximum spot price to bid. If not set, a regular on-demand instance is requested. - A spot request is made with this maximum bid. When it is filled, the instance is started. type: str spot_type: version_added: "2.0" description: - Type of spot request; one of "one-time" or "persistent". Defaults to "one-time" if not supplied. default: "one-time" choices: [ "one-time", "persistent" ] type: str image: description: - I(ami) ID to use for the instance. required: true type: str kernel: description: - Kernel I(eki) to use for the instance. type: str ramdisk: description: - Ramdisk I(eri) to use for the instance. type: str wait: description: - Wait for the instance to reach its desired state before returning. - Does not wait for SSH, see 'wait_for_connection' example for details. type: bool default: 'no' wait_timeout: description: - How long before wait gives up, in seconds. default: 300 type: int spot_wait_timeout: version_added: "1.5" description: - How long to wait for the spot instance request to be fulfilled. Affects 'Request valid until' for setting spot request lifespan. default: 600 type: int count: description: - Number of instances to launch. default: 1 type: int monitoring: version_added: "1.1" description: - Enable detailed monitoring (CloudWatch) for instance. type: bool default: 'no' user_data: version_added: "0.9" description: - Opaque blob of data which is made available to the EC2 instance. type: str instance_tags: version_added: "1.0" description: - A hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; '{"key":"value"}' and '{"key":"value","key":"value"}'. type: dict placement_group: version_added: "1.3" description: - Placement group for the instance when using EC2 Clustered Compute. type: str vpc_subnet_id: version_added: "1.1" description: - the subnet ID in which to launch the instance (VPC). type: str assign_public_ip: version_added: "1.5" description: - When provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+. type: bool private_ip: version_added: "1.2" description: - The private ip address to assign the instance (from the vpc subnet). type: str instance_profile_name: version_added: "1.3" description: - Name of the IAM instance profile (i.e. what the EC2 console refers to as an "IAM Role") to use. Boto library must be 2.5.0+. type: str instance_ids: version_added: "1.3" description: - "list of instance ids, currently used for states: absent, running, stopped" aliases: ['instance_id'] type: list source_dest_check: version_added: "1.6" description: - Enable or Disable the Source/Destination checks (for NAT instances and Virtual Routers). When initially creating an instance the EC2 API defaults this to True. type: bool termination_protection: version_added: "2.0" description: - Enable or Disable the Termination Protection. type: bool default: 'no' instance_initiated_shutdown_behavior: version_added: "2.2" description: - Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store. images (which require termination on shutdown). default: 'stop' choices: [ "stop", "terminate" ] type: str state: version_added: "1.3" description: - Create, terminate, start, stop or restart instances. The state 'restarted' was added in Ansible 2.2. - When 'absent', I(instance_ids) is required. - When 'running', 'stopped' and 'restarted', I(instance_ids) or I(instance_tags) is required. default: 'present' choices: ['absent', 'present', 'restarted', 'running', 'stopped'] type: str volumes: version_added: "1.5" description: - a list of hash/dictionaries of volumes to add to the new instance; '[{"key":"value", "key":"value"}]'; keys allowed are - device_name (str; required), delete_on_termination (bool; False), ephemeral (str), encrypted (bool; False), snapshot (str), volume_type (str), volume_size (int, GiB), iops (int) - iops must be set when volume_type='io1', ephemeral and snapshot are mutually exclusive. type: list ebs_optimized: version_added: "1.6" description: - whether instance is using optimized EBS volumes, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html). default: 'no' type: bool exact_count: version_added: "1.5" description: - An integer value which indicates how many instances that match the 'count_tag' parameter should be running. Instances are either created or terminated based on this value. type: int count_tag: version_added: "1.5" description: - Used with 'exact_count' to determine how many nodes based on a specific tag criteria should be running. This can be expressed in multiple ways and is shown in the EXAMPLES section. For instance, one can request 25 servers that are tagged with "class=webserver". The specified tag must already exist or be passed in as the 'instance_tags' option. network_interfaces: version_added: "2.0" description: - A list of existing network interfaces to attach to the instance at launch. When specifying existing network interfaces, none of the assign_public_ip, private_ip, vpc_subnet_id, group, or group_id parameters may be used. (Those parameters are for creating a new network interface at launch.) aliases: ['network_interface'] type: list spot_launch_group: version_added: "2.1" description: - Launch group for spot request, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html#spot-launch-group). type: str author: - "Tim Gerla (@tgerla)" - "Lester Wade (@lwade)" - "Seth Vidal (@skvidal)" extends_documentation_fragment: aws s # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic provisioning example - ec2: key_name: mykey instance_type: t2.micro image: ami-123456 wait: yes group: webserver count: 3 vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # Advanced example with tagging and CloudWatch - ec2: key_name: mykey group: databases instance_type: t2.micro image: ami-123456 wait: yes wait_timeout: 500 count: 5 instance_tags: db: postgres monitoring: yes vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # Single instance with additional IOPS volume from snapshot and volume delete on termination - ec2: key_name: mykey group: webserver instance_type: c3.medium image: ami-123456 wait: yes wait_timeout: 500 volumes: - device_name: /dev/sdb snapshot: snap-abcdef12 volume_type: io1 iops: 1000 volume_size: 100 delete_on_termination: true monitoring: yes vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # Single instance with ssd gp2 root volume - ec2: key_name: mykey group: webserver instance_type: c3.medium image: ami-123456 wait: yes wait_timeout: 500 volumes: - device_name: /dev/xvda volume_type: gp2 volume_size: 8 vpc_subnet_id: subnet-29e63245 assign_public_ip: yes count_tag: Name: dbserver exact_count: 1 # Multiple groups example - ec2: key_name: mykey group: ['databases', 'internal-services', 'sshable', 'and-so-forth'] instance_type: m1.large image: ami-6e649707 wait: yes wait_timeout: 500 count: 5 instance_tags: db: postgres monitoring: yes vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # Multiple instances with additional volume from snapshot - ec2: key_name: mykey group: webserver instance_type: m1.large image: ami-6e649707 wait: yes wait_timeout: 500 count: 5 volumes: - device_name: /dev/sdb snapshot: snap-abcdef12 volume_size: 10 monitoring: yes vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # Dedicated tenancy example - local_action: module: ec2 assign_public_ip: yes group_id: sg-1dc53f72 key_name: mykey image: ami-6e649707 instance_type: m1.small tenancy: dedicated vpc_subnet_id: subnet-29e63245 wait: yes # Spot instance example - ec2: spot_price: 0.24 spot_wait_timeout: 600 keypair: mykey group_id: sg-1dc53f72 instance_type: m1.small image: ami-6e649707 wait: yes vpc_subnet_id: subnet-29e63245 assign_public_ip: yes spot_launch_group: report_generators instance_initiated_shutdown_behavior: terminate # Examples using pre-existing network interfaces - ec2: key_name: mykey instance_type: t2.small image: ami-f005ba11 network_interface: eni-deadbeef - ec2: key_name: mykey instance_type: t2.small image: ami-f005ba11 network_interfaces: ['eni-deadbeef', 'eni-5ca1ab1e'] # Launch instances, runs some tasks # and then terminate them - name: Create a sandbox instance hosts: localhost gather_facts: False vars: keypair: my_keypair instance_type: m1.small security_group: my_securitygroup image: my_ami_id region: us-east-1 tasks: - name: Launch instance ec2: key_name: "{{ keypair }}" group: "{{ security_group }}" instance_type: "{{ instance_type }}" image: "{{ image }}" wait: true region: "{{ region }}" vpc_subnet_id: subnet-29e63245 assign_public_ip: yes register: ec2 - name: Add new instance to host group add_host: hostname: "{{ item.public_ip }}" groupname: launched loop: "{{ ec2.instances }}" - name: Wait for SSH to come up delegate_to: "{{ item.public_dns_name }}" wait_for_connection: delay: 60 timeout: 320 loop: "{{ ec2.instances }}" - name: Configure instance(s) hosts: launched become: True gather_facts: True roles: - my_awesome_role - my_awesome_test - name: Terminate instances hosts: localhost tasks: - name: Terminate instances that were previously launched ec2: state: 'absent' instance_ids: '{{ ec2.instance_ids }}' # Start a few existing instances, run some tasks # and stop the instances - name: Start sandbox instances hosts: localhost gather_facts: false vars: instance_ids: - 'i-xxxxxx' - 'i-xxxxxx' - 'i-xxxxxx' region: us-east-1 tasks: - name: Start the sandbox instances ec2: instance_ids: '{{ instance_ids }}' region: '{{ region }}' state: running wait: True vpc_subnet_id: subnet-29e63245 assign_public_ip: yes roles: - do_neat_stuff - do_more_neat_stuff - name: Stop sandbox instances hosts: localhost gather_facts: false vars: instance_ids: - 'i-xxxxxx' - 'i-xxxxxx' - 'i-xxxxxx' region: us-east-1 tasks: - name: Stop the sandbox instances ec2: instance_ids: '{{ instance_ids }}' region: '{{ region }}' state: stopped wait: True vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # # Start stopped instances specified by tag # - local_action: module: ec2 instance_tags: Name: ExtraPower state: running # # Restart instances specified by tag # - local_action: module: ec2 instance_tags: Name: ExtraPower state: restarted # # Enforce that 5 instances with a tag "foo" are running # (Highly recommended!) # - ec2: key_name: mykey instance_type: c1.medium image: ami-40603AD1 wait: yes group: webserver instance_tags: foo: bar exact_count: 5 count_tag: foo vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # # Enforce that 5 running instances named "database" with a "dbtype" of "postgres" # - ec2: key_name: mykey instance_type: c1.medium image: ami-40603AD1 wait: yes group: webserver instance_tags: Name: database dbtype: postgres exact_count: 5 count_tag: Name: database dbtype: postgres vpc_subnet_id: subnet-29e63245 assign_public_ip: yes # # count_tag complex argument examples # # instances with tag foo - ec2: count_tag: foo: # instances with tag foo=bar - ec2: count_tag: foo: bar # instances with tags foo=bar & baz - ec2: count_tag: foo: bar baz: # instances with tags foo & bar & baz=bang - ec2: count_tag: - foo - bar - baz: bang iN(t literal_eval(t LooseVersion(t AnsibleModule(tget_aws_connection_infotec2_argument_spect ec2_connect(tget_function_codet string_types(tto_bytestto_text(tBlockDeviceTypetBlockDeviceMapping(tEC2ResponseError(tconnect_ec2_endpoint(t connect_vpcc Cs|jjd}|d kr'd}nt|||d|d|d|}g}xe|D]]}t|drXxE|jD]7} | jdksw| jdkrqwn|j| qwWqXqXW||fS( Ntstatetrunningtstoppedttagstzonet instancest terminateds shutting-down(RR(tparamstgettNonetget_reservationsthasattrRRtappend( tmoduletec2tvpct count_tagRRt reservationsRtrestinst((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyt#find_running_instances_by_count_tagQs  $ cCs\|}xO|D]G}t||tr=t||||scss%|]\}}d||fVqdS(stag:N((R2R3R4((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pys stmsgs)Filters based on tag is empty => tags: %ssinstance-state-namesavailability-zonetids client-tokentfilters(R+RRRtupdatetget_all_subnetstvpc_idR*tstrRt ExceptiontintRtlistR,titemst fail_jsontget_all_instances( R!R"R#RRRR7R0R:txtresults((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyRnsL "    & &cCs/i|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd 6|j d 6|j d 6|j d 6|j d d6|j d6|j d6|jd6|jd6|jd6|jd6|jd6|jd6|jd6td|jDd6}yt|d|dstgroupstvirtualization_typet ebs_optimizedtblock_device_mappingRt volume_idtdelete_on_terminationtplacement_tenancyttenancytdefaultN(R6RDtprivate_ip_addressRFt ip_addressRHRIRJRKRLRMRNRPRQRRRSRTRURRVRR+RYtgetattrtAttributeErrorRtFalsetkeysRR]R^(R't instance_infotbdm_dicttbdmt device_name((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytget_instance_infos^                         cCs@y'tjjj}t|dtSWntk r;tSXdS(s Check if Boto library has associate_public_ip_address in the NetworkInterfaceSpecification class. Added in Boto 2.13.0 ec2: authenticated ec2 connection object Returns: True if Boto library accepts associate_public_ip_address argument, else false tassociate_public_ip_addressN(tbotoR"tnetworkinterfacetNetworkInterfaceSpecificationRdtTrueReRf(R"tnetwork_interface((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyt)boto_supports_associate_public_ip_addresss   cCs"t|d}dt|jkS(s Check if Boto library has instance_profile_name argument. instance_profile_name has been added in Boto 2.5.0 ec2: authenticated ec2 connection object Returns: True if Boto library accept instance_profile_name argument, else false t run_instancestinstance_profile_name(RdR t co_varnames(R"trun_instances_method((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytboto_supports_profile_name_args cCs(ttdo'ttjtdkS(s Check if Boto library supports encryption of EBS volumes (added in 2.29.0) Returns: True if boto library has the named param as an argument on the request_spot_instances method, else False tVersions2.29.0(RRnRRy(((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytboto_supports_volume_encryption scCsd}|jd}d|krOd|krOd|krO|jddqOnd|kr|dkrd |kr|jdd nd |kr|jd |dgd }|jd|j}t|d ||kr|jdd |qqnd|kr)d|kr)|jddq)ntrtd|jdd|jdd|jdd|d|jdtd |jd d|jddStd|jdd|jdd|jdd|d|jdtd |jd SdS(Nit volume_typetsnapshott ephemeralt volume_sizeR5sNSize must be specified when creating a new volume or modifying the root volumetio1tiopss'io1 volumes must have an iops value sett snapshot_idsis/IOPS must be at most %d times greater than sizes&Cannot set both ephemeral and snapshott snapshot_idtephemeral_nametsizeR^t encrypted( RR@tget_all_snapshotsR~R=RzRRfR(R!R"tvolumetMAX_IOPS_TO_SIZE_RATIOR{R|R((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytcreate_block_devices<      cCs"t|d}|t|jkS(sG Check if Boto library has a in its request_spot_instances() method. For example, the placement_group parameter wasn't added until 2.3.0. ec2: authenticated ec2 connection object Returns: True if boto library has the named param as an argument on the request_spot_instances method, else False trequest_spot_instances(RdR Rv(R"tparamtmethod((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyt#boto_supports_param_in_spot_request9s c Cst|jjd}tj|}t}xtj|kr|j}xj|D]b}|j|krtqYnxD|D]<} | j|jkrq{n| jdk r| j||jSpot instance request %s failed with status %s and fault %s:%st cancelledsDSpot instance request %s was cancelled before it could be fulfilled.tclosedsinstance-terminated-by-usersMSpot instance request %s was closed by AWS with the status %s and fault %s:%sis$wait for spot requests timeout on %sN(R=RRttimeR+tget_all_spot_instance_requestsR6t instance_idRRR@RtcodetfaulttmessagetlentsleepR>tvaluestasctime( R!R"t spot_requeststcountRt wait_completetspot_req_inst_idstreqstsirbtsirtspot_msg((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytawait_spot_requestsFs>      ,@cCsX|jjd}|jjd}|jjd}|r[|dkr[|jddnt|||||\}}d}t} g} d} t||krt}nMt||krt}|t|} | st|||d| \} } }x| D]} |j | qWqnt||krt}t||}| st g|D]}|j ^qW}|d|!}g|D]}|j |kr|^q}t |||\}} } g}x%| D]} d| d <|j | qW|} qng}xF|D]>} t | ts7t|| t| } n|j | qW|| | |fS( Nt exact_countR$RR5s4you must use the 'count_tag' option with exact_counttoverride_countiRR(RRRR@R(RfRRqtcreate_instancesR tsortedR6tterminate_instancesR*R+t$warn_if_public_ip_assignment_changedRl(R!R"R#RR$RR%Rtchangedt checkmodetinstance_dict_arraytchanged_instance_idst to_createR't to_removeRBtall_instance_idst remove_idstterminated_listt all_instances((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyt enforce_countsN ! " (     cC Csd |jjd}|jjd}|jjd}|jjd}|jjd}|jjd} |jjd} |jjd} |jjd } |jjd } |r|}n|jjd }|jjd }|jjd }|jjd}|jjd}t|jjd}t|jjd}|jjd}|jjd}|jjd}|jjd}|j|jjd}|jjd}|jjd}|jjd}|jjd}|jjd}|jjd}|j|jjd} |j|jjd}!|jjd}"|jjd }#|jjd!}$d`}%|r|s|jd"d#q|jd$|gd%j}%nd`}%y0|r|%r|jd&i|%d'6}&n |j}&t |t r$|g}nt |j d(|&D}'t |'d%kru|jd"d)d*j|'ng|&D]*}(t|(j|kr|t|(j^q|}nR|rt |t r|g}n|jd+|}&g|&D]})|)j^q}nWn/tjjk r3}*|jd"t|*nXg}+t|},|d`k ri|d,6d-d.6}-|jd`|-}.x/|.D]'}/x|/jD]}0|+j|0qWqW|,t |+},n|,d%krt}1n5t}1yi| d/6|d6|d06|d16| d6|d26|d36}2|d`k r7t|d4d5|2d|5}3|4j|3qWtjjj |4|2dx|t3j3kr |=t |9kr y|j|9}>Wn>tjj1k rM }*|*j(dYkrG t3j4dZq qN nXd%}=xC|>D];}/|=t g|/jD]}5|5j)d-krq |5^qq 7}=q[ Wt |>d%kr t3j4dZq n|r |=t |9kr t3j4d[q Pq W|r! |t3j3kr! |jd"d\t3j5nx|>D]}/|+j6|/jq( W| tkru x$|/jD]}?|?j7d]tqX Wn|!tkr x$|/jD]}?|?j7d^tq Wn|r |9r y|j8|9|Wq tjj'k r }*|jd"d_|*j(|*j2fq Xng}@g}AxA|+D]9}?|?j$t9|?}B|Aj|?j|@j|Bq W|@|A|1fS(bs Creates new instances module : AnsibleModule object ec2: authenticated ec2 connection object Returns: A list of dictionaries with instance information about the instances that were launched RMR6RXtgroup_idRRSR`t spot_pricet spot_typetimageRt monitoringRPRQtwaitt wait_timeoutRtplacement_groupt user_datat instance_tagsR0tassign_public_ipRERutvolumesR[RR$tsource_dest_checkttermination_protectiontnetwork_interfacestspot_launch_groupt$instance_initiated_shutdown_behaviorR5sregion must be specifiedR1iR7R:css|]}t|jVqdS(N(R;RW(R2tgrp((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pys ss+The following group names are not valid: %ss, t group_idss client-tokenRsinstance-state-nameRLtmonitoring_enabledRNt kernel_idt ramdisk_idterrorstsurrogate_or_strictsEinstance_profile_name parameter requires Boto version 2.5.0 or highersBassign_public_ip parameter requires Boto version 2.13.0 or higher.s2assign_public_ip only available with vpc_subnet_idt subnet_idRbRYRmtnetwork_interface_idt device_indextsecurity_group_idstsecurity_groupsRks"Device name must be set for volumeR~tblock_device_mapt min_countt max_countt client_tokentstopt terminatetInvalidParameterCombinations'InvalidInstanceID.NotFoundRsInstances with id(s) %s s9were created previously but have since been terminated - s1use a (possibly different) 'instanceid' parameters=private_ip only available with on-demand (non-spot) instancess@placement_group parameter requires Boto version 2.3.0 or higher.sNinstance_initiated_shutdown_behavior=stop is not supported for spot instances.t launch_groupttypetsecondss%Y-%m-%dT%H:%M:%S.000Zt valid_untils"Instance creation failed => %s: %ssInvalidInstanceID.NotFoundiis(wait for instances running timeout on %stsourceDestChecktdisableApiTerminations!Instance tagging failed => %s: %sN((:RRR=tbooleanRR@R9R:tget_all_security_groupsR*R tsett differenceRtjoinR;RWR6Rnt exceptiontNoAuthHandlerFoundRARR RfRqR RxRsR"RoRptNetworkInterfaceCollectiont enumerateRRR8R+RtRt error_codeRRtdatetimetutcnowt timedeltatstrftimeRRtBotoServerErrort error_messageRRRtextendtmodify_attributet create_tagsRl(CR!R"R#RRMR6t group_nameRRRSR`RRRRRRPRQRRRRRRR0RRERuRR[RR$RRRRRR:t grp_detailst unmatchedRtgrp_itemtetrunning_instancestcount_remainingt filter_dicttprevious_reservationsR&t prev_instanceRRt interfacet interfacestiRRjRtinstidstinstancetterminated_instancestutc_valid_untilt num_runningtres_listR'Rtcreated_instance_idstd((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyRs     : #                                "!      4              $'  9     '   c Cs|jjd}t|jjd}t}g}t|t sXt|dkrk|jddng}x|j|D]}x|j D]} | j dks| j dkr|j | j |j t | y|j| j gWn2tk r#} |jddj| j | nXt}qqWqW|rd } tj|}x|tjkr| t|kr|jd |d id d 6} y,tg| D]}t|j ^q} Wn#tk r} tjdqTnX| t|krTtjdqTqTW|tjkrP| t|krP|jddtjng}xQ|jd |d id d 6D]-}x$|j D]} |j t | qWqvWn|||fS(s Terminates a list of instances module: Ansible module object ec2: authenticated ec2 connection object termination_list: a list of instances to terminate in the form of [ {id: }, ..] Returns a dictionary of instance information about the instances terminated. If the instance to be terminated is running "changed" will be set to False. RRiR5s4instance_ids should be a list of instances, abortingRRs,Unable to terminate instance {0}, error: {1}it instance_idsR7Rsinstance-state-nameis+wait for instance termination timeout on %s(RRR=RfR*R>RR@RARRR R6RlRRtformatRqRtsumR<RR( R!R"R RRRRtterminated_instance_idsR&R'Rtnum_terminatedtresponse((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyRsJ"#', $&cCs|jjd}t|jjd}|jjd}|jjd}t} g} t|t s|t|dkr|s|jddqni} |rx+|jD]\} } | | d| }, ..] instance_tags: A dict of tag keys and values in the form of {key: value, ... } state: Intended state ("running" or "stopped") Returns a dictionary of instance information about the instances started/stopped. If the instance was not able to change state, "changed" will be set to False. Note that if instance_ids and instance_tags are both non-empty, this method will process the intersection of the two RRRRXiR5s4instance_ids should be a list of instances, abortingstag:R6s client-tokenR7R:css|]}t|jVqdS(N(RRW(R2R((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pys ss+The following group names are not valid: %ss, Rcss|]}|jVqdS(N(R6(R2tsg((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pys stgroupSetRs3Unable to change state for instance {0}, error: {1}is(wait for instances running timeout on %s(#RRR=RfR*R>RR@R?RARRtcheck_source_dest_attrtcheck_termination_protectionR:RR RRRRWR6RYRRR RltstartRRR RqRRR(R!R"R RRRRRRRRR7tkeytvaluetexisting_instances_arrayR&R'RRRRRRtmatched_instancesR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytstartstop_instancesTs~"    : %  # c Cst}g}t|t s.t|dkrJ|sJ|jddqJni}|rx+|jD]\}} | |d|}, ..] instance_tags: A dict of tag keys and values in the form of {key: value, ... } state: Intended state ("restarted") Returns a dictionary of instance information about the instances. If the instance was not able to change state, "changed" will be set to False. Wait will not apply here as this is a OS level operation. Note that if instance_ids and instance_tags are both non-empty, this method will process the intersection of the two. iR5s4instance_ids should be a list of instances, abortingstag:R6s client-tokenR7s3Unable to change state for instance {0}, error: {1}(RfR*R>RR@R?RRRARRRRRR RltrebootRR R6Rq( R!R"R RRRRR7RRR&R'R((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytrestart_instancess0" #cCsO|jjd}|jdd|krK|dk rK|jd|tSdS(s Check the instance disableApiTermination attribute. module: Ansible module object inst: EC2 instance object returns: True if state changed None otherwise RRN(RRt get_attributeRRRq(R!R'R((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyRs %cCs|jjd}|dk ry@|jdk r]|jdd|kr]|jd|tSWqtjj k r}|j dkrxh|j D]/}|j |kr|j |jd|tSqWq|jddj|j|dtjqXndS(s Check the instance sourceDestCheck attribute. module: Ansible module object inst: EC2 instance object returns: True if state changed None otherwise RRtInvalidInstanceIDR5sEFailed to handle source_dest_check state for instance {0}, error: {1}RN(RRRR:RRRqRnRRRRRt"modify_network_interface_attributeR6R@R t tracebackt format_exc(R!R'R"RtexcR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyRs  ( cCsf|jjd}t|dd}|s0|rb| sC|tkrb|jdj||jndS(NRRIsUnable to modify public ip assignment to {0} for instance {1}. Whether or not to assign a public IP is determined during instance creation.(RRRdRRftwarnR R6(R!RRRI((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyR3s  cLCs?t}|jtdtddgdtdtddddgd tddd tdd d gd tddgdtdtdddddgdtdtdtdtdddddtdddtdtdtdddtdtddddd tdddd!d"td#td$tdd%d&td'tddd(td)td*tdddd+gd,tddddd-tddddd.tdd/dd/d0d1d2d3gd4tdd5dd5d6gd7tddddd8tdd9d:tddd;tdddtd<tddddd=gd>tdddd?g#td@|dAdBd gd7dgd7d.gd7d*gd>d'gd>dgd>d gd>d(gd>d&gg }ts|jdCdDnyt|\}}}|j j dEs6|j j dF rEt |}n$|j j dFrit ||}ndE|kr|j |dERYRRtaws_zonetec2_zoneRSRRRasone-timetchoicest persistentRRRPRR=t1RtboolRQRRi,RiXRRRR+R0RRERuR RRRRtpresenttabsentRt restartedRRRRRR$trawRR[R`t dedicatedRRrt argument_spectmutually_exclusiveRR5sboto required for this moduleROtec2_urlsFailed to get connection: %sRs.instance_ids list is required for absent statesFrunning list needs to be a list of instances or set of tags to run: %ss,image parameter is required for new instanceRcSs|dS(NR6((RB((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytscSs|dS(NR6((RB((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pyR3sRRttagged_instances(srunningsstopped(R R8R+RfRRtHAS_BOTOR@RRRR RRORRnRRRRR RR*R>RRRRtsortt exit_json(R0R!ROR2taws_connect_kwargsR"R#RR4RR RRtnew_instance_idsR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytmain>s            $        % '    $ $ ! t__main__(8tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLESRRRtastRtdistutils.versionRtansible.module_utils.basicRtansible.module_utils.ec2RR R tansible.module_utils.sixR R tansible.module_utils._textR Rtboto.ec2Rntboto.ec2.blockdevicemappingRRtboto.exceptionRRRRqR5t ImportErrorRfRR(R,RRlRsRxRzRRRRRRRRRRRR:t__name__(((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.pytsZ   A         ? <  & 9 : W E n A   z