Add test stage to pipeline

Next copy the following block at the end to define the testing stage:

test_code:
  stage: test
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'
      when: always
  image: ${CI_REGISTRY}/${CI_PROJECT_PATH}/ansible:latest
  tags:
    - ansible_f5
  script:
    - ansible --version
  allow_failure: false

Commit the changes and browse back to the CI/CD pipeline and view the info and test stages after the container build completes. In the info stage select the get_info job to view the output from the env command. This shows all the different variables that Gitlab makes available to the CI/CD process by default. Many are used during this build configuration to make it modular and re-usable.