use ANSIBLE_ prefix on all ansible-defined env vars (#54272)

mark old version deprecated in all places referenced via docs
This commit is contained in:
James Cassell 2019-03-26 17:43:48 -04:00 committed by Brian Coca
parent 53b56825cd
commit 51f2065df5
5 changed files with 57 additions and 9 deletions

View file

@ -0,0 +1,20 @@
---
minor_changes:
- |
All environment variables defined by ansible now start with the `ANSIBLE_`
prefix. The old environment vars still work for now.
The new environment vars added are:
- ANSIBLE_LIBVIRT_LXC_NOSECLABEL
- ANSIBLE_DISPLAY_SKIPPED_HOSTS
- ANSIBLE_NETWORK_GROUP_MODULES
deprecated_features:
- |
Ansible-defined environment variables not starting with `ANSIBLE_` have been
deprecated. New names match the old name plus the `ANSIBLE_` prefix.
These environment variables have been deprecated:
- LIBVIRT_LXC_NOSECLABEL
- DISPLAY_SKIPPED_HOSTS
- NETWORK_GROUP_MODULES

View file

@ -762,7 +762,13 @@ DEFAULT_LIBVIRT_LXC_NOSECLABEL:
description:
- "This setting causes libvirt to connect to lxc containers by passing --noseclabel to virsh.
This is necessary when running on systems which do not have SELinux."
env: [{name: LIBVIRT_LXC_NOSECLABEL}]
env:
- name: LIBVIRT_LXC_NOSECLABEL
deprecated:
why: environment variables without "ANSIBLE_" prefix are deprecated
version: "2.12"
alternatives: the "ANSIBLE_LIBVIRT_LXC_NOSECLABEL" environment variable
- name: ANSIBLE_LIBVIRT_LXC_NOSECLABEL
ini:
- {key: libvirt_lxc_noseclabel, section: selinux}
type: boolean
@ -1305,7 +1311,13 @@ DISPLAY_SKIPPED_HOSTS:
name: Show skipped results
default: True
description: "Toggle to control displaying skipped task/host entries in a task in the default callback"
env: [{name: DISPLAY_SKIPPED_HOSTS}]
env:
- name: DISPLAY_SKIPPED_HOSTS
deprecated:
why: environment variables without "ANSIBLE_" prefix are deprecated
version: "2.12"
alternatives: the "ANSIBLE_DISPLAY_SKIPPED_HOSTS" environment variable
- name: ANSIBLE_DISPLAY_SKIPPED_HOSTS
ini:
- {key: display_skipped_hosts, section: defaults}
type: boolean
@ -1594,7 +1606,13 @@ NETWORK_GROUP_MODULES:
name: Network module families
default: [eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf]
description: 'TODO: write it'
env: [{name: NETWORK_GROUP_MODULES}]
env:
- name: NETWORK_GROUP_MODULES
deprecated:
why: environment variables without "ANSIBLE_" prefix are deprecated
version: "2.12"
alternatives: the "ANSIBLE_NETWORK_GROUP_MODULES" environment variable
- name: ANSIBLE_NETWORK_GROUP_MODULES
ini:
- {key: network_group_modules, section: defaults}
type: list

View file

@ -31,6 +31,11 @@ DOCUMENTATION = '''
default: no
env:
- name: DISPLAY_SKIPPED_HOSTS
deprecated:
why: environment variables without "ANSIBLE_" prefix are deprecated
version: "2.12"
alternatives: the "ANSIBLE_DISPLAY_SKIPPED_HOSTS" environment variable
- name: ANSIBLE_DISPLAY_SKIPPED_HOSTS
ini:
- key: display_skipped_hosts
section: defaults

View file

@ -15,6 +15,11 @@ class ModuleDocFragment(object):
default: yes
env:
- name: DISPLAY_SKIPPED_HOSTS
deprecated:
why: environment variables without "ANSIBLE_" prefix are deprecated
version: "2.12"
alternatives: the "ANSIBLE_DISPLAY_SKIPPED_HOSTS" environment variable
- name: ANSIBLE_DISPLAY_SKIPPED_HOSTS
ini:
- key: display_skipped_hosts
section: defaults

View file

@ -85,38 +85,38 @@ export ANSIBLE_FORCE_COLOR=0
export ANSIBLE_NOCOLOR=1
# Default settings
export DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_OK_HOSTS=1
export ANSIBLE_DISPLAY_FAILED_STDERR=0
run_test default
# Hide skipped
export DISPLAY_SKIPPED_HOSTS=0
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=0
run_test hide_skipped
# Hide skipped/ok
export DISPLAY_SKIPPED_HOSTS=0
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=0
export ANSIBLE_DISPLAY_OK_HOSTS=0
run_test hide_skipped_ok
# Hide ok
export DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_OK_HOSTS=0
run_test hide_ok
# Failed to stderr
export DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_OK_HOSTS=1
export ANSIBLE_DISPLAY_FAILED_STDERR=1
run_test failed_to_stderr
# Default settings with unreachable tasks
export DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1
export ANSIBLE_DISPLAY_OK_HOSTS=1
export ANSIBLE_DISPLAY_FAILED_STDERR=1