From 069520afdee899567d9c8614769d3ce9405890b4 Mon Sep 17 00:00:00 2001 From: Alexey <34266885+v1km4n@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:53:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20=D1=80=D0=B5?= =?UTF-8?q?=D0=BF=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D1=8F=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexey Orlov --- .github/workflows/manual_destroy.yml | 25 +++++++++++++--- .github/workflows/modules.yml | 1 + .github/workflows/opentofu.yml | 1 + README_TF.md | 9 ++++-- main.tf | 4 +-- modules/craas/README.md | 6 ++-- modules/flavor/README.md | 5 ++-- modules/floatingip/README.md | 5 ++-- modules/image_datasource/README.md | 5 ++-- modules/keypair/README.md | 5 ++-- modules/mks/k8s-cluster-standalone/README.md | 31 ++++++++++---------- modules/mks/k8s-cluster/README.md | 5 ++-- modules/mks/k8s-nodegroup-gpu/README.md | 5 ++-- modules/mks/k8s-nodegroup/README.md | 5 ++-- modules/nat/README.md | 15 +++++----- modules/network/README.md | 7 +++-- modules/os_project_with_user/README.md | 9 +++--- modules/os_project_with_user/main.tf | 12 ++++---- modules/s3/s3-bucket/README.md | 7 +++-- modules/s3/s3-bucket/versions.tf | 1 - modules/s3/s3-credentials/README.md | 5 ++-- modules/selectel-token/README.md | 7 +++-- modules/sfs/README.md | 9 +++--- modules/vm/README.md | 21 ++++++------- modules/volume/README.md | 9 +++--- vars.tf | 7 +++++ 26 files changed, 133 insertions(+), 88 deletions(-) diff --git a/.github/workflows/manual_destroy.yml b/.github/workflows/manual_destroy.yml index a7a068e..56f7507 100644 --- a/.github/workflows/manual_destroy.yml +++ b/.github/workflows/manual_destroy.yml @@ -8,13 +8,15 @@ jobs: name: 'Manual Destroy' runs-on: self-hosted env: + terraform_link: ${{ secrets.TERRAFORM_BINARY }} TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }} TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }} TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }} + TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }} steps: - name: Checkout the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup NodeJS v20 uses: actions/setup-node@v4 @@ -22,9 +24,24 @@ jobs: node-version: 20 - name: Setup Terraform - uses: hashicorp/setup-terraform@v3.0.0 - with: - terraform_version: "1.5.7" + shell: bash + run: | + curl -o terraform.zip $terraform_link + unzip terraform.zip + rm terraform.zip + chmod 755 terraform + mv terraform /usr/local/bin + + - name: Add .terraformrc + shell: bash + run: | + cat <> $HOME/.terraformrc + provider_installation { + network_mirror { + url = "https://tf-proxy.selectel.ru/mirror/v1/" + } + } + EOS - name: Init Terraform run: > diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index dd90965..468ca48 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -14,6 +14,7 @@ jobs: TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }} TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }} TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }} + TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }} if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} steps: diff --git a/.github/workflows/opentofu.yml b/.github/workflows/opentofu.yml index aebbcdc..08f2cc1 100644 --- a/.github/workflows/opentofu.yml +++ b/.github/workflows/opentofu.yml @@ -13,6 +13,7 @@ jobs: TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }} TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }} TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }} + TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }} if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} steps: diff --git a/README_TF.md b/README_TF.md index 274da28..d38ff64 100644 --- a/README_TF.md +++ b/README_TF.md @@ -1,8 +1,9 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | '>= 1.0.0, <= 1.5.7' | +| [terraform](#requirement\_terraform) | >= 1.0.0, <= 1.6.2 | | [openstack](#requirement\_openstack) | 1.53.0 | | [selectel](#requirement\_selectel) | 5.1.1 | @@ -30,13 +31,14 @@ | Name | Type | |------|------| -| [openstack_networking_floatingip_associate_v2.association_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_floatingip_associate_v2) | resource | -| [selectel_mks_kube_versions_v1.versions](https://registry.terraform.io/providers/selectel/selectel/5.1.1/docs/data-sources/mks_kube_versions_v1) | data source | +| openstack_networking_floatingip_associate_v2.association_1 | resource | +| selectel_mks_kube_versions_v1.versions | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [flavor\_name](#input\_flavor\_name) | Название флавора | `string` | n/a | yes | | [os\_auth\_url](#input\_os\_auth\_url) | URL до openstack api | `string` | `"https://cloud.api.selcloud.ru/identity/v3"` | no | | [selectel\_domain\_name](#input\_selectel\_domain\_name) | ID Selectel аккаунта | `string` | n/a | yes | | [selectel\_user\_admin\_password](#input\_selectel\_user\_admin\_password) | Пароль от сервисного пользователя | `string` | n/a | yes | @@ -45,3 +47,4 @@ ## Outputs No outputs. + \ No newline at end of file diff --git a/main.tf b/main.tf index 8b0994f..559a88b 100644 --- a/main.tf +++ b/main.tf @@ -12,7 +12,7 @@ module "vm" { source = "./modules/vm" os_region = "ru-9" os_zone = "ru-9a" - vm_name = "github-vm" + vm_name = var.flavor_name server_root_disk_gb = ["10"] vm_vcpus = 4 vm_ram_mb = 4096 @@ -124,7 +124,7 @@ module "mks" { ng_volume_type = ["fast"] ng_labels = [{ "role" : "cpu" }] - gpu_nodegroups = 1 + gpu_nodegroups = 0 gpu_ng_nodes_count = [1] gpu_ng_volume_gb = [100] gpu_ng_volume_type = ["fast"] diff --git a/modules/craas/README.md b/modules/craas/README.md index dc6c210..85dbb9d 100644 --- a/modules/craas/README.md +++ b/modules/craas/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -18,8 +19,8 @@ No modules. | Name | Type | |------|------| -| [selectel_craas_registry_v1.registry_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/craas_registry_v1) | resource | -| [selectel_craas_token_v1.token_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/craas_token_v1) | resource | +| selectel_craas_registry_v1.registry_1 | resource | +| selectel_craas_token_v1.token_1 | resource | ## Inputs @@ -34,3 +35,4 @@ No modules. | Name | Description | |------|-------------| | [craas\_password](#output\_craas\_password) | craas token | + \ No newline at end of file diff --git a/modules/flavor/README.md b/modules/flavor/README.md index e3e4754..3a21831 100644 --- a/modules/flavor/README.md +++ b/modules/flavor/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [openstack_compute_flavor_v2.flavor](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_flavor_v2) | resource | +| openstack_compute_flavor_v2.flavor | resource | ## Inputs @@ -37,3 +37,4 @@ No modules. | Name | Description | |------|-------------| | [flavor\_id](#output\_flavor\_id) | n/a | + \ No newline at end of file diff --git a/modules/floatingip/README.md b/modules/floatingip/README.md index 9ab2d04..4fde1ad 100644 --- a/modules/floatingip/README.md +++ b/modules/floatingip/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [openstack_networking_floatingip_v2.floatingip_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_floatingip_v2) | resource | +| openstack_networking_floatingip_v2.floatingip_1 | resource | ## Inputs @@ -34,3 +34,4 @@ No modules. |------|-------------| | [floatingip\_address](#output\_floatingip\_address) | floating ip | | [floatingip\_id](#output\_floatingip\_id) | floating ip id | + \ No newline at end of file diff --git a/modules/image_datasource/README.md b/modules/image_datasource/README.md index a54c7c0..4d59660 100644 --- a/modules/image_datasource/README.md +++ b/modules/image_datasource/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [openstack_images_image_v2.image_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/data-sources/images_image_v2) | data source | +| openstack_images_image_v2.image_1 | data source | ## Inputs @@ -34,3 +34,4 @@ No modules. | Name | Description | |------|-------------| | [image\_id](#output\_image\_id) | ID созданного image | + \ No newline at end of file diff --git a/modules/keypair/README.md b/modules/keypair/README.md index a13bc08..cda66c0 100644 --- a/modules/keypair/README.md +++ b/modules/keypair/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [openstack_compute_keypair_v2.keypair_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_keypair_v2) | resource | +| openstack_compute_keypair_v2.keypair_1 | resource | ## Inputs @@ -35,3 +35,4 @@ No modules. |------|-------------| | [keypair\_id](#output\_keypair\_id) | ID созданной KeyPair | | [keypair\_name](#output\_keypair\_name) | Имя созданной KeyPair | + \ No newline at end of file diff --git a/modules/mks/k8s-cluster-standalone/README.md b/modules/mks/k8s-cluster-standalone/README.md index acbf021..4f8dc79 100644 --- a/modules/mks/k8s-cluster-standalone/README.md +++ b/modules/mks/k8s-cluster-standalone/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | @@ -25,7 +25,7 @@ | Name | Type | |------|------| -| [selectel_mks_kubeconfig_v1.kubeconfig](https://registry.terraform.io/providers/selectel/selectel/latest/docs/data-sources/mks_kubeconfig_v1) | data source | +| selectel_mks_kubeconfig_v1.kubeconfig | data source | ## Inputs @@ -34,12 +34,12 @@ | [cluster\_name](#input\_cluster\_name) | n/a | `string` | n/a | yes | | [enable\_autorepair](#input\_enable\_autorepair) | n/a | `bool` | `false` | no | | [enable\_patch\_version\_auto\_upgrade](#input\_enable\_patch\_version\_auto\_upgrade) | n/a | `bool` | `false` | no | -| [gpu\_ng\_flavor](#input\_gpu\_ng\_flavor) | n/a | `list(string)` |
[
"2"
]
| no | -| [gpu\_ng\_labels](#input\_gpu\_ng\_labels) | n/a | `list(map(any))` |
[
{
"role": "gpu"
}
]
| no | -| [gpu\_ng\_nodes\_count](#input\_gpu\_ng\_nodes\_count) | n/a | `list(number)` |
[
2
]
| no | -| [gpu\_ng\_taints](#input\_gpu\_ng\_taints) | n/a |
list(object({
key = string
value = string
effect = string
}))
| `[]` | no | -| [gpu\_ng\_volume\_gb](#input\_gpu\_ng\_volume\_gb) | n/a | `list(number)` |
[
32
]
| no | -| [gpu\_ng\_volume\_type](#input\_gpu\_ng\_volume\_type) | n/a | `list(string)` |
[
"fast"
]
| no | +| [gpu\_ng\_flavor](#input\_gpu\_ng\_flavor) | n/a | `list(string)` |
[
"2"
]
| no | +| [gpu\_ng\_labels](#input\_gpu\_ng\_labels) | n/a | `list(map(any))` |
[
{
"role": "gpu"
}
]
| no | +| [gpu\_ng\_nodes\_count](#input\_gpu\_ng\_nodes\_count) | n/a | `list(number)` |
[
2
]
| no | +| [gpu\_ng\_taints](#input\_gpu\_ng\_taints) | n/a |
list(object({
key = string
value = string
effect = string
}))
| `[]` | no | +| [gpu\_ng\_volume\_gb](#input\_gpu\_ng\_volume\_gb) | n/a | `list(number)` |
[
32
]
| no | +| [gpu\_ng\_volume\_type](#input\_gpu\_ng\_volume\_type) | n/a | `list(string)` |
[
"fast"
]
| no | | [gpu\_nodegroups](#input\_gpu\_nodegroups) | n/a | `number` | `0` | no | | [kube\_version](#input\_kube\_version) | n/a | `string` | n/a | yes | | [maintenance\_window\_end](#input\_maintenance\_window\_end) | n/a | `string` | `"04:00:00"` | no | @@ -47,14 +47,14 @@ | [nat\_subnet\_cidr](#input\_nat\_subnet\_cidr) | n/a | `string` | `"10.222.0.0/16"` | no | | [network\_id](#input\_network\_id) | n/a | `string` | `""` | no | | [ng\_affinity\_policy](#input\_ng\_affinity\_policy) | n/a | `string` | `""` | no | -| [ng\_cpus](#input\_ng\_cpus) | n/a | `list(number)` |
[
2
]
| no | +| [ng\_cpus](#input\_ng\_cpus) | n/a | `list(number)` |
[
2
]
| no | | [ng\_keypair\_name](#input\_ng\_keypair\_name) | n/a | `string` | `""` | no | -| [ng\_labels](#input\_ng\_labels) | n/a | `list(map(any))` |
[
{
"role": "system"
}
]
| no | -| [ng\_nodes\_count](#input\_ng\_nodes\_count) | n/a | `list(number)` |
[
2
]
| no | -| [ng\_ram\_mb](#input\_ng\_ram\_mb) | n/a | `list(number)` |
[
4096
]
| no | -| [ng\_taints](#input\_ng\_taints) | n/a |
list(object({
key = string
value = string
effect = string
}))
| `[]` | no | -| [ng\_volume\_gb](#input\_ng\_volume\_gb) | n/a | `list(number)` |
[
32
]
| no | -| [ng\_volume\_type](#input\_ng\_volume\_type) | n/a | `list(string)` |
[
"fast"
]
| no | +| [ng\_labels](#input\_ng\_labels) | n/a | `list(map(any))` |
[
{
"role": "system"
}
]
| no | +| [ng\_nodes\_count](#input\_ng\_nodes\_count) | n/a | `list(number)` |
[
2
]
| no | +| [ng\_ram\_mb](#input\_ng\_ram\_mb) | n/a | `list(number)` |
[
4096
]
| no | +| [ng\_taints](#input\_ng\_taints) | n/a |
list(object({
key = string
value = string
effect = string
}))
| `[]` | no | +| [ng\_volume\_gb](#input\_ng\_volume\_gb) | n/a | `list(number)` |
[
32
]
| no | +| [ng\_volume\_type](#input\_ng\_volume\_type) | n/a | `list(string)` |
[
"fast"
]
| no | | [no\_gateway](#input\_no\_gateway) | Sets whether a network should have a gateway | `string` | `false` | no | | [nodegroups](#input\_nodegroups) | n/a | `string` | `1` | no | | [os\_auth\_url](#input\_os\_auth\_url) | n/a | `string` | `"https://api.selvpc.ru/identity/v3/auth/"` | no | @@ -69,3 +69,4 @@ | [kube\_config](#output\_kube\_config) | n/a | | [nat\_network\_id](#output\_nat\_network\_id) | n/a | | [nat\_subnet\_id](#output\_nat\_subnet\_id) | n/a | + \ No newline at end of file diff --git a/modules/mks/k8s-cluster/README.md b/modules/mks/k8s-cluster/README.md index b0db8c6..84076b9 100644 --- a/modules/mks/k8s-cluster/README.md +++ b/modules/mks/k8s-cluster/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [selectel_mks_cluster_v1.cluster_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_cluster_v1) | resource | +| selectel_mks_cluster_v1.cluster_1 | resource | ## Inputs @@ -40,3 +40,4 @@ No modules. | Name | Description | |------|-------------| | [cluster\_id](#output\_cluster\_id) | ID созданного кластера | + \ No newline at end of file diff --git a/modules/mks/k8s-nodegroup-gpu/README.md b/modules/mks/k8s-nodegroup-gpu/README.md index 38634e3..fc8c92c 100644 --- a/modules/mks/k8s-nodegroup-gpu/README.md +++ b/modules/mks/k8s-nodegroup-gpu/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [selectel_mks_nodegroup_v1.nodegroup_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_nodegroup_v1) | resource | +| selectel_mks_nodegroup_v1.nodegroup_1 | resource | ## Inputs @@ -45,3 +45,4 @@ No modules. | Name | Description | |------|-------------| | [nodegroup\_id](#output\_nodegroup\_id) | ID созданной группы нод | + \ No newline at end of file diff --git a/modules/mks/k8s-nodegroup/README.md b/modules/mks/k8s-nodegroup/README.md index af559ce..49b7358 100644 --- a/modules/mks/k8s-nodegroup/README.md +++ b/modules/mks/k8s-nodegroup/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [selectel_mks_nodegroup_v1.nodegroup_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_nodegroup_v1) | resource | +| selectel_mks_nodegroup_v1.nodegroup_1 | resource | ## Inputs @@ -45,3 +45,4 @@ No modules. | Name | Description | |------|-------------| | [nodegroup\_id](#output\_nodegroup\_id) | n/a | + \ No newline at end of file diff --git a/modules/nat/README.md b/modules/nat/README.md index 9265ac2..c5490d0 100644 --- a/modules/nat/README.md +++ b/modules/nat/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,17 +19,17 @@ No modules. | Name | Type | |------|------| -| [openstack_networking_network_v2.network_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_network_v2) | resource | -| [openstack_networking_router_interface_v2.router_interface_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_router_interface_v2) | resource | -| [openstack_networking_router_v2.router_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_router_v2) | resource | -| [openstack_networking_subnet_v2.subnet_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_subnet_v2) | resource | -| [openstack_networking_network_v2.external_net](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/data-sources/networking_network_v2) | data source | +| openstack_networking_network_v2.network_1 | resource | +| openstack_networking_router_interface_v2.router_interface_1 | resource | +| openstack_networking_router_v2.router_1 | resource | +| openstack_networking_subnet_v2.subnet_1 | resource | +| openstack_networking_network_v2.external_net | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [dns\_nameservers](#input\_dns\_nameservers) | DNS servers to be used | `list(string)` |
[
"188.93.16.19",
"188.93.17.19"
]
| no | +| [dns\_nameservers](#input\_dns\_nameservers) | DNS servers to be used | `list(string)` |
[
"188.93.16.19",
"188.93.17.19"
]
| no | | [enable\_dhcp](#input\_enable\_dhcp) | DHCP enable flag | `bool` | `false` | no | | [network\_name](#input\_network\_name) | Network name to be created | `string` | `"network_1"` | no | | [no\_gateway](#input\_no\_gateway) | (Optional) Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet. | `bool` | `true` | no | @@ -45,3 +45,4 @@ No modules. | [network\_id](#output\_network\_id) | ID созданной сети | | [router\_id](#output\_router\_id) | ID созданного роутера | | [subnet\_id](#output\_subnet\_id) | ID созданной подсети | + \ No newline at end of file diff --git a/modules/network/README.md b/modules/network/README.md index c53be58..1dc8d15 100644 --- a/modules/network/README.md +++ b/modules/network/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,8 +19,8 @@ No modules. | Name | Type | |------|------| -| [openstack_networking_network_v2.network_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_network_v2) | resource | -| [openstack_networking_subnet_v2.subnet_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_subnet_v2) | resource | +| openstack_networking_network_v2.network_1 | resource | +| openstack_networking_subnet_v2.subnet_1 | resource | ## Inputs @@ -37,3 +37,4 @@ No modules. |------|-------------| | [network\_id](#output\_network\_id) | n/a | | [subnet\_id](#output\_subnet\_id) | n/a | + \ No newline at end of file diff --git a/modules/os_project_with_user/README.md b/modules/os_project_with_user/README.md index 6ee7457..17707d9 100644 --- a/modules/os_project_with_user/README.md +++ b/modules/os_project_with_user/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [random](#requirement\_random) | >= 3.3.2 | | [selectel](#requirement\_selectel) | >=5.0.2 | @@ -21,9 +21,9 @@ No modules. | Name | Type | |------|------| -| [random_password.serviceuser_1_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource | -| [selectel_iam_serviceuser_v1.serviceuser_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/iam_serviceuser_v1) | resource | -| [selectel_vpc_project_v2.project_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/vpc_project_v2) | resource | +| random_password.serviceuser_1_password | resource | +| selectel_iam_serviceuser_v1.serviceuser_1 | resource | +| selectel_vpc_project_v2.project_1 | resource | ## Inputs @@ -41,3 +41,4 @@ No modules. | [user\_id](#output\_user\_id) | ID of user that admins the project | | [user\_name](#output\_user\_name) | Username of created user | | [user\_password](#output\_user\_password) | Password of created user. Generated automatically. | + \ No newline at end of file diff --git a/modules/os_project_with_user/main.tf b/modules/os_project_with_user/main.tf index c892cf3..3c1793d 100644 --- a/modules/os_project_with_user/main.tf +++ b/modules/os_project_with_user/main.tf @@ -3,13 +3,11 @@ resource "selectel_vpc_project_v2" "project_1" { } resource "random_password" "serviceuser_1_password" { - length = 32 - special = true - override_special = "!#$%&*()-_=+[]{}<>:?" - min_special = 3 - min_numeric = 1 - min_lower = 1 - min_upper = 1 + length = 24 + special = false + min_numeric = 1 + min_lower = 1 + min_upper = 1 } resource "selectel_iam_serviceuser_v1" "serviceuser_1" { diff --git a/modules/s3/s3-bucket/README.md b/modules/s3/s3-bucket/README.md index 898962d..926667a 100644 --- a/modules/s3/s3-bucket/README.md +++ b/modules/s3/s3-bucket/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [http-full](#requirement\_http-full) | >= 1.3.1 | | [openstack](#requirement\_openstack) | 1.53.0 | | [terracurl](#requirement\_terracurl) | >= 1.0.1 | @@ -24,8 +24,8 @@ | Name | Type | |------|------| -| [openstack_objectstorage_container_v1.bucket](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/objectstorage_container_v1) | resource | -| [terracurl_request.init_s3](https://registry.terraform.io/providers/devops-rob/terracurl/latest/docs/data-sources/request) | data source | +| openstack_objectstorage_container_v1.bucket | resource | +| terracurl_request.init_s3 | data source | ## Inputs @@ -43,3 +43,4 @@ ## Outputs No outputs. + \ No newline at end of file diff --git a/modules/s3/s3-bucket/versions.tf b/modules/s3/s3-bucket/versions.tf index 8edc748..59204ba 100644 --- a/modules/s3/s3-bucket/versions.tf +++ b/modules/s3/s3-bucket/versions.tf @@ -8,7 +8,6 @@ terraform { source = "registry.terraform.io/salrashid123/http-full" version = ">= 1.3.1" } - terracurl = { source = "registry.terraform.io/devops-rob/terracurl" version = ">= 1.0.1" diff --git a/modules/s3/s3-credentials/README.md b/modules/s3/s3-credentials/README.md index b4008c6..1a9f2d0 100644 --- a/modules/s3/s3-credentials/README.md +++ b/modules/s3/s3-credentials/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | ## Providers @@ -19,7 +19,7 @@ No modules. | Name | Type | |------|------| -| [selectel_iam_s3_credentials_v1.s3_credentials_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/iam_s3_credentials_v1) | resource | +| selectel_iam_s3_credentials_v1.s3_credentials_1 | resource | ## Inputs @@ -35,3 +35,4 @@ No modules. |------|-------------| | [s3\_credentials\_access\_key](#output\_s3\_credentials\_access\_key) | n/a | | [s3\_credentials\_secret\_key](#output\_s3\_credentials\_secret\_key) | n/a | + \ No newline at end of file diff --git a/modules/selectel-token/README.md b/modules/selectel-token/README.md index 21f3f68..fb0d35c 100644 --- a/modules/selectel-token/README.md +++ b/modules/selectel-token/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0.0 | | [http-full](#requirement\_http-full) | >= 1.3.1 | ## Providers @@ -19,8 +19,8 @@ No modules. | Name | Type | |------|------| -| [http-full_http.accout-token](https://registry.terraform.io/providers/salrashid123/http-full/latest/docs/data-sources/http) | data source | -| [http-full_http.project-token](https://registry.terraform.io/providers/salrashid123/http-full/latest/docs/data-sources/http) | data source | +| http-full_http.accout-token | data source | +| http-full_http.project-token | data source | ## Inputs @@ -38,3 +38,4 @@ No modules. |------|-------------| | [account\_token](#output\_account\_token) | n/a | | [project\_token](#output\_project\_token) | n/a | + \ No newline at end of file diff --git a/modules/sfs/README.md b/modules/sfs/README.md index 8d0e58e..7df58a2 100644 --- a/modules/sfs/README.md +++ b/modules/sfs/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | ## Providers @@ -19,9 +19,9 @@ No modules. | Name | Type | |------|------| -| [openstack_sharedfilesystem_share_access_v2.share_access_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/sharedfilesystem_share_access_v2) | resource | -| [openstack_sharedfilesystem_share_v2.sfs_share](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/sharedfilesystem_share_v2) | resource | -| [openstack_sharedfilesystem_sharenetwork_v2.sfs_sharenetwork](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/sharedfilesystem_sharenetwork_v2) | resource | +| openstack_sharedfilesystem_share_access_v2.share_access_1 | resource | +| openstack_sharedfilesystem_share_v2.sfs_share | resource | +| openstack_sharedfilesystem_sharenetwork_v2.sfs_sharenetwork | resource | ## Inputs @@ -42,3 +42,4 @@ No modules. |------|-------------| | [sfs\_address](#output\_sfs\_address) | SFS path | | [sfs\_addressess](#output\_sfs\_addressess) | SFS paths array. For debug purposes | + \ No newline at end of file diff --git a/modules/vm/README.md b/modules/vm/README.md index 73568f6..176be27 100644 --- a/modules/vm/README.md +++ b/modules/vm/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | | [selectel](#requirement\_selectel) | >=5.0.2 | @@ -26,19 +26,19 @@ | Name | Type | |------|------| -| [openstack_compute_instance_v2.instance_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_instance_v2) | resource | -| [openstack_compute_interface_attach_v2.port_3_attach](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_interface_attach_v2) | resource | -| [openstack_networking_port_v2.port_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_port_v2) | resource | -| [openstack_networking_port_v2.port_2](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_port_v2) | resource | -| [openstack_networking_port_v2.port_3](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_port_v2) | resource | +| openstack_compute_instance_v2.instance_1 | resource | +| openstack_compute_interface_attach_v2.port_3_attach | resource | +| openstack_networking_port_v2.port_1 | resource | +| openstack_networking_port_v2.port_2 | resource | +| openstack_networking_port_v2.port_3 | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [dns\_nameservers](#input\_dns\_nameservers) | DNS servers to be used, selectel dns is default | `list(string)` |
[
"188.93.16.19",
"188.93.17.19"
]
| no | +| [dns\_nameservers](#input\_dns\_nameservers) | DNS servers to be used, selectel dns is default | `list(string)` |
[
"188.93.16.19",
"188.93.17.19"
]
| no | | [enable\_dhcp](#input\_enable\_dhcp) | DHCP enable flag | `bool` | `false` | no | -| [image\_name](#input\_image\_name) | n/a | `list(string)` |
[
"Ubuntu 20.04 LTS 64-bit"
]
| no | +| [image\_name](#input\_image\_name) | n/a | `list(string)` |
[
"Ubuntu 20.04 LTS 64-bit"
]
| no | | [local\_network\_1\_name](#input\_local\_network\_1\_name) | Local network name to be created | `string` | `"local_network_1"` | no | | [local\_network\_1\_subnet\_cidr](#input\_local\_network\_1\_subnet\_cidr) | Subnet CIDR to be created | `string` | `"192.168.1.0/24"` | no | | [local\_network\_2\_name](#input\_local\_network\_2\_name) | Local network name to be created | `string` | `"local_network_2"` | no | @@ -49,8 +49,8 @@ | [os\_zone](#input\_os\_zone) | OS zone to be used | `string` | n/a | yes | | [router\_external\_net\_name](#input\_router\_external\_net\_name) | Name of external network to be used | `string` | `"external-network"` | no | | [router\_name](#input\_router\_name) | Router name to be created | `string` | `"router_1"` | no | -| [server\_root\_disk\_gb](#input\_server\_root\_disk\_gb) | List of disks | `list(number)` |
[
40
]
| no | -| [server\_volume\_type](#input\_server\_volume\_type) | List of disk types | `list(string)` |
[
"fast"
]
| no | +| [server\_root\_disk\_gb](#input\_server\_root\_disk\_gb) | List of disks | `list(number)` |
[
40
]
| no | +| [server\_volume\_type](#input\_server\_volume\_type) | List of disk types | `list(string)` |
[
"fast"
]
| no | | [subnet\_cidr](#input\_subnet\_cidr) | Subnet CIDR to be created | `string` | `"192.168.0.0/24"` | no | | [vm\_local\_disk\_gb](#input\_vm\_local\_disk\_gb) | Flavor's local disk size | `string` | `"0"` | no | | [vm\_name](#input\_vm\_name) | Name of VM to create | `string` | n/a | yes | @@ -64,3 +64,4 @@ | [nat\_net\_id](#output\_nat\_net\_id) | n/a | | [nat\_sub\_id](#output\_nat\_sub\_id) | n/a | | [vm\_port\_id](#output\_vm\_port\_id) | n/a | + \ No newline at end of file diff --git a/modules/volume/README.md b/modules/volume/README.md index 199fe0b..08b8009 100644 --- a/modules/volume/README.md +++ b/modules/volume/README.md @@ -1,8 +1,8 @@ + ## Requirements | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.0 | | [openstack](#requirement\_openstack) | 1.53.0 | | [random](#requirement\_random) | >= 3.3.2 | @@ -21,9 +21,9 @@ No modules. | Name | Type | |------|------| -| [openstack_blockstorage_volume_v3.volume_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/blockstorage_volume_v3) | resource | -| [random_string.random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [openstack_images_image_v2.image_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/data-sources/images_image_v2) | data source | +| openstack_blockstorage_volume_v3.volume_1 | resource | +| random_string.random | resource | +| openstack_images_image_v2.image_1 | data source | ## Inputs @@ -42,3 +42,4 @@ No modules. | [image\_id](#output\_image\_id) | ID of image used | | [volume\_id](#output\_volume\_id) | Created volume ID | | [volume\_name](#output\_volume\_name) | Name of created volume | + \ No newline at end of file diff --git a/vars.tf b/vars.tf index 08f8bfd..64b6c2e 100644 --- a/vars.tf +++ b/vars.tf @@ -20,3 +20,10 @@ variable "os_auth_url" { default = "https://cloud.api.selcloud.ru/identity/v3" description = "URL до openstack api" } + +# vm vars + +variable "flavor_name" { + type = string + description = "Название флавора" +} \ No newline at end of file