Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/selectel/ansible-selvpc-modules

[Official] Ansible modules for Selectel Cloud
https://github.com/selectel/ansible-selvpc-modules

ansible official openstack python python-selvpcclient selectel

Last synced: 3 months ago
JSON representation

[Official] Ansible modules for Selectel Cloud

Awesome Lists containing this project

README

        

# ansible-selvpc-modules

[![Build Status](https://travis-ci.org/selectel/ansible-selvpc-modules.svg?branch=master)](https://travis-ci.org/selectel/ansible-selvpc-modules)

Modules implement VPC project management via VPC Resell API. 'python-selvpcclient' is used to work with the API.
Modules cover all methods of 'python-selvpcclient'.

## Overview

- [Installation](#installation)
- [Docs](#included-modules)
- [Issue tracking](https://github.com/selectel/ansible-selvpc-modules/issues)

## Installation:
```sh
$ virtualenv --no-site-packages env
$ source env/bin/activate

(env)$ pip install git+https://github.com/selectel/ansible-selvpc-modules
(env)$ export SEL_URL=https://api.selectel.ru/vpc/resell/ SEL_TOKEN=
```
- Be sure you have **SEL_URL** и **SEL_TOKEN** variables in your environment.
(You can get API token [here](https://my.selectel.ru/profile/apikeys))

**Note that the modules are compatible with ansible >=2.6.18, <2.7.0 only**

## Included modules:
- **selvpc_projects**:
- description:
- create/delete/update projects
- get info about project(s)
- options:
- token:
- description: selectel VPC API token
- state:
- description: indicates desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- new_name:
- description: option for project name update
- note: for operations where 'project_id' is needed you can use 'project_name' instead
- examples:
```yaml
# create project if not exists:
- selvpc_projects:
project_name:
# if exists than get project info
- selvpc_projects:
project_name:
# update project name
- selvpc_projects:
project_name:
new_name:
# delete project
- selvpc_projects:
state: absent
project_name:
```
- **selvpc_quotas**:
- description:
- set/update project quotas
- get info about project(s) quotas
- options:
- token:
- description: selectel VPC API token
- state:
- description: indicates desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- quotas:
- description: dict with project quotas
- note: for operations where 'project_id' is needed you can use 'project_name' instead
- examples:
```yaml
# set quotas on project
- selvpc_quotas:
project_name:
quotas:
compute_cores:
- region: ru-1
zone: ru-1a
value: 10
compute_ram:
- region: ru-1
zone: ru-1a
value: 1024
volume_gigabytes_fast:
- region: ru-1
zone: ru-1a
value: 100
# get quotas info of specified project
- selvpc_quotas:
project_name:
# get quotas info of all domain projects
- selvpc_quotas:
list: True
```
- **selvpc_limits**:
- description:
- get info about domain limits
- options:
- token:
- description: selectel VPC API token
- state:
- description: indicates desired state
- required: true
- default: present
- choices: ['present', 'absent']
- free:
- description: param for getting info about available resources
- default: false
- examples:
```yaml
# get total amount of resources available to be allocated to projects
- selvpc_limits:
state: present
# get amount of resources available to be allocated to projects
- selvpc_limits:
free: True
```
- **selvpc_users**:
- description:
- add/delete/update users
- get info about users
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- username:
- description: name for new user in project
- password:
- description: password for new user in project
- new_username:
- description: option for username update
- password:
- description: option for password update
- user_id:
- description: user ID
- enabled:
- description: user state
- default: true
- note: for operations where 'project_id' is needed you can use 'project_name' instead
- examples:
```yaml
# create user
- selvpc_users:
username:
password:
# delete user
- selvpc_users:
user_id:
state: absent
```
- **selvpc_roles**:
- description:
- add roles to project
- delete roles
- get info about roles
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- roles:
- description: array of roles [{'project_id': , 'user_id': }]
- user_id:
- description: user ID
- examples:
```yaml
# add role to project
- selvpc_roles:
user_id:
project_id:
# delete role
- selvpc_roles:
state: absent
user_id:
project_id:
# add few users at once
- selvpc_roles:
roles:
- project_id:
user_id:
- project_id:
user_id:
```
- **selvpc_subnets**:
- description:
- create/delete subnets
- get info about subnets
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- subnets:
- description: array of subnets [{'region': , 'quantity': , 'type': , 'prefix_length': }]
- subnet_id:
- description: subnet ID
- force:
- description: if 'true' allows to delete "ACTIVE" subnet if it's needed
- default: false
- examples:
```yaml
# describe state with 2 subnets in ru-1 region and 1 in ru-2
- selvpc_subnets:
project_id:
subnets:
- region: ru-1
quantity: 2
type:
prefix_length:
- region: ru-2
quantity: 1
type:
prefix_length:
# delete all subnets
- selvpc_subnets:
project_name:
licenses:
- region: ru-1
quantity: 0
type:
prefix_length:
- region: ru-2
quantity: 0
type:
prefix_length:
force: True
# delete specific subnets
- selvpc_licenses:
state: absent
subnet_id:
# get info about all subnets
- selvpc_subnets:
list: True
# get info about specific subnet
- selvpc_subnets:
subnet_id:
```
- **selvpc_floatingips**:
- description:
- create/delete floating ips
- get info about floating ips
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- floatingip:
- description: specific floating ip "XXX.XXX.XXX.XXX"
- floatingips:
- description: array of floating IPs [{'region': , 'quantity': }]
- floatingip_id:
- description: floating IP ID
- force:
- description: if 'true' allows to delete "ACTIVE" floating ips if it's needed
- default: false
- examples:
```yaml
# describe state with 2 ips in ru-1 region and 1 in ru-2
- selvpc_floatingips:
project_id:
floatingips:
- region: ru-1
quantity: 2
- region: ru-2
quantity: 1
# delete all ips
- selvpc_floatingips:
project_name:
floatingips:
- region: ru-1
quantity: 0
- region: ru-2
quantity: 0
force: True
# delete specific ip
- selvpc_floatingips:
state: absent
floatingip_id:
# delete floating ip by ip
- selvpc_floatingip:
state: absent
floatingip:
# get info about all ips
- selvpc_floatingips:
list: True
# get info about specific ip
- selvpc_floatingips:
floatingip_id:
```
- **selvpc_licenses**:
- description:
- create/delete licenses
- get info about licenses
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: option for getting list of desired objects (if possible)
- default: false
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- licenses:
- description: array of licenses [{'region': , 'quantity': , 'type': }]
- licenses_id:
- description: licenses ID
- force:
- description: if 'true' allows to delete "ACTIVE" licenses if it's needed
- default: false
- examples:
```yaml
# describe state with 2 licenses in ru-1 region and 1 in ru-2
- selvpc_licenses:
project_id:
licenses:
- region: ru-1
quantity: 2
type:
- region: ru-2
quantity: 1
type:
# delete all licenses
- selvpc_licenses:
project_name:
licenses:
- region: ru-1
quantity: 0
type:
- region: ru-2
quantity: 0
type:
force: True
# delete specific licenses
- selvpc_licenses:
state: absent
license_id:
# get info about all licenses
- selvpc_licenses:
list: True
# get info about specific license
- selvpc_licenses:
license_id:
```
- **selvpc_tokens**:
- description:
- add tokens
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- project_name:
- description: selectel VPC project name
- project_id:
- description: selectel VPC project ID
- examples:
```yaml
# Create reseller token for project
- selvpc_tokens:
project_id:
```
- **selvpc_capabilities**:
- description:
- get info about possible values
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- examples:
```yaml
# get info about capabilities
- selvpc_capabilities:
state: present
```
- **selvpc_vrrp**:
- description:
- selvpc module for VRRP management
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: Option for getting list of desired objects (if possible)
- default: false
- project_id:
- description: Selectel VPC project ID
- project_name:
- description: Selectel VPC project name
- vrrp_subnets:
- description: Array of VRRP subnets
- vrrp_subnet_id:
- description: VRRP Subnet ID
- force:
- description: if 'true' allows to delete "ACTIVE" VRRP subnet if it's needed
- default: false
- examples:
```yaml
# Create VRRP subnet
- selvpc_vrrp:
project_id:
vrrp_subnets:
- master_region: ru-1
slave_region: ru-7
quantity: 2
type: ipv4
prefix_length: 29
# Delete specific VRRP subnet
- selvpc_vrrp:
state: absent
vrrp_subnet_id:
# Get info about all VRRP subnets
- selvpc_vrrp:
list: True
# Get info about specific VRRP subnet
- selvpc_vrp:
vrrp_subnet_id:
# Delete all several VRRP subnets
- selvpc_vrrp:
project_id:
vrrp_subnets:
- master_region: ru-1
slave_region: ru-7
quantity: 0
type: ipv4
prefix_length: 29
force: True
```
- **selvpc_keypairs**:
- description:
- selvpc module for keypairs management
- options:
- token:
- description: selectel VPC API token.
- state:
- description: indicate desired state
- required: true
- default: present
- choices: ['present', 'absent']
- list:
- description: Option for getting list of desired objects (if possible)
- default: false
- user_id:
- description: User_ID
- name:
- description: Key name
- keypair:
- description: Keypair object
- examples:
```yaml
# Create keypair
- selvpc_keypairs:
keypair:
name:
public_key:
regions:
- ru-1
- ru-7
user_id:
# Delete keypair
- selvpc_keypairs:
state: absent
user_id:
name:
# Get info about all keypairs
- selvpc_keypairs:
list: True
```
License
-------

Apache 2.0