GithubHelp home page GithubHelp logo

ansible-role-set_and_check_ci_facts's Introduction

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)
If the variable could not be set and is not in set_and_check_ci_facts_non_required_vars, ansible.builtin.failed is used to fail.
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
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
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)

ansible-role-set_and_check_ci_facts's People

Contributors

l-with avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.