File tree Expand file tree Collapse file tree 21 files changed +274
-121
lines changed Expand file tree Collapse file tree 21 files changed +274
-121
lines changed Original file line number Diff line number Diff line change 63
63
terraform :
64
64
# - "1.0.*"
65
65
# - "1.1.*"
66
- - " 1.3.*"
66
+ # - "1.3.*"
67
+ - " 1.4.*"
67
68
steps :
68
69
- uses : actions/setup-go@v4
69
70
with :
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ sense and what doesn't.
10
10
11
11
## Items Done
12
12
13
+ - added group and user resources and data sources
13
14
- basic acceptance tests
14
15
- documentation (content, consistency)
15
16
- added image definition data source
Original file line number Diff line number Diff line change @@ -10,7 +10,23 @@ description: |-
10
10
11
11
A data source that retrieves a list of permission group information from the controller.
12
12
13
-
13
+ ## Example Usage
14
+
15
+ ``` terraform
16
+ # Get a list of all groups on the system or a specific group.
17
+ # For a specific group, the length of the list is always one if the
18
+ # group is found, zero otherwise.
19
+ #
20
+ # Group names are enforced to be unique!
21
+
22
+ data "cml2_groups" "students" {
23
+ name = "students"
24
+ }
25
+
26
+ output "student_group_id" {
27
+ value = data.cml2_groups.students.groups[0].id
28
+ }
29
+ ```
14
30
15
31
<!-- schema generated by tfplugindocs -->
16
32
## Schema
Original file line number Diff line number Diff line change @@ -10,7 +10,19 @@ description: |-
10
10
11
11
A data source that retrieves system state information from the controller. If a ` timeout ` is set then this will only return when the system responds.
12
12
13
-
13
+ ## Example Usage
14
+
15
+ ``` terraform
16
+ # ensure the system is ready to talk to by using this data source
17
+ # with a timeout like 5m (5 minutes)
18
+
19
+ data "cml2_system" "wait_for_ready" {
20
+ timeout = "5m"
21
+ }
22
+ output "readiness" {
23
+ value = data.cml2_system.wait_for_ready.version
24
+ }
25
+ ```
14
26
15
27
<!-- schema generated by tfplugindocs -->
16
28
## Schema
Original file line number Diff line number Diff line change @@ -10,7 +10,23 @@ description: |-
10
10
11
11
A data source that retrieves a list of users from the controller.
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ # Get a list of all users on the system or a specific user.
17
+ # For a specific user, the length of the list is always one if the
18
+ # user is found, zero otherwise.
19
+ #
20
+ # User names are enforced to be unique!
21
+
22
+ data "cml2_users" "get_admin" {
23
+ username = "admin"
24
+ }
25
+
26
+ output "admin_id" {
27
+ value = data.cml2_users.get_admin.users[0].id
28
+ }
29
+ ```
14
30
15
31
<!-- schema generated by tfplugindocs -->
16
32
## Schema
@@ -38,7 +54,7 @@ Read-Only:
38
54
- ` is_admin ` (Boolean) True if the user has admin rights.
39
55
- ` labs ` (Set of String) Set of lab IDs the user owns.
40
56
- ` opt_in ` (Boolean) True if has opted in to sending telemetry data.
41
- - ` password ` (String) Password of the user.
57
+ - ` password ` (String, Sensitive ) Password of the user.
42
58
- ` resource_pool ` (String) Resource pool ID, if any.
43
59
- ` username ` (String) Login name of the user.
44
60
Original file line number Diff line number Diff line change @@ -10,7 +10,47 @@ description: |-
10
10
11
11
A resource which handles permission groups.
12
12
13
-
13
+ ## Example Usage
14
+
15
+ ``` terraform
16
+ # this example shows the use of user and group resources
17
+ # to control access to a lab.
18
+ # Note that these resources will be removed at destroy time!
19
+
20
+ resource "cml2_user" "student1" {
21
+ username = "student1"
22
+ password = "secret"
23
+ fullname = "Joe Learner"
24
+
25
+ description = "This is the Student 1 account"
26
+ is_admin = false
27
+ }
28
+
29
+ resource "cml2_user" "student2" {
30
+ username = "student2"
31
+ password = "secret"
32
+ fullname = "Jane Learner"
33
+
34
+ description = "This is the Student 2 account"
35
+ is_admin = false
36
+ }
37
+
38
+ resource "cml2_lab" "student_lab" {
39
+ title = "Student Lab"
40
+ }
41
+
42
+ resource "cml2_group" "students" {
43
+ description = "Permission group for all students"
44
+ name = "students"
45
+ members = [cml2_user.student1.id, cml2_user.student2.id]
46
+ labs = [
47
+ {
48
+ id = cml2_lab.student_lab.id
49
+ permission = "read_write"
50
+ },
51
+ ]
52
+ }
53
+ ```
14
54
15
55
<!-- schema generated by tfplugindocs -->
16
56
## Schema
Original file line number Diff line number Diff line change @@ -10,14 +10,27 @@ description: |-
10
10
11
11
A resource which handles users.
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ # Create a user account
17
+
18
+ resource "cml2_user" "student1" {
19
+ username = "student1"
20
+ password = "secret"
21
+ fullname = "Joe Learner"
22
+
23
+ description = "This is the Student 1 account"
24
+ is_admin = false
25
+ }
26
+ ```
14
27
15
28
<!-- schema generated by tfplugindocs -->
16
29
## Schema
17
30
18
31
### Required
19
32
20
- - ` password ` (String) Password of the user.
33
+ - ` password ` (String, Sensitive ) Password of the user.
21
34
- ` username ` (String) Login name of the user.
22
35
23
36
### Optional
Original file line number Diff line number Diff line change
1
+ # Get a list of all groups on the system or a specific group.
2
+ # For a specific group, the length of the list is always one if the
3
+ # group is found, zero otherwise.
4
+ #
5
+ # Group names are enforced to be unique!
6
+
7
+ data "cml2_groups" "students" {
8
+ name = " students"
9
+ }
10
+
11
+ output "student_group_id" {
12
+ value = data. cml2_groups . students . groups [0 ]. id
13
+ }
Original file line number Diff line number Diff line change
1
+ # ensure the system is ready to talk to by using this data source
2
+ # with a timeout like 5m (5 minutes)
3
+
4
+ data "cml2_system" "wait_for_ready" {
5
+ timeout = " 5m"
6
+ }
7
+ output "readiness" {
8
+ value = data. cml2_system . wait_for_ready . version
9
+ }
Original file line number Diff line number Diff line change
1
+ # Get a list of all users on the system or a specific user.
2
+ # For a specific user, the length of the list is always one if the
3
+ # user is found, zero otherwise.
4
+ #
5
+ # User names are enforced to be unique!
6
+
7
+ data "cml2_users" "get_admin" {
8
+ username = " admin"
9
+ }
10
+
11
+ output "admin_id" {
12
+ value = data. cml2_users . get_admin . users [0 ]. id
13
+ }
You can’t perform that action at this time.
0 commit comments