community.general.lxd_project module – Manage LXD projects
Note
This module is part of the community.general collection (version 4.8.3).
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 version 4.8.0: of community.general
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://linuxcontainers.org/lxd/docs/master/api/#/projects/project_post. |
|
The Unix domain socket path when LXD is installed by snap package manager. Default: “unix:/var/snap/lxd/common/lxd/unix.socket” |
|
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 trust_password is set, this module send a request for authentication before sending any requests. |
|
The Unix domain socket path or the https URL for the LXD server. Default: “unix:/var/lib/lxd/unix.socket” |
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: [“create”] |
|
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: “(too long to be placed here)” |
|
Method of HTTP request. Returned: success Sample: “GET” |
|
Timeout of HTTP request, Returned: success |
|
URL path of HTTP request. Returned: success Sample: “/1.0/projects/test-project” |
|
HTTP response received from LXD server. Returned: success |
|
JSON of HTTP response. Returned: success Sample: “(too long to be placed here)” |
|
Type of actions performed, currently only Returned: success Sample: “sent request” |
|
The old state of the project. Returned: success Sample: “absent” |
Authors
Raymond Chang (@we10710aa)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication