Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WARNING]: Removed restricted key from module data: ansible_* #38667

Closed
Torrent007 opened this issue Apr 12, 2018 · 2 comments
Closed

[WARNING]: Removed restricted key from module data: ansible_* #38667

Torrent007 opened this issue Apr 12, 2018 · 2 comments

Comments

@Torrent007
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME

set_fact

ANSIBLE VERSION
ansible 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/mnt/data/ansible/my_modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
CONFIGURATION
COMMAND_WARNINGS(/etc/ansible/ansible.cfg) = False
DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = [u'/mnt/data/ansible/my_modules']
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = True
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
SYSTEM_WARNINGS(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

CentOS 7 with Ansible Tower installed

SUMMARY

A Warning appears each time I changed during playbook vars like ansible_user or ansible_winrm_transport

STEPS TO REPRODUCE

Create ´user.yml´:

- name: Test playbook
  hosts: all
  connection: local
  gather_facts: no

  tasks:
    - set_fact:
        ansible_user: toto

Run this command with any single host inventory (same issue when multiples hosts of course):

ansible-playbook -i inventory user.yml -vvvvv
EXPECTED RESULTS

See comments at the end of 'Actual Results'

ACTUAL RESULTS

A warning line appears as you can see below when I change ansible_* vars:

[...]
TASK [set_fact] ***********************************************************************************************************************************************************************************************
task path: /mnt/data/test/ansible/user.yml:13
 [WARNING]: Removed restricted key from module data: ansible_user = toto

ok: [vm0050568e0362.RES.ROOT.CORP] => {
    "ansible_facts": {
        "ansible_user": "toto"
    },
    "changed": false
}
META: ran handlers
META: ran handlers
[...]

I just upgraded from 2.4.2 to 2.5 and I haven't this issue before.

For information, I changed during a specific role these vars:

  • ´ansible_user´
  • ´ansible_password´
  • ´ansible_winrm_transport´
  • ´ansible_winrm_kinit_mode´
    And I have this warning appears for each of them.

The main problem is that it clearly displays the new values of variables, including the password:
Ansible Tower output screenshot

@bcoca
Copy link
Member

bcoca commented Apr 12, 2018

dupe of #37535

@bcoca bcoca closed this as completed Apr 12, 2018
@Torrent007
Copy link
Author

Thanks for quick support and sorry for dupe ;)

@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants