- Docs »
- one_service - Deploy and manage OpenNebula services
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
one_service - Deploy and manage OpenNebula services
- Manage OpenNebula services
Parameter |
Choices/Defaults |
Comments |
api_password
|
|
Password of the user to login into OpenNebula OneFlow API server. If not set then the value of the ONEFLOW_PASSWORD environment variable is used.
|
api_url
|
|
URL of the OpenNebula OneFlow API server.
It is recommended to use HTTPS so that the username/password are not transferred over the network unencrypted.
If not set then the value of the ONEFLOW_URL environment variable is used.
|
api_username
|
|
Name of the user to login into the OpenNebula OneFlow API server. If not set then the value of the ONEFLOW_USERNAME environment variable is used.
|
cardinality
|
|
Number of VMs for the specified role
|
custom_attrs
|
Default:
{}
|
Dictionary of key/value custom attributes which will be used when instantiating a new service.
|
force
bool |
|
Force the new cardinality even if it is outside the limits
|
group_id
|
|
ID of the group which will be set as the group of the service
|
mode
|
|
Set permission mode of a service instance in octet format, e.g. 600 to give owner use and manage and nothing to group and others.
|
owner_id
|
|
ID of the user which will be set as the owner of the service
|
role
|
|
Name of the role whose cardinality should be changed
|
service_id
|
|
ID of a service instance that you would like to manage
|
service_name
|
|
Name of a service instance that you would like to manage
|
state
|
Choices:
present ←
- absent
|
present - instantiate a service from a template specified with template_id /template_name .
absent - terminate an instance of a service specified with service_id /service_name .
|
template_id
|
|
ID of a service template to use to create a new instance of a service
|
template_name
|
|
Name of service template to use to create a new instace of a service
|
unique
bool |
|
Setting unique=yes will make sure that there is only one service instance running with a name set with service_name when
instantiating a service from a template specified with template_id /template_name . Check examples below.
|
wait
bool |
|
Wait for the instance to reach RUNNING state after DEPLOYING or COOLDOWN state after SCALING
|
wait_timeout
|
Default:
300
|
How long before wait gives up, in seconds
|
# Instantiate a new service
- one_service:
template_id: 90
register: result
# Print service properties
- debug:
msg: result
# Instantiate a new service with specified service_name, service group and mode
- one_service:
template_name: 'app1_template'
service_name: 'app1'
group_id: 1
mode: '660'
# Instantiate a new service with template_id and pass custom_attrs dict
- one_service:
template_id: 90
custom_attrs:
public_network_id: 21
private_network_id: 26
# Instiate a new service 'foo' if the service doesn't already exist, otherwise do nothing
- one_service:
template_id: 53
service_name: 'foo'
unique: yes
# Delete a service by ID
- one_service:
service_id: 153
state: absent
# Get service info
- one_service:
service_id: 153
register: service_info
# Change service owner, group and mode
- one_service:
service_name: 'app2'
owner_id: 34
group_id: 113
mode: '600'
# Instantiate service and wait for it to become RUNNING
- one_service:
template_id: 43
service_name: 'foo1'
# Wait service to become RUNNING
- one_service:
service_id: 112
wait: yes
# Change role cardinality
- one_service:
service_id: 153
role: bar
cardinality: 5
# Change role cardinality and wait for it to be applied
- one_service:
service_id: 112
role: foo
cardinality: 7
wait: yes
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
group_id
int
|
success |
service's group id
Sample:
1
|
group_name
string
|
success |
service's group name
Sample:
one-users
|
mode
int
|
success |
service's mode
Sample:
660
|
owner_id
int
|
success |
service's owner id
Sample:
143
|
owner_name
string
|
success |
service's owner name
Sample:
ansible-test
|
roles
list
|
success |
list of dictionaries of roles, each role is described by name, cardinality, state and nodes ids
Sample:
[{"cardinality": 1,"name": "foo","state": "RUNNING","ids": [ 123, 456 ]}, {"cardinality": 2,"name": "bar","state": "RUNNING", "ids": [ 452, 567, 746 ]}]
|
service_id
int
|
success |
service id
Sample:
153
|
service_name
string
|
success |
service name
Sample:
app1
|
state
string
|
success |
state of service instance
Sample:
RUNNING
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.