From 5ac1f53243901b294a707477812fc269a8137154 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 15:44:20 -0500 Subject: [PATCH 1/8] Moving puppet-lint to GitHub CI job --- .github/workflows/puppet.yaml | 19 +++++++++++++++++++ .gitlab-ci.yml | 18 +----------------- 2 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/puppet.yaml diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml new file mode 100644 index 0000000..1cad0ef --- /dev/null +++ b/.github/workflows/puppet.yaml @@ -0,0 +1,19 @@ +name: Puppet module +on: + push: + paths: + - .github/workflows/puppet.yaml + - puppet + +jobs: + puppet-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + - name: puppet-lint + uses: scottbrenner/puppet-lint-action@master + with: + args: puppet/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c9790be..74e304c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,7 +63,7 @@ stages: .prep-install-python: &prep-install-python | dnf install -y python3 python3-pip python3-wheel dnf clean all && rm -rf /var/cache/yum - pip3 install --upgrade pip pip-tools && ln -s pip3 /usr/bin/pip + pip3 install --upgrade pip pip-tools .prep-install-docker: &prep-install-docker | dnf remove -y docker \ @@ -277,22 +277,6 @@ transcoder_unit-test: coverage_format: cobertura path: transcoder/coverage.xml -puppet-lint: - stage: test - needs: [] - allow_failure: true - rules: - - if: $TRY_LATEST_PROMOTE != "true" - changes: - - ".gitlab-ci.yml" - - puppet/**/* - before_script: - - *prep-install-ca - - dnf module install -y ruby:2.7 - - gem install puppet-lint - script: - - puppet-lint puppet - # Pull in the latest commits from default submodule branches promote: stage: build From d45e089b524197e032232dbd88af2fb09f7dda55 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 15:47:11 -0500 Subject: [PATCH 2/8] Failing puppet-lint on warnings and fixing current warnings --- .github/workflows/puppet.yaml | 2 +- .../modules/apl_test/manifests/camserver.pp | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index 1cad0ef..afb7a0a 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -16,4 +16,4 @@ jobs: - name: puppet-lint uses: scottbrenner/puppet-lint-action@master with: - args: puppet/ + args: puppet/ --fail-on-warnings diff --git a/puppet/modules/apl_test/manifests/camserver.pp b/puppet/modules/apl_test/manifests/camserver.pp index 0b3779a..756f274 100644 --- a/puppet/modules/apl_test/manifests/camserver.pp +++ b/puppet/modules/apl_test/manifests/camserver.pp @@ -62,23 +62,23 @@ class { 'trusted_ca': } concat { '/ammos/etc/pki/tls/certs/ammos-ca-bundle.crt': - owner => 'root', - group => 'ammos-tls', - mode => '0444', + owner => 'root', + group => 'ammos-tls', + mode => '0444', require => Package[$cam_main_package], # for owner/group } file { '/ammos/etc/pki/tls/certs/ammos-server-cert.pem': - source => $tls_server_cert, - owner => 'cam-srv', - group => 'ammos-tls', - mode => '0444', + source => $tls_server_cert, + owner => 'cam-srv', + group => 'ammos-tls', + mode => '0444', require => Package[$cam_main_package], # for owner/group } file { '/ammos/etc/pki/tls/private/ammos-server-key.pem': - source => $tls_server_key, - owner => 'cam-srv', - group => 'ammos-tls', - mode => '0400', + source => $tls_server_key, + owner => 'cam-srv', + group => 'ammos-tls', + mode => '0400', require => Package[$cam_main_package], # for owner/group } openssl::export::pkcs12 { 'ammos-server-keystore': @@ -121,9 +121,9 @@ } } file { '/ammos/etc/pki/tls/certs/ammos-truststore.jks': - owner => 'cam-srv', - group => 'ammos-tls', - mode => '0444', + owner => 'cam-srv', + group => 'ammos-tls', + mode => '0444', } file { '/ammos/cam-server/server': From f0bb85c28c40e78aacfea33eb9bf8cf4919d68d1 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:08:05 -0500 Subject: [PATCH 3/8] Adding job to prep puppet modules --- .github/workflows/puppet.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index afb7a0a..e952726 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -6,6 +6,28 @@ on: - puppet jobs: + prep: + name: Download modules + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + - name: Install dependencies + run: | + sudo apt-get update + wget https://apt.puppet.com/puppet-release-focal.deb + sudo dpkg -i puppet-tools-release-focal.deb + wget https://apt.puppet.com/puppet-tools-release-focal.deb + sudo dpkg -i puppet-tools-release-focal.deb + sudo apt-get install -y puppet-agent-7.28.0-1.el9 puppet-bolt + sudo update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10 + sudo chmod +t /tmp # workaround ruby need within prep.sh + - name: Prep project + run: | + ./puppet/prep.sh + puppet-lint: runs-on: ubuntu-latest steps: From ecc9ca4f10a6edbffca83654a15d9bd94279a050 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:09:21 -0500 Subject: [PATCH 4/8] Fixing indent --- .github/workflows/puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index e952726..bb669dc 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -16,7 +16,7 @@ jobs: submodules: false - name: Install dependencies run: | - sudo apt-get update + sudo apt-get update wget https://apt.puppet.com/puppet-release-focal.deb sudo dpkg -i puppet-tools-release-focal.deb wget https://apt.puppet.com/puppet-tools-release-focal.deb From 23e336b228b86d64bb071983495b9fe1334f75a8 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:18:19 -0500 Subject: [PATCH 5/8] Fixing puppet repo install --- .github/workflows/puppet.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index bb669dc..3273cb7 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -18,9 +18,9 @@ jobs: run: | sudo apt-get update wget https://apt.puppet.com/puppet-release-focal.deb - sudo dpkg -i puppet-tools-release-focal.deb + sudo dpkg -i $PWD/puppet-tools-release-focal.deb wget https://apt.puppet.com/puppet-tools-release-focal.deb - sudo dpkg -i puppet-tools-release-focal.deb + sudo dpkg -i $PWD/puppet-tools-release-focal.deb sudo apt-get install -y puppet-agent-7.28.0-1.el9 puppet-bolt sudo update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10 sudo chmod +t /tmp # workaround ruby need within prep.sh From 7458863a72796495d9c59861c5d08b2678d51b6e Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:19:59 -0500 Subject: [PATCH 6/8] Fixing puppet repo name --- .github/workflows/puppet.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index 3273cb7..cada6a0 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -18,9 +18,9 @@ jobs: run: | sudo apt-get update wget https://apt.puppet.com/puppet-release-focal.deb - sudo dpkg -i $PWD/puppet-tools-release-focal.deb + sudo dpkg -i puppet-release-focal.deb wget https://apt.puppet.com/puppet-tools-release-focal.deb - sudo dpkg -i $PWD/puppet-tools-release-focal.deb + sudo dpkg -i puppet-tools-release-focal.deb sudo apt-get install -y puppet-agent-7.28.0-1.el9 puppet-bolt sudo update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10 sudo chmod +t /tmp # workaround ruby need within prep.sh From 0edce372abf909dcf13fa1760ae6dbbadb6d278a Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:21:35 -0500 Subject: [PATCH 7/8] Fixing apt run order --- .github/workflows/puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index cada6a0..82ea05f 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -16,11 +16,11 @@ jobs: submodules: false - name: Install dependencies run: | - sudo apt-get update wget https://apt.puppet.com/puppet-release-focal.deb sudo dpkg -i puppet-release-focal.deb wget https://apt.puppet.com/puppet-tools-release-focal.deb sudo dpkg -i puppet-tools-release-focal.deb + sudo apt-get update sudo apt-get install -y puppet-agent-7.28.0-1.el9 puppet-bolt sudo update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10 sudo chmod +t /tmp # workaround ruby need within prep.sh From a9368f004b1cec96c35990d20b0e9eaf432489ad Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Tue, 6 Feb 2024 19:24:02 -0500 Subject: [PATCH 8/8] Removing puppet version pin --- .github/workflows/puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/puppet.yaml b/.github/workflows/puppet.yaml index 82ea05f..fffa437 100644 --- a/.github/workflows/puppet.yaml +++ b/.github/workflows/puppet.yaml @@ -21,7 +21,7 @@ jobs: wget https://apt.puppet.com/puppet-tools-release-focal.deb sudo dpkg -i puppet-tools-release-focal.deb sudo apt-get update - sudo apt-get install -y puppet-agent-7.28.0-1.el9 puppet-bolt + sudo apt-get install -y puppet-agent puppet-bolt sudo update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10 sudo chmod +t /tmp # workaround ruby need within prep.sh - name: Prep project