Skip to content

Commit 0957db7

Browse files
fix: remove ansible collection version dependencies (#972)
* fix: remove ansible collection dependencies. install from collections requirements directly * fix: Control ansible host setup. Run only once.
1 parent 6bba2b2 commit 0957db7

File tree

11 files changed

+37
-21
lines changed

11 files changed

+37
-21
lines changed

modules/powervs-vpc-landing-zone/main.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ module "configure_network_services" {
133133
source = "./submodules/ansible"
134134
depends_on = [module.vpc_file_share_alb]
135135

136-
bastion_host_ip = local.access_host_or_ip
137-
ansible_host_or_ip = local.network_services_vsi_ip
138-
ssh_private_key = var.ssh_private_key
136+
bastion_host_ip = local.access_host_or_ip
137+
ansible_host_or_ip = local.network_services_vsi_ip
138+
ssh_private_key = var.ssh_private_key
139+
configure_ansible_host = true
139140

140141
src_script_template_name = "configure-network-services/ansible_exec.sh.tftpl"
141142
dst_script_file_name = "network-services-instance.sh"
@@ -165,9 +166,10 @@ module "configure_monitoring_host" {
165166
depends_on = [module.configure_network_services]
166167
count = var.enable_monitoring ? 1 : 0
167168

168-
bastion_host_ip = local.access_host_or_ip
169-
ansible_host_or_ip = local.network_services_vsi_ip
170-
ssh_private_key = var.ssh_private_key
169+
bastion_host_ip = local.access_host_or_ip
170+
ansible_host_or_ip = local.network_services_vsi_ip
171+
ssh_private_key = var.ssh_private_key
172+
configure_ansible_host = false
171173

172174
src_script_template_name = "configure-monitoring-instance/ansible_exec.sh.tftpl"
173175
dst_script_file_name = "monitoring-instance.sh"

modules/powervs-vpc-landing-zone/submodules/ansible/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ No modules.
2929
| <a name="input_ansible_host_or_ip"></a> [ansible\_host\_or\_ip](#input\_ansible\_host\_or\_ip) | Private IP of virtual server instance running RHEL OS on which ansible will be installed and configured to act as central ansible node. | `string` | n/a | yes |
3030
| <a name="input_ansible_vault_password"></a> [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt ansible variable file for SAP installation. | `string` | `null` | no |
3131
| <a name="input_bastion_host_ip"></a> [bastion\_host\_ip](#input\_bastion\_host\_ip) | Jump/Bastion server public IP address to reach the ansible host which has private IP. | `string` | n/a | yes |
32+
| <a name="input_configure_ansible_host"></a> [configure\_ansible\_host](#input\_configure\_ansible\_host) | If set to true, bash script will be executed to install and configure the collections and packages on ansible node. | `bool` | n/a | yes |
3233
| <a name="input_dst_inventory_file_name"></a> [dst\_inventory\_file\_name](#input\_dst\_inventory\_file\_name) | Name for the inventory file to be generated on the Ansible host. | `string` | n/a | yes |
3334
| <a name="input_dst_playbook_file_name"></a> [dst\_playbook\_file\_name](#input\_dst\_playbook\_file\_name) | Name for the playbook file to be generated on the Ansible host. | `string` | n/a | yes |
3435
| <a name="input_dst_script_file_name"></a> [dst\_script\_file\_name](#input\_dst\_script\_file\_name) | Name for the bash file to be generated on the Ansible host. | `string` | n/a | yes |

modules/powervs-vpc-landing-zone/submodules/ansible/ansible_node_packages.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
############################################################
99

1010
GLOBAL_RHEL_PACKAGES="rhel-system-roles rhel-system-roles-sap expect"
11-
GLOBAL_GALAXY_COLLECTIONS="ibm.power_linux_sap:>=3.0.0,<4.0.0 ansible.posix:1.5.4 ansible.utils:4.1.0 community.general:10.0.1"
11+
GLOBAL_GALAXY_COLLECTIONS="ibm.power_linux_sap:>=3.0.0,<4.0.0"
1212

1313
############################################################
1414
# Start functions
@@ -90,6 +90,7 @@ main::install_packages() {
9090
done
9191
done
9292

93+
ansible-galaxy collection install -r '/root/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml' -f
9394
main::log_info "All packages installed successfully"
9495
fi
9596

modules/powervs-vpc-landing-zone/submodules/ansible/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ locals {
2424
##############################################################
2525

2626
resource "terraform_data" "setup_ansible_host" {
27+
count = var.configure_ansible_host ? 1 : 0
2728

2829
connection {
2930
type = "ssh"
@@ -214,3 +215,9 @@ resource "terraform_data" "execute_playbooks_with_vault" {
214215
]
215216
}
216217
}
218+
219+
220+
moved {
221+
from = terraform_data.setup_ansible_host
222+
to = terraform_data.setup_ansible_host[0]
223+
}

modules/powervs-vpc-landing-zone/submodules/ansible/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ variable "ssh_private_key" {
1414
sensitive = true
1515
}
1616

17+
variable "configure_ansible_host" {
18+
description = "If set to true, bash script will be executed to install and configure the collections and packages on ansible node."
19+
type = bool
20+
}
21+
1722
variable "src_script_template_name" {
1823
description = "Name of the bash script template file located within the 'templates-ansible' directory."
1924
type = string

reference-architectures/import/deploy-arch-ibm-pvs-inf-import.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
copyright:
33
years: 2024
4-
lastupdated: "2024-12-9"
4+
lastupdated: "2024-12-11"
55
keywords:
66
subcollection: deployable-reference-architectures
77
authors:
@@ -15,7 +15,7 @@ use-case: ITServiceManagement
1515
industry: Technology
1616
compliance:
1717
content-type: reference-architecture
18-
version: v8.0.2
18+
version: v8.0.3
1919

2020
---
2121

@@ -26,7 +26,7 @@ version: v8.0.2
2626
{: toc-industry="Technology"}
2727
{: toc-use-case="ITServiceManagement"}
2828
{: toc-compliance="SAPCertified"}
29-
{: toc-version="8.0.2"}
29+
{: toc-version="8.0.3"}
3030

3131
This solution helps to install the deployable architecture ['Power Virtual Server for SAP HANA'](https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-pvs-sap-9aa6135e-75d5-467e-9f4a-ac2a21c069b8-global) on top of a pre-existing Power Virtual Server(PowerVS) landscape. 'Power Virtual Server for SAP HANA' automation requires a schematics workspace id for installation. The 'Import' solution creates a schematics workspace by taking pre-existing VPC and PowerVS infrastructure resource details as inputs. The ID of this schematics workspace will be the pre-requisite workspace id required by 'Power Virtual Server for SAP HANA' to create and configure the PowerVS instances for SAP on top of the existing infrastructure.
3232

reference-architectures/standard-extend/deploy-arch-ibm-pvs-inf-standard-extend.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
copyright:
33
years: 2024
4-
lastupdated: "2024-12-9"
4+
lastupdated: "2024-12-11"
55
keywords:
66
subcollection: deployable-reference-architectures
77
authors:
@@ -15,7 +15,7 @@ image_source: https://github.com/terraform-ibm-modules/terraform-ibm-powervs-inf
1515
use-case: ITServiceManagement
1616
industry: Technology
1717
content-type: reference-architecture
18-
version: v8.0.2
18+
version: v8.0.3
1919
compliance: SAPCertified
2020

2121
---
@@ -28,7 +28,7 @@ compliance: SAPCertified
2828
{: toc-industry="Technology"}
2929
{: toc-use-case="ITServiceManagement"}
3030
{: toc-compliance="SAPCertified"}
31-
{: toc-version="8.0.2"}
31+
{: toc-version="8.0.3"}
3232

3333
The Power Virtual Server with VPC landing zone as variation 'Extend Power Virtual Server with VPC landing zone' creates an additional Power Virtual Server workspace and connects it with the already created Power Virtual Server with VPC landing zone. It builds on the existing Power Virtual Server with VPC landing zone deployed as a variation 'Create a new architecture'.
3434

reference-architectures/standard-plus-vsi/deploy-arch-ibm-pvs-inf-standard-plus-vsi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
copyright:
33
years: 2024
4-
lastupdated: "2024-12-9"
4+
lastupdated: "2024-12-11"
55
keywords:
66
subcollection: deployable-reference-architectures
77
authors:
@@ -15,7 +15,7 @@ image_source: https://github.com/terraform-ibm-modules/terraform-ibm-powervs-inf
1515
use-case: ITServiceManagement
1616
industry: Technology
1717
content-type: reference-architecture
18-
version: v8.0.2
18+
version: v8.0.3
1919
compliance:
2020

2121
---
@@ -28,7 +28,7 @@ compliance:
2828
{: toc-industry="Technology"}
2929
{: toc-use-case="ITServiceManagement"}
3030
{: toc-compliance=""}
31-
{: toc-version="8.0.2"}
31+
{: toc-version="8.0.3"}
3232

3333
Quickstart deployment of the Power Virtual Server with VPC landing zone creates VPC services, a Power Virtual Server workspace, and interconnects them. It also deploys a Power Virtual Server of chosen T-shirt size or custom configuration. Supported Os are Aix, IBM i, and Linux images.
3434

reference-architectures/standard/deploy-arch-ibm-pvs-inf-standard.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
copyright:
33
years: 2024
4-
lastupdated: "2024-12-9"
4+
lastupdated: "2024-12-11"
55
keywords:
66
subcollection: deployable-reference-architectures
77
authors:
@@ -15,7 +15,7 @@ image_source: https://github.com/terraform-ibm-modules/terraform-ibm-powervs-inf
1515
use-case: ITServiceManagement
1616
industry: Technology
1717
content-type: reference-architecture
18-
version: v8.0.2
18+
version: v8.0.3
1919
compliance: SAPCertified
2020

2121
---
@@ -28,7 +28,7 @@ compliance: SAPCertified
2828
{: toc-industry="Technology"}
2929
{: toc-use-case="ITServiceManagement"}
3030
{: toc-compliance="SAPCertified"}
31-
{: toc-version="8.0.2"}
31+
{: toc-version="8.0.3"}
3232

3333
The Standard deployment of the Power Virtual Server with VPC landing zone creates VPC services and a Power Virtual Server workspace and interconnects them.
3434

solutions/standard-plus-vsi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This example sets up the following infrastructure:
5454

5555
| Name | Source | Version |
5656
|------|--------|---------|
57-
| <a name="module_powervs_instance"></a> [powervs\_instance](#module\_powervs\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.1 |
57+
| <a name="module_powervs_instance"></a> [powervs\_instance](#module\_powervs\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.3 |
5858
| <a name="module_standard"></a> [standard](#module\_standard) | ../../modules/powervs-vpc-landing-zone | n/a |
5959

6060
### Resources

0 commit comments

Comments
 (0)