|
|
[root@jdjk11 collect_log]# cat ansible.cfg
$ D9 B- {1 K* U[defaults]
; s1 H) Y* }3 N& B) Z/ {host_key_checking = False
2 r" a p3 q% a4 x( R" c3 f/ `2 B0 ?, \roles_path = ./roles% i: {. K2 J4 _/ i! H6 ^0 ]
display_skipped_hosts = False
; W$ z/ Z# P1 B/ J7 i0 C$ e3 g; R4 W; O3 R" K: ~
# Enable timing information
1 l2 H9 m+ Y6 v zcallback_whitelist = profile_roles,timer, profile_tasks/ }& M3 C1 {, u- I9 h
deprecation_warnings=False
5 _* F4 K/ N8 Estrategy_plugins = ~/.ansible/plugins/mitogen-0.3.1/ansible_mitogen/plugins/strategy/5 p- q' l; A7 `% F7 o; Y6 N/ c9 k1 B3 u
#strategy = mitogen_linear
% g0 L0 D# G A7 Q" Z! O' Q- d9 k; T' Z) T: J9 z/ m
#fact info config0 X8 x e! |! I
gathering = smart
( [" P" Z/ b" e, `& t Q% xfact_caching_connection = /tmp/facts_cache, |& A8 m: {3 }% e
fact_caching = jsonfile
3 v. t$ P% y; t7 b9 P2 C0 q# L" i4 A. t, H8 \4 H
# The timeout is defined in seconds
, x! {# e5 m, I) }; M# This is 2 hours # M; Y ?1 u, V9 G
fact_caching_timeout = 7200
1 V- L8 [$ J0 B/ q4 c0 X; d
+ U# K7 j9 b1 p; X$ i0 X( N8 m" qforks = 2
6 } R( }% d$ t! k0 J' U Y
2 `4 H$ h# V3 G5 v5 l[ssh_connection])1 \1 X. J# D8 M7 A
# Adding PreferredAuthentications=publickey to the ssh_args line
1 L7 E9 L, x" m+ s7 v. b+ W#ssh_args = -o ControlMaster=auto -o ControlPersist=18000 -o PreferredAuthentications=publickey 注释掉这行,windows可以打开。
4 l* e( ^/ W* j. d) G( Q
' g$ \1 o9 T" \2 [8 }pipelining = True6 h7 K& Z3 p7 O0 \# o1 ^+ [0 A5 L
: p2 j2 w& t% M C5 [
4 d! c2 d6 D! ~# K" R配置windows 的host信息:* z) s3 I+ O1 M$ r, w; d
[root@jdjk11 collect_log]# cat host, o* _# \- Q* O7 s9 s
[remote_group]
1 f& D$ e& O' O192.168.100.70
}) T( q. _( m B8 G; Y[remote_group:vars]
; \" f" U; p+ \6 ransible_ssh_user=administrator, v- r3 A1 y) t
ansible_ssh_pass="jdjk@redhat2022"
/ ?! m; a1 T9 Vansible_ssh_port=5985# u( \+ b# H! U- j$ y" a. e
ansible_connection="winrm"
9 B1 L/ p# ?$ Fansible_winrm_server_cert_validation=ignore) u2 ?7 q4 f8 S9 b- n0 M
ansible_winrm_scheme=http
5 A" k8 Y2 `' i* H6 n# F3 }. w; z#line_no="100"
0 \) g. j) u5 V1 Z& Y#remote_file="D:\\server\\PisServer\\log\\PisServer.exe20220826log.txt"
2 Z4 V C4 f( n5 F5 O$ G#remote_host="192.168.100.70"
. n" h4 c4 A$ m0 q6 z2 }: ?( K, {8 }
/ d+ y% O) u! p& `0 d X. P$ O$ f- E& I8 ]
% R7 S0 e2 c6 c% b) ^
. Y# e9 y0 f% F4 g( o3 R
|
|