diff --git a/.github/workflows/centos7.yml b/.github/workflows/rocky8.yml similarity index 84% rename from .github/workflows/centos7.yml rename to .github/workflows/rocky8.yml index e5ad682a..6fa58f82 100644 --- a/.github/workflows/centos7.yml +++ b/.github/workflows/rocky8.yml @@ -1,5 +1,5 @@ --- -name: CentOS 7 +name: Rocky 8 on: pull_request: @@ -40,7 +40,7 @@ jobs: - name: Run ansible-lint. run: ansible-lint - centos7-test: + rocky8-test: name: Initial build test runs-on: ubuntu-latest needs: ['lint-test'] @@ -75,7 +75,7 @@ jobs: id: plan run: | cd testing/ - terraform plan -var "GITHUB_RUN_ID=$GITHUB_RUN_ID" -var "os=centos7" -no-color + terraform plan -var "GITHUB_RUN_ID=$GITHUB_RUN_ID" -var "os=rocky8" -no-color continue-on-error: true - name: Terraform Plan Status @@ -85,7 +85,7 @@ jobs: - name: Terraform Apply run: | cd testing/ - terraform apply -var "GITHUB_RUN_ID=$GITHUB_RUN_ID" -var "os=centos7" -auto-approve + terraform apply -var "GITHUB_RUN_ID=$GITHUB_RUN_ID" -var "os=rocky8" -auto-approve - name: Set up Python id: setup_python @@ -122,26 +122,26 @@ jobs: - name: Prep inventory run: | - cp -R inventory/sample inventory/centos7 - cp hosts.ini inventory/centos7/hosts.ini + cp -R inventory/sample inventory/rocky8 + cp hosts.ini inventory/rocky8/hosts.ini - name: Run playbook run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos -vv --private-key .key site.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos -vv --private-key .key site.yml - name: Run playbook again for idempotency run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos -vv --private-key .key site.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos -vv --private-key .key site.yml - name: Run Ansible Tests run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos --verbose --skip-tags "troubleshooting" --private-key .key testing.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos --verbose --skip-tags "troubleshooting" --private-key .key testing.yml - name: Run Python Tests run: | export DEFAULT_PRIVATE_KEY_FILE=.key - pytest --hosts=rke2_servers --ansible-inventory=inventory/centos7/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_server_tests.py - pytest --hosts=rke2_agents --ansible-inventory=inventory/centos7/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_agent_tests.py + pytest --hosts=rke2_servers --ansible-inventory=inventory/rocky8/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_server_tests.py + pytest --hosts=rke2_agents --ansible-inventory=inventory/rocky8/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_agent_tests.py - name: Create new inventory hosts.ini with added hosts run: | @@ -154,26 +154,26 @@ jobs: aws ec2 describe-instances --filters "Name=tag:Owner,Values=rke2-ansible-github-actions" "Name=tag:NodeType,Values=ExtraNode" "Name=tag:github_run,Values=$GITHUB_RUN_ID" --query "Reservations[*].Instances[*].PublicIpAddress" --output text >> hosts.ini echo "[all:vars]" >> hosts.ini echo "kubernetes_api_server_host=$(aws ec2 describe-instances --filters "Name=tag:Owner,Values=rke2-ansible-github-actions" "Name=tag:NodeType,Values=Server" "Name=tag:github_run,Values=$GITHUB_RUN_ID" --query "Reservations[*].Instances[*].PrivateIpAddress" --output text | head -1)" >> hosts.ini - cp hosts.ini inventory/centos7/hosts.ini + cp hosts.ini inventory/rocky8/hosts.ini - name: Run playbook again with added hosts run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos --verbose --private-key .key site.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos --verbose --private-key .key site.yml - name: Run Ansible Tests with added hosts run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos --verbose --skip-tags "troubleshooting" --private-key .key testing.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos --verbose --skip-tags "troubleshooting" --private-key .key testing.yml - name: Run Python Tests with added hosts run: | export DEFAULT_PRIVATE_KEY_FILE=.key - pytest --hosts=rke2_servers --ansible-inventory=inventory/centos7/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_server_tests.py - pytest --hosts=rke2_agents --ansible-inventory=inventory/centos7/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_agent_tests.py + pytest --hosts=rke2_servers --ansible-inventory=inventory/rocky8/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_server_tests.py + pytest --hosts=rke2_agents --ansible-inventory=inventory/rocky8/hosts.ini --force-ansible --connection=ansible --sudo testing/basic_agent_tests.py - name: Run troubleshoot tasks if: ${{ failure() }} run: | - ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/centos7/hosts.ini -u centos -vvv --tags "troubleshooting" --private-key .key testing.yml + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/rocky8/hosts.ini -u centos -vvv --tags "troubleshooting" --private-key .key testing.yml - name: Delete Stack if: ${{ always() }} diff --git a/testing/variables.tf b/testing/variables.tf index c37dc896..6975af0b 100644 --- a/testing/variables.tf +++ b/testing/variables.tf @@ -74,8 +74,8 @@ variable "amis" { user = "centos" } "rocky8" = { - ami = "ami-06370d1e5ddbf1f76" - user = "ec2-user" + ami = "ami-01c3e8e014e8b0c7a" + user = "centos" } } }