{"id":49783165,"url":"https://github.com/bcgov/nr-polaris-collection","last_synced_at":"2026-05-11T23:01:37.583Z","repository":{"id":207856474,"uuid":"720258692","full_name":"bcgov/nr-polaris-collection","owner":"bcgov","description":"Ansible collection for Polaris Jenkins pipeline","archived":false,"fork":false,"pushed_at":"2026-04-19T10:53:52.000Z","size":243,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-19T12:31:09.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcgov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-18T00:06:05.000Z","updated_at":"2026-04-10T20:24:51.000Z","dependencies_parsed_at":"2024-02-09T06:32:40.012Z","dependency_job_id":"621d9790-93d9-47b7-b7c0-78b2528d297b","html_url":"https://github.com/bcgov/nr-polaris-collection","commit_stats":null,"previous_names":["bcgov/nr_polaris_collection"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/bcgov/nr-polaris-collection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fnr-polaris-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fnr-polaris-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fnr-polaris-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fnr-polaris-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcgov","download_url":"https://codeload.github.com/bcgov/nr-polaris-collection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fnr-polaris-collection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32916333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"ssl_error","status_checked_at":"2026-05-11T17:08:45.420Z","response_time":120,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-11T23:01:36.717Z","updated_at":"2026-05-11T23:01:37.566Z","avatar_url":"https://github.com/bcgov.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NR Polaris Ansible Collection\n\nAnsible collection for deploying applications using [Polaris Pipelines](https://github.com/bcgov-nr/polaris-pipelines).\n\nThis collection provides roles for the deployment and configuration of application services on NRIDS servers.\n\n## Requirements\n\nThis collection requires Ansible 2.12 or higher.\n\nThis collection was designed for Red Hat Enterprise Linux 9.\n\n## Roles\n\n- [common](polaris/deploy/roles/common/README.md) - Defines variables used by the rest of the collection\n- [create_project_directories](polaris/deploy/roles/create_project_directories/README.md) - Creates the directory structure for a service\n- [envconsul](polaris/deploy/roles/envconsul/README.md) - Installs envconsul\n- [java_app](polaris/deploy/roles/java_app/README.md) - Installs a Java application (Spring Boot)\n- [jdk](polaris/deploy/roles/jdk/README.md) - Installs and configures Adoptium OpenJDK\n- [nodejs](polaris/deploy/roles/nodejs/README.md) - Installs and configures Node.js\n- [nodejs_app](polaris/deploy/roles/nodejs_app/README.md) - Installs a Node.js application\n- [patch_intention](polaris/deploy/roles/patch_intention/README.md) - Sends a patch request to NR Broker to update the catalog\n- [port_manager](polaris/deploy/roles/port_manager/README.md) - Automates the assignment and management of service ports\n- [self_signed_cert](polaris/deploy/roles/self_signed_cert/README.md) - Creates a self-signed certificate for the service\n- [service_control](polaris/deploy/roles/service_control/README.md) - Automates starting, stopping, and restarting installed services\n- [tomcat](polaris/deploy/roles/tomcat/README.md) - Automates the installation and configuration of Apache Tomcat\n- [webade_connection_jar](polaris/deploy/roles/webade_connection_jar/README.md) - Creates and installs a WebADE connection JAR file\n- [webapp](polaris/deploy/roles/webapp/README.md) - Configures and deploys a WAR file to Tomcat\n\n## Plugins\n\nThe collection uses no external plugins. There is an internal [s6 module](polaris/deploy/plugins/modules/s6_service.py) that the [service_control](polaris/deploy/roles/service_control/README.md) role may use.\n\n## Quick Start\n\nStart by reviewing [common](polaris/deploy/roles/common/README.md), as every role includes it. It defines many of the [defaults](polaris/deploy/roles/common/defaults/main.yml) that other roles use. If you want a value to be picked up globally, define one of the values from this role. If you want a value to be used only by a single role, define the role-specific variable.\n\nNext, [create_project_directories](polaris/deploy/roles/create_project_directories/README.md) is used to create the directory structure for a service. Other roles require that this role be called first.\n\nAfter this, playbooks call various roles to add binaries, application files, and configure the application as required.\n\n### Quick Start - Vars\n\nAll global variables defined in the [common](polaris/deploy/roles/common/README.md) role are prefixed with `polaris_`. The collection's roles other than common generally prefix their variables with the name of the role. Roles will use the global \"polaris\" variables to derive their own variables. So, a developer can override the global variable to change a value across many roles.\n\nDevelopers should prefix their own variables with their service or project name and treat the role names (and polaris) as reserved prefixes for the collection. Example: An developer should not define `webapp_app_tmp_dir` because `webapp` is used by the `webapp` role as its prefix.\n\nThe general advice is that developers should:\n\n* Not define collection role variables unless required to\n* Use polaris global variables to derive their own variables\n\n## Related Products\n\n* [NR Broker](https://github.com/bcgov/nr-broker)\n* [NR Repository Composer](https://github.com/bcgov/nr-repository-composer)\n* [Polaris Pipelines](https://github.com/bcgov-nr/polaris-pipelines)\n\n# NR Polaris Ansible Collection Development\n\nDeveloping the roles requires having a machine available to target with Ansible. It is highly recommended to use Vagrant to create a local virtual machine using the provided Vagrantfile. The local VM can be provisioned from scratch in a couple of minutes.\n\nIn addition, application developers can use the Vagrant VM to test their playbooks. Most deployment issues can be resolved this way without needing to deploy to real servers.\n\n## Required\n\n* [Vagrant](https://developer.hashicorp.com/vagrant)\n* [VirtualBox](https://www.virtualbox.org) (on macOS)\n\n## Why no container?\n\nWe do not provide a container image for use with Podman or Docker because applications are installed into a stateful server. Containers are set up to run a single executable with no system services (like SSH) available. They also have a simplified file system security model.\n\nIn the end, we want to mimic the server and not simply run the application. The VM created by Vagrant operates like a server in ways a container cannot replicate.\n\n## Running the development box\n\nThis will set up the development virtual machine. It will take some time to download the image and complete the setup.\n\n```\nvagrant up\n```\n\nThis setups the vagrant user to be able to use systemd and sets the following env:\n\n```\nANSIBLE_LIBRARY=/home/vagrant/polaris/deploy/plugins\n```\n\nYou now have a running provisioned vm that you can connect to using `vagrant ssh`.\n\n## Upload collection to the development box\n\nPrecondition: Running provisioned vm\n\nThis first step in all of the following examples is to upload the polaris collection to the vagrant vm.\n\n```\nvagrant ssh -c 'rm -r polaris'\nvagrant upload -c polaris\n```\n\nBy default, the `upload` command merges the files in the path. It is recommended that you clear out the polaris folder and start from scratch whenever you want to upload a new playbook as the existing files in `polaris/deploy` may conflict.\n\n### Use test playbooks\n\nPrecondition: Upload collection\n\nThis will upload the test playbooks to the vm.\n\n```\nvagrant upload test polaris/deploy\n```\n\nNext, connect to the virtual machine and run the test playbooks. You can then check the state of the virtual machine, re-upload files, and re-run as needed. Some examples using the test playbooks are shown next.\n\n#### Test playbooks - Install nodejs\n\nPrecondition: Upload collection and test playbooks\n\n```\nvagrant ssh\ncd ~/polaris/deploy\nansible-playbook nodejs.yml\n/apps_ux/sample/service/artifact/bin/nodejs/bin/node -v\n# curl app -- port may be different if multiple apps installed\ncurl localhost:8080\n```\n#### Test playbooks - control app\n\nPrecondition: Upload collection, test playbooks and install app (example assumes test playbook's nodejs)\n\nThis shows how to stop an application.\n\n```\nvagrant ssh\ncd ~/polaris/deploy\n# Test service control stop (Change action/var as needed)\nansible-playbook -e service_control_var=nodejs \\\n  -e service_control_action=stop \\\n  servicectrl.yml\n# curl app -- port may be different if multiple apps installed (fail expected)\ncurl localhost:8080\n```\n\nIf you change the `service_control_action` to `start` then the app should come back.\n\n## Copy app playbook and install - NodeJs\n\nPrecondition: Copy collection\n\n```\nvagrant upload \u003capplication root\u003e/playbooks polaris/deploy\nvagrant upload overlay_nodejs polaris/deploy\nvagrant ssh\nmkdir -p polaris/app\ncd polaris/app\noras pull ghcr.io/bcgov/nr-nodejs-sample/package:v3.2.0\ncd ../deploy\nansible-playbook -e env_vars=vagrant playbook.yaml\n```\n\n## Copy app playbook and install - Java\n\nPrecondition: Copy collection\n\n```\nvagrant upload \u003capplication root\u003e/playbooks polaris/deploy\nvagrant upload overlay_java polaris/deploy\nvagrant ssh\nmkdir -p /ansible/downloads\ncd /ansible/downloads\nsudo curl -L -H \"Authorization: token ${GH_TOKEN}\" \\\n  https://maven.pkg.github.com/bcgov/java-maven-pipeline-example/bcgov/example/java-maven-pipeline-example/1.0.1-main-SNAPSHOT/java-maven-pipeline-example-1.0.1-main-20250818.180118-27.war \\\n  -o java-maven-pipeline-example.war\ncd ~/polaris/deploy\nansible-playbook -e env_vars=vagrant playbook.yaml\n```\n\n# License\n\nSee: [LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgov%2Fnr-polaris-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcgov%2Fnr-polaris-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgov%2Fnr-polaris-collection/lists"}