k8s运维内功 — kubespray源码详解(二)
以下部分内容为以debug方式逐个调用ansible任务时通过AIAnsible时生成,
AIAnsible的仓库地址为: https://github.com/sunnycloudy/aiansible
<STEP: 31>
kubespray/roles/kubernetes/preinstall/tasks/0020-set_facts.yml #73
[代码和注释:]
73| - name: get content of /etc/resolv.conf # 获取/etc/resolv.conf文件的内容
74| slurp: # 使用slurp模块,用于读取文件内容并将其作为变量存储
75| src: /etc/resolv.conf # 指定要读取的文件路径
76| register: resolvconf_slurp # 将读取的内容注册到resolvconf_slurp变量中
[参数:]
src: /etc/resolv.conf
_ansible_check_mode: False
_ansible_no_log: False
_ansible_debug: False
_ansible_diff: False
_ansible_verbosity: 0
_ansible_version: 2.12.10
_ansible_module_name: slurp
_ansible_syslog_facility: LOG_USER
_ansible_selinux_special_fs: ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'v