摘要:
部署环境准备 ip 主机名 10.0.0.41 master01 10.0.0.42 node01 10.0.0.43 node02 主机配置 所有主机都需要配置 必备软件安装 cd /etc/yum.repos.d/ mkdir bak mv CentOS-Base.repo CentOS-CR. 阅读全文
posted @ 2025-07-27 05:06
阿峰博客站
阅读(9)
评论(0)
推荐(0)
摘要:
认识kubernetes 含义 希腊语:舵手、飞行员 起源 源自于谷歌Borg ,使用golang语言开发 , 简称为k8s 归属 现归属于CNCF ● 云原生(CloudNative)计算基金会 ● 是一个开源软件基金会,致力于使云计算普遍性和持续性 官方:http://www.cncf.io K 阅读全文
posted @ 2025-07-27 03:58
阿峰博客站
阅读(14)
评论(0)
推荐(0)
摘要:
playbook组成 - hosts: all #指定主机组 remote_user: root #以root用户运行 vars: #定义变量 file_name: zqf tasks: #执行任务 - name: touch test.txt shell: touch ~/test.txt pla 阅读全文

posted @ 2025-07-27 02:42
阿峰博客站
阅读(6)
评论(0)
推荐(0)
摘要:
ansible的常用模块 模块 作用 command 执行shell命令(不支持管道等特殊字符) 管道 shell 执行shell命令 支持特殊符号 script 执行shell脚本 yum_repository 配置yum仓库 yum源 yum 安装软件 copy 远程复制 file 创建目录或文 阅读全文

posted @ 2025-07-27 02:40
阿峰博客站
阅读(13)
评论(0)
推荐(0)
摘要:
选项 含义 --version ansible的版本 -v -vv -vvvv ansible的执行显示过程,越来越详细 -i 指定主机清单的位置,默认是/etc/ansible/hosts -m 指定模块 -a 指定模块中的具体动作 -k 指定被控节点的密码 -C 检查与测试,不是真正的运行(pl 阅读全文

posted @ 2025-07-27 01:39
阿峰博客站
阅读(4)
评论(0)
推荐(0)
摘要:
基于密码的连接 如果是第一次登陆,需要免ssh验证的话,可以设置: vim /etc/ansible/ansible.cfg host_key_checking = False cat /etc/ansible/hosts [all] 10.0.0.11 ansible_ssh_port=22 an 阅读全文

posted @ 2025-07-27 01:35
阿峰博客站
阅读(11)
评论(0)
推荐(0)
摘要:
主配置文件加载顺序 Ansible的主配置文件可以存放在任何位置,但配置文件有读取顺序 最先查找$ANSIBLE_CONFIG变量对应的位置和文件 其次查找当前目录下ansible.cfg 然后查找用户家目录下的.ansible.cfg 最后查找/etc/ansible/ansible.cfg(默认 阅读全文

posted @ 2025-07-27 01:30
阿峰博客站
阅读(13)
评论(0)
推荐(0)
摘要:
centos安装: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo https://mirrors.al 阅读全文

posted @ 2025-07-27 01:26
阿峰博客站
阅读(9)
评论(0)
推荐(0)