ansible / ansible-documentation

Ansible community documentation
https://docs.ansible.com/
GNU General Public License v3.0
84 stars 497 forks source link

TRANSFORM_INVALID_GROUP_CHARS doesn't document valid group patterns #89

Open xarses opened 5 years ago

xarses commented 5 years ago
SUMMARY

With the addition of the TRANSFORM_INVALID_GROUP_CHARS. Other than reading the source, it was not clear which characters must be avoided going forward, only that the warning (with -vvvv) points out which characters you currently use that are invalid.

Please clarify that you are pushing the names to be valid python vars. This is missing from the documentation for the cfg option, warning and online documentation

(https://github.com/ansible/ansible/commit/d241794daa6d413e6447890e2a4f11e0d818cf0e#diff-b77962b6b54a830ec373de0602918318R122)

There appears to be no mention of this on https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html either.

ISSUE TYPE
COMPONENT NAME

group

ANSIBLE VERSION
ansible 2.8.0
  config file = /home/awoodward/ansible-skynet/ansible.cfg
  configured module search path = [u'/home/awoodward/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.5 (default, Apr  9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
CONFIGURATION

n/a

OS / ENVIRONMENT

n/a

ADDITIONAL INFORMATION

n/a

emmm-dee commented 4 years ago

When I set force_valid_group_names = ignore the WARNING went away, but the DEPRECATION NOTICE did not go away.

Finally I found in the docs: force_valid_group_names = silently which will do the replacement and won't clog up the output - if that's what you're looking to do.

Nonetheless, this whole issue could have been avoided in the first place if pointless changes like this weren't made in the first place.

geerlingguy commented 4 years ago

@emmm-dee - For that particular problem, I opened https://github.com/ansible/ansible/issues/70908 — note that this issue still persists, as there is still no official documentation for what are 'valid' group chars.

hth2 commented 4 years ago

thanks to @geerlingguy for your actions! You are the one who is making ansible better.

amitgeit commented 4 years ago

I am working for our application for bounce (start/stop) but i am not connected with application host.

I tried ping command, which you sent and it works...

[webadmin@vlodjumpts00 ~]$ ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

64 bytes from 8.8.8.8: icmp_seq=1 ttl=112 time=10.6 ms

[webadmin@vlodjumpts00 ~]$ mirrorlist.centos.org

-bash: mirrorlist.centos.org: command not found

I want to use this for our organization.. if i ran "ansible all -m ping" command. facing error, below is details:

[aa63457@vlodjumpts00 bin]$ ansible all -m ping

[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will

change, but still be user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be

disabled by setting deprecation_warnings=False in ansible.cfg.

[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

RTE3EPAdmin | UNREACHABLE! => {

"changed": false,

"msg": "Failed to connect to the host via ssh: ###############################################################################\n# CenturyLink computers and the CenturyLink computer network are CenturyLink  #\n# property. Only authorized persons may use them and only for legal and proper#\n# purposes as determined solely by CenturyLink. You consent to the monitoring #\n# of their use. You must use CenturyLink computers and the network in         #\n# accordance with the CenturyLink Code of Conduct, subject to discipline for  #\n# misuse. Customer use is governed by the CenturyLink Acceptable Use Policy.  #\n###############################################################################\nUse CTL credentials (login/password) on this server.\nAUTH-NOTICE:\nAUTH-NOTICE: Use your cuid as your username\nAUTH-NOTICE:\nPermission denied (publickey,password).",

"unreachable": true

}

localhost | SUCCESS => {

"ansible_facts": {

    "discovered_interpreter_python": "/usr/bin/python"

},

"changed": false,

"ping": "pong"

}

Please help me... what i need to do this. Actually, we don't have UN/PWD for hosts file for connecting host machine..

localhost ansible_connection=local

[RTE3VFO]

RTE3VFOAdmin ansible_host=vlddwblasts001.test.intranet

RTE3VFOManaged ansible_host=vlddwblasts002.test.intranet

[RTE3EP]

RTE3EPAdmin ansible_host=vlddwblasts002.test.intranet

RTE3EPManaged ansible_host=vlddwblasts003.test.intranet

[RTE3RES]

RTE3RESAdmin ansible_host=vlddwblasts003.test.intranet

RTE3RESAManaged ansible_host=vlddwblasts004.test.intranet

[RTE3ORCH]

RTE3ORCHAdmin ansible_host=vlddwblasts004.test.intranet

RTE3ORCHManaged ansible_host=vlddwblasts005.test.intranet

[RTE3EASE]

RTE3EASEAdmin ansible_host=vlddwblasts005.test.intranet

RTE3EASEManaged ansible_host=vlddwblasts006.test.intranet

[RTE3RTS]

RTE3RTSAdmin ansibke_host=vlddwblasts006.test.intranet

[EASE-ASR-Test2:children]

RTE3VFO

RTE3EP

RTE3RES

RTE3ORCH

RTE3EASE

RTE3RTS

and the directory structure is:

[webadmin@vlodjumpts00 ansible]$ pwd

/etc/ansible

[webadmin@vlodjumpts00 ansible]$ ll

total 84

-rw------- 1 webadmin webadmin 607 Jul 12 2017 1

-rw-r--r-- 1 webadmin webadmin 17910 Sep 19 09:55 ansible.cfg

-rw-r--r-- 1 root root 19985 Dec 8 2019 ansible.cfg.rpmnew

-rw------- 1 webadmin webadmin 213 Jul 3 2017 easeasr-rte2-ease.yml

-rwxr-xr-x 1 webadmin webadmin 1034 Sep 19 09:16 ease-hosts

-rwxr-xr-x 1 webadmin webadmin 1647 Sep 19 10:50 hosts

-rw------- 1 webadmin webadmin 2679 Jul 3 2017 hosts.bkp

-rw------- 1 webadmin webadmin 273 Jul 6 2017 lineinsfile_tst.yml

drwx------ 4 webadmin webadmin 4096 Nov 2 2017 playbooks

drwxr-xr-x 3 root root 19 Dec 8 2019 roles

-rwxr-xr-x 1 webadmin webadmin 7321 Nov 2 2017 servmix_hosts

-rw------- 1 webadmin webadmin 208 Sep 19 10:55 test.yml

-rw------- 1 webadmin webadmin 122 Sep 19 10:54 vars.yaml


We are not connected directly to host... fist login our jump server and than ssh host...

jump server is "vmdcltctws217" port using =22, connection type=ssh

and then enter with our UN/PWD

after that we did sudo for connection to host server..

sudo su - easesqa

and then ssh host server like..

vlddwblasts001.test.intranet

then we run start/stop command from here..

Please help me, what can i do it for?

sceptic30 commented 3 years ago

I was brought here by Google.. 😺 I faced the same problem while provisioning infrastructure and the problem was solved when I changed permissions is my private keys (where 755), so after chmod 700, everything worked fine. Hope this might help someone with similar issue.

adamdonahue commented 3 years ago

Given the current status of this ticket, I'd argue the use of INVALID or valid in this variable is misleading and incorrect. Invalid in what context? Something like TRANSFORM_VAR_INCOMPATIBLE_GROUP_CHARS (that's a mouthful, or probably a different name) might be more informative and correct.

plantroon commented 3 years ago

Even from the deprecation warning, it is not clear if force_valid_group_names=silently will work in/after 2.10.

It states "This feature will be removed in version 2.10" - does "this feature" refer to:

OR

?

equinox0815 commented 3 years ago

@plantroon it's neither. The feature that is deprecated is the automatic rewrite of "invalid" group names. See this comment for more information.

tacerus commented 2 years ago

The transformation of the character within Ansible seemed like a reasonable solution to me, as it worked around the issue at a central place.

I would be interested where the workaround is supposed to happen now. Is the new solution to ...

bcoca commented 2 years ago

i keep trying to get back to this, but in any case this is the 'cannonical source', just need to rephrase it so it is more accessible to laypeople. https://docs.python.org/3/reference/lexical_analysis.html#identifiers