Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_credential.pyo

�
�Udac@`s[ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	ddl
mZddlm
Z
mZmZy/dd
lZdd
ljZdd
lmZWnek
r�nXidd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6Zd*�Zd+�Zed,krWe�nd
S(-i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: tower_credential
author: "Wayne Witzel III (@wwitzel3)"
version_added: "2.3"
short_description: create, update, or destroy Ansible Tower credential.
description:
    - Create, update, or destroy Ansible Tower credentials. See
      U(https://www.ansible.com/tower) for an overview.
options:
    name:
      description:
        - The name to use for the credential.
      required: True
      type: str
    description:
      description:
        - The description to use for the credential.
      type: str
    user:
      description:
        - User that should own this credential.
      type: str
    team:
      description:
        - Team that should own this credential.
      type: str
    project:
      description:
        - Project that should for this credential.
      type: str
    organization:
      description:
        - Organization that should own the credential.
      required: True
      type: str
    kind:
      description:
        - Type of credential being added.
        - The ssh choice refers to a Tower Machine credential.
      required: True
      type: str
      choices: ["ssh", "vault", "net", "scm", "aws", "vmware", "satellite6", "cloudforms", "gce", "azure_rm", "openstack", "rhv", "insights", "tower"]
    host:
      description:
        - Host for this credential.
      type: str
    username:
      description:
        - Username for this credential. ``access_key`` for AWS.
      type: str
    password:
      description:
        - Password for this credential. ``secret_key`` for AWS. ``api_key`` for RAX.
        - Use "ASK" and launch in Tower to be prompted.
      type: str
    ssh_key_data:
      description:
        - SSH private key content. To extract the content from a file path, use the lookup function (see examples).
      required: False
      type: str
    ssh_key_unlock:
      description:
        - Unlock password for ssh_key.
        - Use "ASK" and launch in Tower to be prompted.
      type: str
    authorize:
      description:
        - Should use authorize for net type.
      type: bool
      default: 'no'
    authorize_password:
      description:
        - Password for net credentials that require authorize.
      type: str
    client:
      description:
        - Client or application ID for azure_rm type.
      type: str
    security_token:
      description:
        - STS token for aws type.
      version_added: "2.6"
      type: str
    secret:
      description:
        - Secret token for azure_rm type.
      type: str
    subscription:
      description:
        - Subscription ID for azure_rm type.
      type: str
    tenant:
      description:
        - Tenant ID for azure_rm type.
      type: str
    domain:
      description:
        - Domain for openstack type.
      type: str
    become_method:
      description:
        - Become method to use for privilege escalation.
      choices: ["None", "sudo", "su", "pbrun", "pfexec", "pmrun"]
      type: str
    become_username:
      description:
        - Become username.
        - Use "ASK" and launch in Tower to be prompted.
      type: str
    become_password:
      description:
        - Become password.
        - Use "ASK" and launch in Tower to be prompted.
      type: str
    vault_password:
      description:
        - Vault password.
        - Use "ASK" and launch in Tower to be prompted.
      type: str
    vault_id:
      description:
        - Vault identifier.
        - This parameter is only valid if C(kind) is specified as C(vault).
      type: str
      version_added: "2.8"
    state:
      description:
        - Desired state of the resource.
      choices: ["present", "absent"]
      default: "present"
      type: str
extends_documentation_fragment: tower
s�
- name: Add tower credential
  tower_credential:
    name: Team Name
    description: Team Description
    organization: test-org
    kind: ssh
    state: present
    tower_config_file: "~/tower_cli.cfg"

- name: Create a valid SCM credential from a private_key file
  tower_credential:
    name: SCM Credential
    organization: Default
    state: present
    kind: scm
    username: joe
    password: secret
    ssh_key_data: "{{ lookup('file', '/tmp/id_rsa') }}"
    ssh_key_unlock: "passphrase"

- name: Fetch private key
  slurp:
    src: '$HOME/.ssh/aws-private.pem'
  register: aws_ssh_key
- name: Add Credential Into Tower
  tower_credential:
    name: Workshop Credential
    ssh_key_data: "{{ aws_ssh_key['content'] | b64decode }}"
    kind: ssh
    organization: Default
    tower_username: admin
    tower_password: ansible
    tower_host: https://localhost
  run_once: true
  delegate_to: localhost
N(tto_text(tTowerModulettower_auth_configttower_check_mode(tsettingstMachinetsshs
Ansible VaulttvaulttNetworktnetsSource ControltscmsAmazon Web ServicestawssVMware vCentertvmwaresRed Hat Satellite 6t
satellite6sRed Hat CloudFormst
cloudformssGoogle Compute Enginetgces Microsoft Azure Resource Managertazure_rmt	OpenStackt	openstacksRed Hat VirtualizationtrhvtInsightstinsightss
Ansible TowerttowercC`s�tjd�}|jd�}itd6}|dkr`|jd�rSd|d<q�d|d<nH|dkry||d<n/|tkr�|jtdd
dt|��n|j|�S(
Ntcredential_typetkindtmanaged_by_towerRtvault_passwordRRRRtcloudtname(RRRR(t	tower_clitget_resourcetpoptTruetgettKIND_CHOICEStupdatetdict(tparamstmoduletcredential_type_resR t	arguments((se/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_credential.pytcredential_type_for_v1_kind�s



c7C`s�tdtdt�dt�dt�dtdtdtj��dt�dt�d	td
t�dtd
tdd
�dtd
t�dtdddt�dtd
t�dt�dtd
t�dtd
t�dt�dt�dt�dt�dt�dtd
t�dtd
t�dt�dtdt�dt�d tdd!d"gdd!�d#t��}td$|d%t�}|jjd�}|jjd�}|jjd �}i|d&6|d 6}t|�}t	j
|���t|�tj
d&�}y-i}t|d'<||d<|rNtj
d�}	|	jd|�}
|
d(|d<nytj
d)�Wn(ttfk
r�|jd|d<n!Xt|j|�}|d(|d)<|jjd�r�|jjd�|d<n|jjd�r%tj
d�}|jd|jjd��}
|
d(|d<n|jjd�rutj
d�}|jd|jjd��}|d(|d<n|jjd�r.|jjd�}tjj|�r|jd*d+d,d-�tjj|�r�|jd*d.|�nt|d/�� }t|j��|jd<WdQXq.||jd<n|jjd#d�rn|jjd�d0krn|jd*d1�nxjd6D]b}d|kr�|jj|�||<qu|jj|�ru|jj|�|jd2i�|<ququW|d!kr|j|�}|d(|d(<n|d"kr%|j|�}nWn~tjk
r]}|jd*d3j |�d4t�nJtj!tj"tjtj#fk
r�}|jd*d5j |�d4t�nXWdQX|d4|d4<|j$|�dS(7NR$trequiredtusertteamR tchoicesthosttusernametpasswordtno_logtssh_key_datattypetstrtssh_key_unlockt	authorizetbooltdefaulttauthorize_passwordtclienttsecurity_tokentsecretttenanttsubscriptiontdomaint
become_methodtbecome_usernametbecome_passwordR"tdescriptiontorganizationtprojecttstatetpresenttabsenttvault_idt
argument_spectsupports_check_modet
credentialtcreate_on_missingtidRtmsgs6ssh_key_data should be a string, not a path to a file.tversions2.12s+attempted to read contents of directory: %strbRsNParameter 'vault_id' is only valid if parameter 'kind' is specified as 'vault'tinputss8Failed to update credential, organization not found: {0}tchangeds Failed to update credential: {0}(R>RARBRCRDRERFRGRHRIRJR"RMR6R7R8R:RQR=(%R,R(R*tkeystFalseR	R-R)R
Rtruntime_valuesRR%R&tImportErrortAttributeErrorR1tostpathtexistst	deprecatetisdirt	fail_jsontopenRtreadtNonet
setdefaulttmodifytdeletetexctNotFoundtformattConnectionErrort
BadRequestt	AuthErrort	exit_json(RRR.R$RLRNtjson_outputt
tower_authRTR-torg_restorgRtuser_resR3tteam_resR4tdatatftkeytresulttexcinfo((se/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_credential.pytmain�s�												


	"-
)"')t__main__(t
__future__RRRR;t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESRatansible.module_utils._textRt"ansible.module_utils.ansible_towerR	R
RR%ttower_cli.exceptionst
exceptionsRmttower_cli.confRR_R*R1Rt__name__(((se/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_credential.pyt<module>sD


�'

		x

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]