Learn-terraform-github-actions repo not accessible

Hi there :wave:

Not sure if this is the right forum, but in this HashiCorp Learn tutorial for using Terraform in GitHub Actions, the GitHub repo learn-terraform-github-actions is linked to as an example and the instructions say to fork the repo.

However, the repo is not accessible to me (it 404s). The screenshots in the guide show what looks like a private GitHub repo, so it’s possible that it just needs to be made public. Or am I missing something?

1 Like

It should be public now, thanks for the catch!

1 Like

This issue still persists.

Hi @grimmaldus, the repo should be public. Can you access this link: https://github.com/hashicorp/learn-terraform-github-actions?

Hello @im2nguyen thank you for your reply. The link works but it doesn’t fix this issue. The main problem of confusion is prolly topic heading, it’s a bit confusing.

The real issue is base url in https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
which is mentioned in https://learn.hashicorp.com/tutorials/terraform/install-cli under CentOS/RHEL tab. This base url is wrong and it throws 404.

Hi @grimmaldus, I’m not sure what issue you’re having. I just spun up a new CentOS 7 box and ran the commands on the Install Terraform page and it worked (see attached).

The GH Action should be using the setup-terraform workflow and doesn’t rely on the CentOS binary. The setup-terraform action includes snippets that expose the stdout/stderr of the plan and apply steps.

This topic was initially created because the GitHub Actions repo was private. That’s been resolved. If you’re experiencing a different issue, can you open up a new topic and provide steps to reproduce the error you’re receiving?

If it’s a problem with the “Learn Terraform GitHub Action” Learn guide, please open an issue or a PR in the associated Github repo.

Hope this helps and have a great day!

$ ssh terraform@$(echo "aws_instance.web.public_ip" | terraform console) -i ../tf-packer
The authenticity of host '3.223.141.57 (3.223.141.57)' can't be established.
ECDSA key fingerprint is SHA256:8KmxKzpxIHqejSNvDsjsB8Y317Ta80TEzWGTFmVYvug.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '3.223.141.57' (ECDSA) to the list of known hosts.
[terraform@ip-10-1-0-210 ~]$ sudo yum install -y yum-utils
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
base                                                                                                                                                                           | 3.6 kB  00:00:00     
extras                                                                                                                                                                         | 2.9 kB  00:00:00     
updates                                                                                                                                                                        | 2.9 kB  00:00:00     
(1/4): base/7/x86_64/group_gz                                                                                                                                                  | 153 kB  00:00:00     
(2/4): extras/7/x86_64/primary_db                                                                                                                                              | 206 kB  00:00:00     
(3/4): updates/7/x86_64/primary_db                                                                                                                                             | 4.5 MB  00:00:00     
(4/4): base/7/x86_64/primary_db                                                                                                                                                | 6.1 MB  00:00:01     
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================================
 Package                                        Arch                                        Version                                                Repository                                    Size
======================================================================================================================================================================================================
Updating:
 yum-utils                                      noarch                                      1.1.31-54.el7_8                                        updates                                      122 k

Transaction Summary
======================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 122 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/updates/packages/yum-utils-1.1.31-54.el7_8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for yum-utils-1.1.31-54.el7_8.noarch.rpm is not installed
yum-utils-1.1.31-54.el7_8.noarch.rpm                                                                                                                                           | 122 kB  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-7.1908.0.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : yum-utils-1.1.31-54.el7_8.noarch                                                                                                                                                   1/2 
  Cleanup    : yum-utils-1.1.31-52.el7.noarch                                                                                                                                                     2/2 
  Verifying  : yum-utils-1.1.31-54.el7_8.noarch                                                                                                                                                   1/2 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                                                                                                                                                     2/2 

Updated:
  yum-utils.noarch 0:1.1.31-54.el7_8                                                                                                                                                                  

Complete!
[terraform@ip-10-1-0-210 ~]$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Loaded plugins: fastestmirror
adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
grabbing file https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo to /etc/yum.repos.d/hashicorp.repo
repo saved to /etc/yum.repos.d/hashicorp.repo
[terraform@ip-10-1-0-210 ~]$ sudo yum -y install terraform
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
hashicorp                                                                                                                                                                      | 1.4 kB  00:00:00     
hashicorp/7/x86_64/primary                                                                                                                                                     |  22 kB  00:00:00     
hashicorp                                                                                                                                                                                     146/146
Resolving Dependencies
--> Running transaction check
---> Package terraform.x86_64 0:0.13.4-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================================
 Package                                         Arch                                         Version                                           Repository                                       Size
======================================================================================================================================================================================================
Installing:
 terraform                                       x86_64                                       0.13.4-1                                          hashicorp                                        27 M

Transaction Summary
======================================================================================================================================================================================================
Install  1 Package

Total download size: 27 M
Installed size: 82 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/hashicorp/packages/terraform-0.13.4-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3219f7b: NOKEY====================-      ]  0.0 B/s |  25 MB  --:--:-- ETA 
Public key for terraform-0.13.4-1.x86_64.rpm is not installed
terraform-0.13.4-1.x86_64.rpm                                                                                                                                                  |  27 MB  00:00:01     
Retrieving key from https://rpm.releases.hashicorp.com/gpg
Importing GPG key 0xA3219F7B:
 Userid     : "HashiCorp Security (HashiCorp Package Signing) <security+packaging@hashicorp.com>"
 Fingerprint: e8a0 32e0 94d8 eb4e a189 d270 da41 8c88 a321 9f7b
 From       : https://rpm.releases.hashicorp.com/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : terraform-0.13.4-1.x86_64                                                                                                                                                          1/1 
  Verifying  : terraform-0.13.4-1.x86_64                                                                                                                                                          1/1 

Installed:
  terraform.x86_64 0:0.13.4-1                                                                                                                                                                         

Complete!

HI @im2nguyen Yes I know that’s why this discussion is not in right topic, but for sake of completeness I also spun fresh Red Hat Enterprise Linux 8.2 (LVM) and CentOS-based 8.2 on Azure and followed the same steps. The only change is that I’m not used yum plugins like fastestmirror like you do.

And these are results
(rhel 8.2):

Activate the web console with: systemctl enable --now cockpit.socket

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register

[azureuser@rhel8 ~]$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.2 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.2"
[azureuser@rhel8 ~]$ sudo yum install -y yum-utils
Red Hat Enterprise Linux 8 for x86_64 - AppStream - Extended Update Support from RHUI (RPMs)                                                                                                                  42 MB/s |  19 MB     00:00
Microsoft Azure RPMs for RHEL8 Extended Update Support                                                                                                                                                        17 kB/s | 1.5 kB     00:00
Package yum-utils-4.0.12-3.el8.noarch is already installed.
Dependencies resolved.
=============================================================================================================================================================================================================================================
 Package                                                      Architecture                               Version                                            Repository                                                                  Size
=============================================================================================================================================================================================================================================
Upgrading:
 dnf-plugins-core                                             noarch                                     4.0.12-4.el8_2                                     rhel-8-for-x86_64-baseos-eus-rhui-rpms                                      64 k
 python3-dnf-plugins-core                                     noarch                                     4.0.12-4.el8_2                                     rhel-8-for-x86_64-baseos-eus-rhui-rpms                                     204 k
 yum-utils                                                    noarch                                     4.0.12-4.el8_2                                     rhel-8-for-x86_64-baseos-eus-rhui-rpms                                      66 k

Transaction Summary
=============================================================================================================================================================================================================================================
Upgrade  3 Packages

Total download size: 334 k
Downloading Packages:
(1/3): dnf-plugins-core-4.0.12-4.el8_2.noarch.rpm                                                                                                                                                            533 kB/s |  64 kB     00:00
(2/3): yum-utils-4.0.12-4.el8_2.noarch.rpm                                                                                                                                                                   517 kB/s |  66 kB     00:00
(3/3): python3-dnf-plugins-core-4.0.12-4.el8_2.noarch.rpm                                                                                                                                                    1.4 MB/s | 204 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        2.2 MB/s | 334 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                     1/1
  Upgrading        : python3-dnf-plugins-core-4.0.12-4.el8_2.noarch                                                                                                                                                                      1/6
  Upgrading        : dnf-plugins-core-4.0.12-4.el8_2.noarch                                                                                                                                                                              2/6
  Upgrading        : yum-utils-4.0.12-4.el8_2.noarch                                                                                                                                                                                     3/6
  Cleanup          : yum-utils-4.0.12-3.el8.noarch                                                                                                                                                                                       4/6
  Cleanup          : dnf-plugins-core-4.0.12-3.el8.noarch                                                                                                                                                                                5/6
  Cleanup          : python3-dnf-plugins-core-4.0.12-3.el8.noarch                                                                                                                                                                        6/6
  Running scriptlet: python3-dnf-plugins-core-4.0.12-3.el8.noarch                                                                                                                                                                        6/6
  Verifying        : python3-dnf-plugins-core-4.0.12-4.el8_2.noarch                                                                                                                                                                      1/6
  Verifying        : python3-dnf-plugins-core-4.0.12-3.el8.noarch                                                                                                                                                                        2/6
  Verifying        : yum-utils-4.0.12-4.el8_2.noarch                                                                                                                                                                                     3/6
  Verifying        : yum-utils-4.0.12-3.el8.noarch                                                                                                                                                                                       4/6
  Verifying        : dnf-plugins-core-4.0.12-4.el8_2.noarch                                                                                                                                                                              5/6
  Verifying        : dnf-plugins-core-4.0.12-3.el8.noarch                                                                                                                                                                                6/6
Installed products updated.

Upgraded:
  dnf-plugins-core-4.0.12-4.el8_2.noarch                                        python3-dnf-plugins-core-4.0.12-4.el8_2.noarch                                        yum-utils-4.0.12-4.el8_2.noarch

Complete!
[azureuser@rhel8 ~]$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
[azureuser@rhel8 ~]$ sudo yum -y install terraform
Hashicorp Stable - x86_64                                                                                                                                                                                    6.7 kB/s | 377  B     00:00
Errors during downloading metadata for repository 'hashicorp':
  - Status code: 404 for https://rpm.releases.hashicorp.com/RHEL/8.2/x86_64/stable/repodata/repomd.xml (IP: 151.101.250.49)
Error: Failed to download metadata for repo 'hashicorp': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

(CentOS):

Activate the web console with: systemctl enable --now cockpit.socket

[azureuser@centos8 ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
[azureuser@centos8 ~]$ sudo yum install -y yum-utils
Last metadata expiration check: 0:02:24 ago on Mon 19 Oct 2020 10:56:54 PM UTC.
Package yum-utils-4.0.12-3.el8.noarch is already installed.
^CDependencies resolved.
================================================================================
 Package                      Arch       Version               Repository  Size
================================================================================
Upgrading:
 dnf-plugins-core             noarch     4.0.12-4.el8_2        BaseOS      64 k
 python3-dnf-plugins-core     noarch     4.0.12-4.el8_2        BaseOS     204 k
 yum-utils                    noarch     4.0.12-4.el8_2        BaseOS      66 k

Transaction Summary
================================================================================
Upgrade  3 Packages

Total download size: 334 k
Downloading Packages:
(1/3): dnf-plugins-core-4.0.12-4.el8_2.noarch.r 1.8 MB/s |  64 kB     00:00
(2/3): yum-utils-4.0.12-4.el8_2.noarch.rpm      1.9 MB/s |  66 kB     00:00
(3/3): python3-dnf-plugins-core-4.0.12-4.el8_2. 5.3 MB/s | 204 kB     00:00
--------------------------------------------------------------------------------
Total                                           8.2 MB/s | 334 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Upgrading        : python3-dnf-plugins-core-4.0.12-4.el8_2.noarch         1/6
  Upgrading        : dnf-plugins-core-4.0.12-4.el8_2.noarch                 2/6
  Upgrading        : yum-utils-4.0.12-4.el8_2.noarch                        3/6
  Cleanup          : yum-utils-4.0.12-3.el8.noarch                          4/6
  Cleanup          : dnf-plugins-core-4.0.12-3.el8.noarch                   5/6
  Cleanup          : python3-dnf-plugins-core-4.0.12-3.el8.noarch           6/6
  Running scriptlet: python3-dnf-plugins-core-4.0.12-3.el8.noarch           6/6
[azureuser@centos8 ~]$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
[azureuser@centos8 ~]$ sudo yum -y install terraform
Hashicorp Stable - x86_64                       1.6 MB/s | 233 kB     00:00
Dependencies resolved.
================================================================================
 Package            Architecture    Version            Repository          Size
================================================================================
Installing:
 terraform          x86_64          0.13.4-1           hashicorp           27 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 27 M
Installed size: 82 M
Downloading Packages:
terraform-0.13.4-1.x86_64.rpm                    25 MB/s |  27 MB     00:01
--------------------------------------------------------------------------------
Total                                            25 MB/s |  27 MB     00:01
warning: /var/cache/dnf/hashicorp-164999f2fbadbd87/packages/terraform-0.13.4-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3219f7b: NOKEY
Hashicorp Stable - x86_64                        76 kB/s | 3.1 kB     00:00
Importing GPG key 0xA3219F7B:
 Userid     : "HashiCorp Security (HashiCorp Package Signing) <security+packaging@hashicorp.com>"
 Fingerprint: E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B
 From       : https://rpm.releases.hashicorp.com/gpg
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : terraform-0.13.4-1.x86_64                              1/1
  Verifying        : terraform-0.13.4-1.x86_64                              1/1

Installed:
  terraform-0.13.4-1.x86_64

Complete!

As you can see it doesn’t work on rhel 8.2 for some reason. To be honest I don’t know where is the catch.

Hi @grimmaldus, thanks for clarifying and including steps to reproduce this. We’re looking into it :slight_smile: