community.general.lxd_project module – Manage LXD projects
Note
This module is part of the community.general collection (version 10.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.lxd_project
.
New in community.general 4.8.0
Synopsis
Management of LXD projects.
Parameters
Parameter |
Comments |
---|---|
The client certificate file path. If not specified, it defaults to |
|
The client certificate key file path. If not specified, it defaults to |
|
The config for the project (for example If the project already exists and its “config” value in metadata obtained from |
|
Description of the project. |
|
Merge the configuration of the present project with the new desired configuration, instead of replacing it. If configuration is the same after merged, no change will be made. Choices:
|
|
Name of the project. |
|
A new name of a project. If this parameter is specified a project will be renamed to this name. See https://documentation.ubuntu.com/lxd/en/latest/api/#/projects/project_post. |
|
The Unix domain socket path when LXD is installed by snap package manager. Default: |
|
Define the state of a project. Choices:
|
|
The client trusted password. You need to set this password on the LXD server before running this module using the following command: If |
|
The Unix domain socket path or the https URL for the LXD server. Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: none |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
Projects must have a unique name. If you attempt to create a project with a name that already existed in the users namespace the module will simply return as “unchanged”.
Examples
# An example for creating a project
- hosts: localhost
connection: local
tasks:
- name: Create a project
community.general.lxd_project:
name: ansible-test-project
state: present
config: {}
description: my new project
# An example for renaming a project
- hosts: localhost
connection: local
tasks:
- name: Rename ansible-test-project to ansible-test-project-new-name
community.general.lxd_project:
name: ansible-test-project
new_name: ansible-test-project-new-name
state: present
config: {}
description: my new project
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
List of actions performed for the project. Returned: success Sample: |
|
The logs of requests and responses. Returned: when ansible-playbook is invoked with -vvvv. |
|
HTTP request sent to LXD server. Returned: success |
|
JSON body of HTTP request. Returned: success Sample: |
|
Method of HTTP request. Returned: success Sample: |
|
Timeout of HTTP request, Returned: success |
|
URL path of HTTP request. Returned: success Sample: |
|
HTTP response received from LXD server. Returned: success |
|
JSON of HTTP response. Returned: success Sample: |
|
Type of actions performed, currently only Returned: success Sample: |
|
The old state of the project. Returned: success Sample: |