
Ansible
ansible 学习记录
老实人张大傻
这个作者很懒,什么都没留下…
展开
-
ansible 学习记录(七) -- group 和 host 变量
inventory 文件定义[master]master ansible_user=root ansible_password=123456 ansible_connection=ssh[slave]node1 ansible_user=root ansible_password=123456 ansible_connection=sshnode2 ansible_user=roo...原创 2020-04-21 22:30:23 · 2400 阅读 · 0 评论 -
ansible 学习记录(六) -- 条件判断
Condition When---- name: test when condition hosts: localhost gather_facts: no vars: seq: - 1 - 2 - 3 - 4 - 5 tasks: - name: test loop and when ...原创 2020-04-21 21:26:13 · 206 阅读 · 0 评论 -
ansible 学习记录(五) -- playbook 学习
Debug 模块使用ansible doc – debug moduleplaybook/helloworld.yml---- name: Hello World hosts: localhost tasks: - name: Hello World debug: msg: "Hello World"ansible cont...原创 2020-04-20 22:52:32 · 518 阅读 · 0 评论 -
ansible 学习记录(四) -- ansible 概念学习
概览Inventory (服务器资源)Playbook (操作)module (模块)Role (web server) node1Role (web server)Task (git)Task (service)gitserviceRole (database server)node2Role (database server)Task (mysql)mys...原创 2020-04-19 22:33:37 · 145 阅读 · 0 评论 -
ansible 学习记录(三) -- inventory SSH Key 认证方式的实现
Control 节点生成 key[root@master ~]# ssh-keygenssh-copy-id 分发[root@master ~]# ssh-copy-id -i .ssh/id_rsa.pub node1[root@master ~]# ssh-copy-id -i .ssh/id_rsa.pub node2node1 查看[root@node1 ~...原创 2020-04-19 17:45:40 · 749 阅读 · 0 评论 -
ansible 学习记录(三) -- inventory 学习
VS Code 准备node1 ansible_connection=ssh ansible_user=root ansible_ssh_pass=123456VS Code 同步Sync Local -> Remote服务器执行[root@master ~]# ansible all -m ping -i /home/ansible-study/inventor...原创 2020-04-19 17:21:46 · 505 阅读 · 0 评论 -
ansible 学习记录(二) -- vs code 远程连接服务器
环境准备 – VS Code 环境安装SFTP 插件安装sftp 配置Ctrl + Shift + pSFTP: Config{ "name": "My Server", "host": "192.168.157.130", # 远程服务器地址 "protocol": "sftp", # 连接方式 "port": ...原创 2020-04-19 16:51:54 · 888 阅读 · 0 评论 -
ansible 学习记录(一) -- 环境准备
ansible 学习记录(一) – 环境准备ansible 学习机器准备hostnamesystemipcpumemdatausernamepasswdrolemasterCentOS 7192.168.157.1302核4GB30GBroot123456ansible masternode1CentOS 7192.168.157.1...原创 2020-04-19 16:25:13 · 200 阅读 · 0 评论