Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/l-with/ansible-role-set_and_check_ci_facts
https://github.com/l-with/ansible-role-set_and_check_ci_facts
ansible ansible-role environment-variables terraform-state
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/l-with/ansible-role-set_and_check_ci_facts
- Owner: l-with
- License: other
- Created: 2022-02-12T21:37:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-29T04:21:11.000Z (8 months ago)
- Last Synced: 2024-12-15T22:45:25.095Z (about 2 months ago)
- Topics: ansible, ansible-role, environment-variables, terraform-state
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Role set and check CI facts
sets and checks facts from environment variables or from terraform state on control host
## Dependencies
The role depends on terraform and a backend configuration for terraform including the credentials (possibly set by environment variables) in the folder the playbook is executed (not the folder of the playbook).
The role uses `community.general.json_query`.
## Role Variables
| group | variable | default | description |
| --- | --- | ---| --- |
| facts | set_and_check_ci_facts_required_vars | `[]` |the list of variables to get from environment or terraform state
The variables are looked up from
- the environment variables with the same name as in the list, but in upper cases (if `set_and_check_facts_from_terraform_state` is `false`)
- the outputs of the terraform state with the same name as in the list (if `set_and_check_facts_from_terraform_state`)
| facts | set_and_check_ci_facts_non_required_vars | `[]` | the list of variables not to check if set or not |
| facts | set_and_check_ci_facts_required_env_vars | `[]` |
the list of variables to get from environment
The variables are looked up from the environment variables with the same name as in the list, but in upper cases. || facts | set_and_check_ci_facts_non_required_env_vars | `[]` | the list of variables not to check if set or not (subset of `set_and_check_ci_facts_required_env_vars`) |
| facts | set_and_check_ci_facts_required_tf_vars | `[]` |
the list of environment variables `TF_VAR_*` to get from the environment
The ansible variables are named without prefix `TF_VAR_` and assumed to be named with exact case. || facts | set_and_check_ci_facts_non_required_tf_vars | `[]` | the list of variables `TF_VAR_*` not to check if set or not (subset of `set_and_check_ci_facts_required_tf_vars`) |
| control | set_and_check_ci_facts_from_terraform_state | `false` | if the facts in `set_and_check_ci_facts_required_vars` should be read from terraform state instead from environment |
| control | set_and_check_ci_facts_terraform_command | `'terraform'` |
the terraform cmd
This can be used for GitLab ci to set to `gitlab-terraform` or for specifying a terraform command by full path. || control | `set_and_check_ci_facts_terraform_dir` | `'.'` | the director to `chdir` before executing `set_and_check_ci_facts_terraform_command` |
| debug | `set_and_check_ci_facts_print_terraform_state` | `false` | if the terraform state should be printed (only output values) |