??????????????
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@`sddlmZmZmZeZidd6dgd6dd6ZdZd Zd Z dd l Z dd l Z y(dd l Z dd lZ dd lZ Wnek rnXdd lmZdd lmZmZmZmZmZdZdZdZdZdZdZdZdZ dZ!d d dZ#d d d d dZ$d d d dZ%d d d d d dZ&dZ'dZ(dZ)e*dkre)nd S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust communityt supported_bys --- module: iam short_description: Manage IAM users, groups, roles and keys description: - Allows for the management of IAM users, user API keys, groups, roles. version_added: "2.0" options: iam_type: description: - Type of IAM resource choices: ["user", "group", "role"] type: str name: description: - Name of IAM resource to create or identify required: true type: str new_name: description: - When state is update, will replace name with new_name on IAM resource type: str new_path: description: - When state is update, will replace the path with new_path on the IAM resource type: str state: description: - Whether to create, delete or update the IAM resource. Note, roles cannot be updated. required: true choices: [ "present", "absent", "update" ] type: str path: description: - When creating or updating, specify the desired path of the resource. If state is present, it will replace the current path to match what is passed in when they do not match. default: "/" type: str trust_policy: description: - The inline (JSON or YAML) trust policy document that grants an entity permission to assume the role. Mutually exclusive with C(trust_policy_filepath). version_added: "2.2" type: dict trust_policy_filepath: description: - The path to the trust policy document that grants an entity permission to assume the role. Mutually exclusive with C(trust_policy). version_added: "2.2" type: str access_key_state: description: - When type is user, it creates, removes, deactivates or activates a user's access key(s). Note that actions apply only to keys specified. choices: [ "create", "remove", "active", "inactive", "Create", "Remove", "Active", "Inactive"] type: str key_count: description: - When access_key_state is create it will ensure this quantity of keys are present. Defaults to 1. default: 1 type: int access_key_ids: description: - A list of the keys that you want impacted by the access_key_state parameter. type: list groups: description: - A list of groups the user should belong to. When update, will gracefully remove groups not listed. type: list password: description: - When type is user and state is present, define the users login password. Also works with update. Note that always returns changed. type: str update_password: default: always choices: ['always', 'on_create'] description: - C(always) will update passwords if they differ. C(on_create) will only set the password for newly created users. type: str notes: - 'Currently boto does not support the removal of Managed Policies, the module will error out if your user/group/role has managed policies when you try to do state=absent. They will need to be removed manually.' author: - "Jonathan I. Davila (@defionscode)" - "Paul Seiffert (@seiffert)" extends_documentation_fragment: - aws - ec2 s # Basic user creation example tasks: - name: Create two new IAM users with API keys iam: iam_type: user name: "{{ item }}" state: present password: "{{ temp_pass }}" access_key_state: create loop: - jcleese - mpython # Advanced example, create two new groups and add the pre-existing user # jdavila to both groups. task: - name: Create Two Groups, Mario and Luigi iam: iam_type: group name: "{{ item }}" state: present loop: - Mario - Luigi register: new_groups - name: iam: iam_type: user name: jdavila state: update groups: "{{ item.created_group.group_name }}" loop: "{{ new_groups.results }}" # Example of role with custom trust policy for Lambda service - name: Create IAM role with custom trust relationship iam: iam_type: role name: AAALambdaTestRole state: present trust_policy: Version: '2012-10-17' Statement: - Action: sts:AssumeRole Effect: Allow Principal: Service: lambda.amazonaws.com s role_result: description: the IAM.role dict returned by Boto type: str returned: if iam_type=role and state=present sample: { "arn": "arn:aws:iam::A1B2C3D4E5F6:role/my-new-role", "assume_role_policy_document": "...truncated...", "create_date": "2017-09-02T14:32:23Z", "path": "/", "role_id": "AROAA1B2C3D4E5F6G7H8I", "role_name": "my-new-role" } roles: description: a list containing the name of the currently defined roles type: list returned: if iam_type=role and state=present sample: [ "my-new-role", "my-existing-role-1", "my-existing-role-2", "my-existing-role-3", "my-existing-role-...", ] N(t AnsibleModule(tHAS_BOTOtboto_exceptiontconnect_to_awstec2_argument_spectget_aws_connection_infocc`smtd}}xY|sh|d|}xt||D] }|Vq5W|jdk}|s|j}qqWdS(s  paginates the results from func by continuously passing in the returned marker if the results were truncated. this returns an iterator over the items in the returned response. `attr` is the name of the attribute to iterate over in the response. tmarkertfalseN(tFalsetNonetgetattrt is_truncatedR(tfunctattrtfinishedRtrestitem((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyt _paginates   cC`s'gt|jdD]}|d^qS(Ntgroupst group_name(Rtget_all_groups(tiamR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytlist_all_groupsscC`s'gt|jdD]}|d^qS(Ntuserst user_name(Rt get_all_users(RR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytlist_all_usersscC`s'gt|jdD]}|d^qS(Ntrolest role_name(Rt list_roles(RR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytlist_all_rolesscC`s'gt|jdD]}|d^qS(Ntinstance_profilestinstance_profile_name(Rtlist_instance_profiles(RR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytlist_all_instance_profilessc C`sd}g}y|j||jjj} t} |dk rQ|j||}n|d kr|rx?||kr|j|jd|j j j |d7}qfWqnd}Wn5t j jk r} |jdtdt| n&Xtd| d|d |} | | fSdS( NitcreateR itchangedtmsgt created_usertpasswordt access_keys(R+(t create_usertcreate_user_responsetcreate_user_resulttusertTrueRtcreate_login_profiletappendtcreate_access_keytcreate_access_key_responsetcreate_access_key_resultt access_keytbotot exceptiontBotoServerErrort fail_jsonRtstrtdict( tmoduleRtnametpwdtpatht key_statet key_counttkey_qtytkeyst user_metaR,terrt user_info((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyR1s&    c C`st}yWg|j|jjD]}|d^q}x|D]}|j||q<Wt}Wn?tjjk r}|j d|dd|dt j nXy)|j |j }|j|t}Wnbtjjk r,}t|} d|d| kr-|j d|dd|dt j q-nXy:x-|j|jjD]} |j|| qFWt}Wnttjjk r}t|} d | kr|j d|dd |n|j d|dd |dt j nXyb|j|jd ijd ijdg} x"| D]} |j|| dqWt}Wn?tjjk r}|j d|dd|dt j nX|S(Nt access_key_idR,R-sFailed to delete keys: %sR=sLogin Profile for User s cannot be found.s"Failed to delete login profile: %ssmust detach all policies firstsAll inline policies have been removed. Though it appearsthat %s has Managed Polices. This is not currently supported by boto. Please detach the policies through the console and try again.sFailed to delete policies: %stlist_mfa_devices_responsetlist_mfa_devices_resultt mfa_devicest serial_numbers/Failed to deactivate associated MFA devices: %s(Rtget_all_access_keystlist_access_keys_resulttaccess_key_metadatatdelete_access_keyR5R<R=R>R?t tracebackt format_exctget_login_profilestget_login_profile_responsetdelete_login_profileR tget_all_user_policiestlist_user_policies_resultt policy_namestdelete_user_policytget_all_mfa_devicestgettdeactivate_mfa_device( RBRRCR,tckt current_keystkeyRKt login_profilet error_msgtpolicyRPtdevice((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytdelete_dependencies_firstsF)  *   -    *3  *cC`s{t|||}y|j|WnEtjjk rj}|jd|dd||fdtjnXt}||fS(NR,R-sFailed to delete user %s: %sR=( Rit delete_userR<R=R>R?RVRWR5(RBRRCR,tex((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyRj,s0c C`st} t} | r!|r!|}nyhg|j|jjD]} | d^q:} g|j|jjD]} | d^qf}t| }Wntjjk r?}t|}d|kr | r g|j|jjD]} | d^q} g|j|jjD]} | d^q}|}q@|j dtdt |nXi}|sR|rP|j |j j d}||ks||krPt} yn| s|j|d|d|jj}n|j|d|jj}td |d |d |d||d R R?R@tget_usertget_user_resultR4R5t update_usertupdate_user_responsetresponse_metadataRAtupdate_login_profileR6R7R8R9R:R;tziptlowertupdate_access_keyt capitalizeRUtupdate(RBRRCtnew_nameRmRFRGRIRDtupdatedR,t name_changeRbRcRRHRKRftupdated_key_listtc_pathR4tnew_keysR;t current_keytcurrent_key_statet final_keystfinal_key_statustfktfks((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyRx7s  )) ))   #     )) ))    #     *    &1 cC`st}|r|}nyg|j|jjD]}|d^q.}gt|j|D] } | ^qZ} gt|j|D] } | ^q} Wn5tjjk r} |j d|dt | nXt |dkr$x| D]}|j ||qWx| D]}|j ||qWnzxw|D]o}y|j ||Wq+tjjk r} t| }d||kr|j dtdd|qq+Xq+Wt | dkst | dkrt}n||fS(s Sets groups for a user, will purge groups not explicitly passed, while retaining pre-existing groups that also are in the new list. RR,R-is'The group with name %s cannot be found.sGroup %s doesn't exist(Rtget_groups_for_usertlist_groups_for_user_resultRt frozensett differenceR<R=R>R?R@Rutadd_user_to_grouptremove_user_from_groupR R5(RBRRCRRRR,togtorig_users_groupstrgt remove_groupstngt new_groupsRKtnewtrmtgroupRf((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytset_users_groupss2  #(,     %$ cC`skt}y|j||jjjWn5tjjk rZ}|jd|dt |nXt }||fS(NR,R-( Rt create_grouptcreate_group_responsetcreate_group_resultRR<R=R>R?R@R5(RBRRCRER,RK((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyRs cC`s.t}y|j|Wntjjk r}t|}d|krx-|j|jjD]}|j ||q]Wy|j|Wnjtjjk r}t|}d|kr|j d|dd|q|j d|dt |qXt }q$|j d|dt |nXt }||fS(Nsmust delete policies firstR,R-sAll inline policies have been removed. Though it appearsthat %s has Managed Polices. This is not currently supported by boto. Please detach the policies through the console and try again.( Rt delete_groupR<R=R>R tget_all_group_policiestlist_group_policies_resultR]tdelete_group_policyR?R@R5(RBRRCR,RKRfRg((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyRs(        cC`st}y|j|jjjd}|rV||krV|j|d|t}qVn|r||kr|j|d|d|t}|}qnWn5tjj k r}|j d|dt |nX||||fS(NRERmtnew_group_nameR,R-( Rt get_grouptget_group_responsetget_group_resultRt update_groupR5R<R=R>R?R@(RBRRCRRmR,tcurrent_group_pathRK((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyRs     c C`st}d}d} y||krt}|j|d|d|jjj}||kr|j|d|jj j } |j ||qn|j |j jj } Wn5tjjk r} |jd|dt| n%Xt|} |j|jjj}|| || fS(Ntassume_role_policy_documentRER,R-(RRR5t create_roletcreate_role_responsetcreate_role_resulttroletcreate_instance_profilet create_instance_profile_responsetcreate_instance_profile_resulttinstance_profiletadd_role_to_instance_profiletget_instance_profiletget_instance_profile_responsetget_instance_profile_resultR<R=R>R?R@R&tget_roletget_role_responsetget_role_result( RBRRCREt role_listt prof_listttrust_policy_docR,tiam_role_resulttinstance_profile_resultRKtupdated_role_list((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyR"s$     cC`st}d}d}y||krug|j|jjD]}|d^q7} x| D]} |j| |qTWy|j|Wntjj k rk} t | } d| krx0|j |j j D]} |j|| qWny|j|}Wnjtjj k ra} t | } d| krB|jd|dd|qh|jd|dt| qrXt}quXt}nx,|D]$}||kr||j|}q|q|WWn5tjj k r} |jd|dt| n Xt|}||||fS(NR(smust detach all policies firstR,R-sAll inline policies have been removed. Though it appearsthat %s has Managed Polices. This is not currently supported by boto. Please detach the policies through the console and try again.(RRtlist_instance_profiles_for_rolet&list_instance_profiles_for_role_resultR't!remove_role_from_instance_profilet delete_roleR<R=R>R tlist_role_policiestlist_role_policies_resultR]tdelete_role_policyR?R@R5tdelete_instance_profileR&(RBRRCRRR,RRtrpt cur_ins_proftprofileRKRfRgtprofR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pyR;sB )             c:$C`s t}|jtdtdtddddgdtdd d ddtd tdtdd d dgdtd ddtdtdtd ddtdddgdtd ddtdddddddddgdtdd d ddtdtddd d dtd!td ddtd"td ddtd#tdd$d ddtd%td ddtd&td d'dtd(td ddttd)|d*d#d"gg}ts|jd+d,n|j j d j }|j j dj }|j j d}|j j d!}|j j d%}|j j d}|j j d}|j j d&} |j j d(} |j j d} |j j d} |j j d#} |j j d"}|j j d}| r8| j } t gddgD]}|| k^qr8| r8|jd-td+d.q8n|dkrq|j j ddk rq|j j d}n=|dkr|j j ddk r|jd+d/nd}|dkr|j j ddk s|j j d0dk r|jd+d1n|dkr.|dkr.|jd-td+d2n|ry4t |d3}tjtj|}WdQXWqtk r}|jd+t|d4|qXnV| rytj| }Wqtk r}|jd+t|d4| qXnd}t|\}}}y7|r+ttj||}ntjjj|}Wn/tjjk rr}|jd+t|nXi}t}y4t|}t|}t|}t|}Wn,tjjk r}|jd+|j nX|dkr t} d}!t g|D]}|||gk^q}"|"ri|j!|j"j#d&}#| ri|#| kri| } |#} qin|d kr |" r | r t$||||| | | \}$}|j%|j&j'}%|rt(||||| |\}!}n|j)d5|$d|!d6|%d-|q |dQkr |"r |dkr2d}n||krS||krSt} nt*||||| | | ||| \}&}'}(})|)rit+|)d76}*|*d7j,g|'j-D]C\}+},|+g|)D]}-|-d0^qkri|+d06|,d86^qn:ig|'j-D] \}+},i|+d06|,d86^qd76}*|&rX|rX|}.|}nt.|t+rt(||||| |\}!}/|/|(kr|/}qt}n|(}|r| r|j)d-|d|!d9|.d:|d;| d(| d6|'d<|)d5|* q |rF | rF | rF |j)d-|d|!d9|.d:|d6|'d<|)d5|*q |r | r | r |j)d-|d|!d=|d6|'d>| d<|)d5|*q | r | r |j)d-|d|!d=|d;| d(| d6|'d<|)d5|*q |j)d-|d|!d=|d6|'d<|)d5|*q |dkr5 |" r5 |jd+d?|q |d kr |"r yEt(|||d@t/|||\}}|j)dA|d-|Wq tk r }0|jd-|d+t|0q Xq |j)d-td+dB|q n|dkr ||k}1|d krL |1 rL t0dC|dD|d!|d&| \}2}|j)d-|dE|2q |dRkr\ |1r\ t1dC|dD|d!|d%|d(| \}}3}4}5| r |r |j)d-|dF|dG|3d;|5dH|4n| r | r |j)d-|dE|d;|5dH|4n| r, |r, |j)d-|dF|dG|3dI|5n| r | r |j)d-|dE|dI|5q q |dkr |1 r |jd-|d+dJ|q |d kr ||kr t2dC|dD|d!|\}6}|j)d-|dK|6q |j)d-|d+dLq n|dkr g}7|d krE t3|||| |||\}}7}8}9nX|d krx t4|||||\}}7}8}9n%|dkr |jd-td+dMn|j)d-|dN|7dO|8dP|9ndS(SNtiam_typetrequiredtchoicesR4RRRttypetlisttdefaulttstatetpresenttabsentRR/tno_logtupdate_passwordtalwayst on_createtaccess_key_stateRrRsR+RttActivetInactivetCreatetRemovetaccess_key_idsRGtintiRCttrust_policy_filepatht trust_policyRARREt/Rmt argument_spectmutually_exclusiveR-s,This module requires boto, please install itR,sPAt least one access key has to be defined in order to use 'active' or 'inactive'sMa password is being specified when the iam_type is not user. Check parametersRMsTthe IAM type must be user, when IAM access keys are being modified. Check parameterssMiam_type: role, cannot currently be updated, please specify present or absenttrs: RJRIR0Rt old_user_nameRlRpt created_keysR RFs+The user %s does not exist. No update made.tt deleted_users1User %s is already absent from your AWS IAM usersRBRRtold_group_nameRtnew_group_patht group_paths.Update Failed. Group %s doesn't seem to exist!RsGroup already absents,Role update not currently supported by boto.R#t role_resultR(Rsupdate(Rsupdate(5R RRAR5RRRR R?tparamsR`R}tanytopentjsontdumpstloadt ExceptionR@R R R<Rt connectiont IAMConnectionR=tNoAuthHandlerFoundRR"R&R*R>tmessageRvRwR4R1RRRSRTRt exit_jsonRxRtextendtitemst isinstanceRjRRRRR(:RRBRRRRCRR/t update_pwRERmRGRFRRtkey_idstnRDt json_dataRtetregiontec2_urltaws_connect_kwargsRtresultR,torig_group_listtorig_user_listtorig_role_listtorig_prof_listRKt been_updatedt user_groupst user_existst current_pathtmetaRIRtkey_listt user_changedtnew_keyRJRdtvaluetitt orig_nametgroups_changedRkt group_existst new_groupt updated_namet updated_pathtcur_patht removed_groupRRR((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytmainis  !  2$$$"%%    + !!    0 A7              #   '          !  * $  t__main__(+t __future__RRRRt __metaclass__tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLEStRETURNRRVtboto.exceptionR<tboto.iamtboto.iam.connectiont ImportErrortansible.module_utils.basicRtansible.module_utils.ec2R R R R R RRR"R&R*R1RiRjRxRRRRRRRRt__name__(((sD/usr/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam.pytsH   X3     (       0  '   .