shterm.appmgr_lookup_plugin
appmgr_lookup_plugin
appmgr_lookup_plugin do pobierania konta i hasła z shterm-appmgr
Wymagania
- shterm-agent
- shterm-appmgr
Instalacja
Zainstaluj rolę appmgr_lookup_plugin używając następującej składni:
$ ansible-galaxy install shterm.appmgr_lookup_plugin
Użycie wtyczki
- przykład playbooka
- hosts: server1
roles:
- role: shterm.appmgr_lookup_plugin
vars:
contents: "{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''})}}"
ansible_ssh_pass: "{{contents.password}}"
ansible_ssh_user: "{{contents.name}}"
tasks:
- debug: msg="wartość foo.txt to {{contents.name}}"
- przykład pliku hostów
[demo]
server1 ansible_ssh_host=10.10.20.29 ansible_ssh_pass="{{content.password}}"
[demo:vars]
content="{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''})}}"
- przykład komendy
ansible 10.10.20.29 -i 10.10.20.29, --playbook-dir ~/.ansible/roles/shterm.appmgr_lookup_plugin/ -u root -e ansible_password="{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''}).password}}" -a 'echo dial'
Argumenty wtyczki
appid
(str): Definiuje unikalny identyfikator aplikacji, która wydaje żądanie hasła.query
(str): Opisuje kryteria filtrowania do pobrania hasła.extra
(str): ExtendField
Zwracana wartość wtyczki
dict
: Słownik zawierający 'password
' i 'name
'
Licencja
MIT
Informacje o autorze
- Ding Allen(zjdyms.hz@shterm.com)
Zainstaluj
ansible-galaxy install shterm.appmgr_lookup_plugin
Licencja
other
Pobrania
151
Właściciel