Ansible
Ansible
weixin_45082683
这个作者很懒,什么都没留下…
展开
-
Ansible roles
1.item 变量[root@ansible ansible]# more testitem.yml ---- hosts: websrvs remote_user: root tasks: - name: create some files file: name=/tmp/{{ item }} state=touch with_items: - file1 - file2 - file3 - na原创 2020-11-25 14:48:00 · 129 阅读 · 0 评论 -
AnsibleTemplate使用
1.template1hosts定义了变量[websrvs]172.16.62.12 http_port=8081172.16.62.13 http_port=8082[root@ansible ansible]# more testtempl.yml ---- hosts: websrvs remote_user: root vars: - http_port: 8088 #定义了变量 tasks: - name: install package原创 2020-11-25 14:40:29 · 338 阅读 · 1 评论 -
Ansible变量
1.playbook1[root@ansible ansible]# ansible-playbook hello.yml PLAY [websrvs] ***************************************************************************************************************************************************************************TAS原创 2020-11-25 14:32:09 · 132 阅读 · 0 评论 -
ansible常用模块
1.ping 模块[root@ansible ~]# ansible websrvs -m ping172.16.62.11 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}172.16.62.12 | SUCCESS => { "ans原创 2020-11-25 14:30:17 · 547 阅读 · 0 评论 -
ansible使用1
最近开始研究ansible,如下都是练习笔记实验1 生成秘钥对ansible 172.16.62.17[root@ansible .ssh]# ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase ag原创 2020-11-25 14:26:35 · 523 阅读 · 0 评论