Welcome to mist.ansible’s documentation!¶
Version: | 0.1.7 |
---|---|
Author: | Mist.io Inc |
Source: | https://github.com/mistio/mist.ansible |
License: | GPL v3 |
Contents:
Installation¶
Mist.ansible consists of custom modules for mist.io services. In order to use then you have to have andsible and mist.client packages installed.
Install using pip¶
This is the easiest way to obtain the mist ansible modules. What the package does is find where ansible is installed and patch the mist modules into the share folder of the package ansible:
pip install mist.ansible
Clone from Github¶
You can manually patch the mist modules into your installation of ansible. You have to find where the ansible share folder is and patch the modules:
git clone https://github.com/mistio/mist.ansible
cd mist.ansible
cp -r mist.modules /bin/ansible/share/
mist_providers - Lists all available providers supported by the mist.io service¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Returns a list of all available providers that you can add and control through mist.io service mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here | |
provider | no | all |
|
By default all, which returns all supported providers by the mist.io service.You can explicitly set it to one of the choices to see only this provider-specific information |
Note
Requires mist.client
Examples¶
- name: List supported providers, simple case
mist_providers:
mist_email: your@email.com
mist_password: yourpassword
provider: all
register: providers
- name: List supported provider having ~/.mist config file present
mist_providers:
provider: all
register: providers
- name: List only ec2 provider options
mist_providers:
mist_email: your@email.com
mist_password: yourpassword
provider: ec2
register: providers
mist_backends - Manage backends in the mist.io service¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Manage multi-cloud backends through mist.io service. You can add/remove multiple backends from multiple providers through mist.io service. Before you can provision, monitor etc machines through mist.io, you have to first add a backend to the mist.io service. Mist.io supports EC2, Rackspace, Openstack, Linode, Google Compute Engine, SoftLayer, Digital Ocean, Nephoscale, Bare metal servers, Docker containers, HP Cloud. mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
api_url | no | APIURL needed by Openstack and HP Cloud | ||
backend | no | Can be either he backend's name or id. To be used when listing info for backends. | ||
backend_key | no | This is either the username, api_key etc, depending on the provider | ||
backend_secret | no | This is either the password, api_secret token etc, depending on the provider. For Linode and DigitalOcean only this one is needed. | ||
compute_endpoint | no | Needed by some OpenStack installations | ||
machine_ip | no | Ip address needed when adding Bare Metal Server | ||
machine_key | no | Id of ssh key needed when adding Bare Metal Server. The key must have been added first to the mist.io service | ||
machine_port | no | Used when adding a Bare Metal Server | ||
machine_user | no | User for Bare Metal Server | ||
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here | |
name | no | The title you want the backend to have | ||
provider | no | Provider id for the backend you want to add to mist.io. You can see all the providers ids using the mist_providers module. | ||
region | no | Necessary only if there is a custom Openstack region | ||
state | no |
|
If provided it will instruct the module to trigger backend actions, otherwise it will only list information | |
tenant_name | no | In case of Openstack backend, it may have to be provided |
Note
Requires mist.client
Examples¶
- name: Add NepshoScale backend
mist_backends:
mist_email: your@email.com
mist_password: yourpassword
name: NephoScale
provider: nephoscale
backend_key: 908dfjokjkma0hgj9809uj
backend_secret: kjhf98y9lkj0909kj90
state: present
- name: List information about DigitalOcean backend
mist_backends:
mist_email: your@email.com
mist_password: yourpassword
backend: DigitalOcean
register: backend
mist_keys - Manage ssh-keys from mist.io service¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
By uploading your SSH keys to mist.io you can access all your machines through mist.io, have a shell prompt from your browser and even let mist.io take care of enabling monitoring to your machines. You also can have mist.io run commands to your machines during provisiong or after an alert is triggered. mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
auto_generate | no | If True it will ask mist.io to randomly generate a key and save it to the added keys | ||
key | no | When adding a new key, you can provide a local key's path to add to mist.io | ||
local_save_path | no | ~/.ssh | If save_locally, the local save path will be used to save the key | |
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installtion of mist.io you can provide the url here | |
name | no | Name of the key to add or list | ||
save_locally | no | If True the auto generated key will be saved locally | ||
state | no |
|
If provided it will instruct the module to tirgger keys actions, otherwise it will only list information |
Note
Requires mist.client
Examples¶
- name: Add local key named my_key to mist.io
mist_keys:
mist_email: your@email.com
mist_password: yourpassword
name: myKey
state: present
key: /home/user/.ssh/my_key
- name: Auto-generate key and save locally
mist_keys:
mist_email: your@email.com
mist_password: yourpassword
name: autoKey
state: present
auto_generate: true
save_locally: true
local_save_path: /path/to/save
- name: Delete key named myKey
mist_keys:
mist_email: your@email.com
mist_password: yourpassword
name: myKey
state: absent
- name: List info for key named myKey
mist_keys:
mist_email: your@email.com
mist_password: yourpassword
name: myKey
register: key
mist_images - Lists all available OS images for a backend¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Returns a list of all available OS images that the given backend supports. mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html.
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
backend | yes | Can be either backend's id or name | ||
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here | |
search | yes | If not provided will return a list with default OS Images for the given backendIf all is provided, will return ALL available OS imagesIf other search term then it will search for specific images |
Note
Requires mist.client
Examples¶
- name: List default images for NephoScale backend
mist_images:
mist_email: your@email.com
mist_password: yourpassword
backend: NephoScale
register: images
- name: Search for gentoo images in backend with id i984JHdkjhKj
mist_images:
mist_email: your@email.com
mist_password: yourpassword
backend: i984JHdkjhKj
search: gentoo
register: images
mist_locations - Lists all available locations/regions for a backend¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Returns a list of all available locations/regions for a given backend mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
backend | yes | Can be either backend's id or name | ||
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here |
Note
Requires mist.client
mist_sizes - Lists all available machine sizes for a backend¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Returns a list of all available machine sizes for a given backend mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
backend | yes | Can be either backend's id or name | ||
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here |
Note
Requires mist.client
mist - Provision, monitor and manage machines with the mist.io service¶
Author: | Mist.io Inc |
---|
Synopsis¶
New in version 1.7.1.
Manage machines in all of your added backends You can add/remove multiple backends from multiple providers through mist.io service. mist_email and mist_password can be skipped if ~/.mist config file is present. See mist.client documentation for config file http://mistclient.readthedocs.org/en/latest/cmd/cmd.html
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
backend | yes | Can be either the backend's id or name | ||
image_extra | no | Needed only when provisioning to Linode Provider | ||
image_id | no | Id of the OS image you want to use to provision your machine | ||
key | no | Name of the SSH-Key you want to associate with the machine. If None, the default SSH Key will be used | ||
location_id | no | Id of the location/region you want to provision your machine to | ||
metric | no | It will be either the metric id for the supported metrics, or the name in case python_file is providedwait_for_stats needs to be true | ||
mist_email | no | Email to login to the mist.io service | ||
mist_password | no | Password to login to the mist.io service | ||
mist_uri | no | https://mist.io | Url of the mist.io service. By default https://mist.io. But if you have a custom installation of mist.io you can provide the url here | |
monitoring | no | If True, it will enable monitor to the machine | ||
name | no | The name you want the machine to have | ||
python_file | no | This is the path of a python file in case you want to add a custom python metric | ||
size_id | no | Id of the machine size you want to use | ||
state | no |
|
If provided it will instruct the module to trigger machine actions, otherwise it will only list information | |
unit | no | The unit of the metric you add. Can be left none | ||
value_type | no | gauge |
|
What type of value has the plugin |
wait | no | If True, the module will wait for the machine's SSH Daemon to be up and running and the SSH Key associated | ||
wait_for_stats | no | When enabling monitoring for the first time, it may take some time for the collectd agent to be installed.If True, it will wait for the monitoring stats to start | ||
wait_time | no | 600 | Time to wait when waiting for machine to be probed or monitor to be up and running |
Note
Requires mist.client
Examples¶
- name: Provision Ubuntu machine to EC2
mist:
mist_email: your@email.com
mist_password: yourpassword
backend: EC2
state: present
name: MyMachine
key: myKey
image_id: ami-bddaa2bc
size_id: m1.small
location_id: 0
- name: Provision SUSE machine on EC2 and enable monitoring
mist:
mist_email: your@email.com
mist_password: yourpassword
backend: EC2
state: present
name: MyMachine
key: myKey
image_id: ami-9178e890
size_id: m1.small
location_id: 0
monitoring: true
wait_for_stats: true
- name: List info for machine with name dbServer
mist:
mist_email: your@email.com
mist_password: yourpassword
backend: EC2
name: dbServer
register: machine
- name: Enable monitoring and add custom plugin.py
mist:
mist_email: your@email.com
mist_password: yourpassword
backend: EC2
name: dbServer
state: present
key: newKey
wait: true
monitoring: true
wait_for_stats: true
metric: MyPlugin
python_file: /home/user/plugin.py