|
|
[root@jdjk11 collect_log]# cat ansible.cfg 1 V- g* }' P4 I: }3 x$ `& D- J: T
[defaults]
: y# d7 g. U* H+ G' mhost_key_checking = False0 y3 k' E" s; t. Y' m
roles_path = ./roles: N. m! F0 U* A6 W1 t# X
display_skipped_hosts = False
6 J- z9 P/ |8 z! Q% N9 A+ A3 l) I
# Enable timing information! g3 H+ D$ e* }% f: |
callback_whitelist = profile_roles,timer, profile_tasks
! E4 V# B7 U- B- R4 t( T6 v; jdeprecation_warnings=False3 F1 u+ t* b* k6 s5 |( x5 t& s
strategy_plugins = ~/.ansible/plugins/mitogen-0.3.1/ansible_mitogen/plugins/strategy/
4 Y, V8 u+ [9 N#strategy = mitogen_linear T) n8 v F! ~& A W9 m
2 z0 D, x* F9 x9 [" J( F+ u) y#fact info config
6 P, j7 a0 A1 W1 R8 ~# egathering = smart9 M; d4 t& S0 q& F. U- V0 H. Q5 q
fact_caching_connection = /tmp/facts_cache
+ F/ s5 X: R5 U( e; ffact_caching = jsonfile8 B5 v( t9 ^1 _
$ c4 t2 l+ B5 b0 I! ?- u
# The timeout is defined in seconds
9 Q4 c8 b2 K( [- g( Q+ w. [! @ W/ `# This is 2 hours 8 H4 j1 M( Q# k( y
fact_caching_timeout = 7200
! ]8 c9 G+ f& u5 I: V. S0 K; }3 C! o, N Q- W
forks = 2- R% h2 Q5 \$ f4 w& k; F* V# G( g
+ |2 {% v8 s; m0 g4 ]" C2 P) u[ssh_connection])
% S# H5 p5 E# k# Adding PreferredAuthentications=publickey to the ssh_args line
+ H" d o. r8 w! L0 [. q' f6 q#ssh_args = -o ControlMaster=auto -o ControlPersist=18000 -o PreferredAuthentications=publickey 注释掉这行,windows可以打开。% }/ w) O2 u; G ^
! u7 V2 n* `1 {; {4 J* x i% tpipelining = True- z, M5 v1 M/ p r2 c
+ i ]! Z6 i5 w* v
5 F7 o6 [# x, K配置windows 的host信息:
) Y3 M7 K0 u+ m! M% U y1 |" ][root@jdjk11 collect_log]# cat host/ M7 R1 q, ?5 C
[remote_group]
8 n. E: ]* m- g6 U. e192.168.100.703 ]3 \3 w1 e6 U4 N- o9 c
[remote_group:vars]
/ _+ G, P# b: ?ansible_ssh_user=administrator; s1 V( h# _2 U$ Y U
ansible_ssh_pass="jdjk@redhat2022". |5 U8 N: s1 j8 i
ansible_ssh_port=59858 B* [4 x# y+ g2 P! A
ansible_connection="winrm"
4 r5 Q! J3 O& m7 X% m" B3 w5 w/ Oansible_winrm_server_cert_validation=ignore0 c- B" I. n6 S- h' O
ansible_winrm_scheme=http
# [! O. k2 k" o5 p#line_no="100": z& y m3 w# }6 G E' H
#remote_file="D:\\server\\PisServer\\log\\PisServer.exe20220826log.txt"1 N2 C# R ?2 N1 O. l: o
#remote_host="192.168.100.70"1 X' G5 [1 d7 i! ]8 j
% v @! k1 W4 }
" |" f& `' A5 [. P! D. J$ r) d! Z! X- n5 p
9 [, f3 y$ L7 U$ C
|
|