Terraform setup fails when using CentOS Stream 9
When running through the terraform setup with a CentOS Stream 9 ami, I got the following error:
module.config_files.null_resource.upload_config_files: Creation complete after 2s [id=5009114764454071897]
module.configure_nodes.null_resource.configure_manager_node: Creating...
module.configure_nodes.null_resource.configure_manager_node: Provisioning with 'remote-exec'...
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Connecting to remote host via SSH...
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Host: 34.207.226.201
module.configure_nodes.null_resource.configure_manager_node (remote-exec): User: hadoop
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Password: false
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Private key: false
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Certificate: false
module.configure_nodes.null_resource.configure_manager_node (remote-exec): SSH Agent: true
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Checking Host Key: false
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Target Platform: unix
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Connected!
module.configure_nodes.null_resource.configure_manager_node (remote-exec): Check genders file validity...
module.configure_nodes.null_resource.configure_manager_node (remote-exec): /usr/local/bin/update-hosts-genders.sh: line 57: nodeattr: command not found
╷
│ Error: remote-exec provisioner error
│
│ with module.configure_nodes.null_resource.configure_manager_node,
│ on ../modules/configure-nodes/main.tf line 36, in resource "null_resource" "configure_manager_node":
│ 36: provisioner "remote-exec" {
│
│ error executing "/tmp/terraform_985881320.sh": Process exited with status 127
This blocked the setup. After switching to a CentOS 7 ami, I was able to complete setup. I am not certain that this is caused by the OS but that was the only factor I changed between runs.
Looking at that section, two things stand out:
- That section uses pdcp, from the pdsh command.
pdshneeds to be installed first, and I doubt it is installed by default. - The error says it can't find
nodeattr, which is provided by thegenderspackage, which also needs to be installed and is not installed by default.
The packages are installed as part of cloud-init here and then pdsh-mod-genders is installed here. There should be a cloud-init log file on the host and that should have more information. My guess is that the problem is the pdsh RPMs are not in the epel-release repo for CentOS 9.
RHEL9 was based on Fedora 34, so you can probably download them from the F34 repos.