Eigentlich habe ich remote_user Variable für jede Host-Gruppe definiert. Aber remote_user Wert wird nicht von definiertem genommen. Eher verwendet sie den obersten zugewiesenen Wert.Ansible: remote_user in Playbook-Datei Probleme
ansible Version:
# ansible --version
ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609]
Textbuch-Datei: info.yml
---
- hosts: all
remote_user: demo
roles:
- common
- hosts: devlocal
remote_user: root
become: yes
roles:
- common
- hosts: testlocal
remote_user: test
become: yes
roles:
- common
, wenn ich das Textbuch für Hosts [devlocal] ausführen, wird der Benutzer Namen aus der ersten Zuordnung genommen [dh: " Demo "]. Eigentlich sollte es den remote_user "root" in meinem Fall verwenden.
Protokolle:
# ansible-playbook -i hosts -l devlocal info.yml --ask-pass -vvvv
Using /etc/ansible/ansible.cfg as config file
SSH password:
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc
PLAYBOOK: site.yml ********************************************************************************************************************************
3 plays in site.yml
PLAY [all] ****************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/system/setup.py
<10.11.12.213> ESTABLISH SSH CONNECTION FOR USER: demo
Jemand bitte helfen Sie, was hier ein Thema war. Vielen Dank im Voraus
, warum die Frage herabgestuft wurde. irgendwelche Gründe? – KMG