newrelic / ansible-install

Building installation support for our customers are using ansible to manage their infrastructure and services at scale
Apache License 2.0
8 stars 6 forks source link

Enable environment variable override in playbook #15

Closed rthorn-nr closed 1 year ago

rthorn-nr commented 1 year ago

Enables overriding the terminal environment using the environment field at the play or role level.

Behavior

Uses environment variables:

- name: Install New Relic infrastructure & logs
  hosts: all
  roles:
    - role: newrelic.newrelic_install

Uses play-level environment "FOO":

- name: Install New Relic infrastructure & logs
  hosts: all
  roles:
    - role: newrelic.newrelic_install
  environment:
    NEW_RELIC_ACCOUNT_ID: FOO
    NEW_RELIC_API_KEY: FOO
    NEW_RELIC_REGION: FOO

Uses role-level environment "BAR":

- name: Install New Relic infrastructure & logs
  hosts: all
  roles:
    - role: newrelic.newrelic_install
      environment:
        NEW_RELIC_ACCOUNT_ID: BAR
        NEW_RELIC_API_KEY: BAR
        NEW_RELIC_REGION: BAR
  environment:
    NEW_RELIC_ACCOUNT_ID: FOO
    NEW_RELIC_API_KEY: FOO
    NEW_RELIC_REGION: FOO
rthorn-nr commented 1 year ago

Uses FQCN -- will change over if we merge https://github.com/newrelic/ansible-install/pull/13

rthorn-nr commented 1 year ago

Closing due to env var changes from https://github.com/newrelic/ansible-install/pull/17