
ansible
rockstics
devops worker
展开
-
已安装pywinrm,仍报错winrm or requests is not installed: No module named winrm
因此用pip3安装了pywinrm,并且执行ansible时指定了python3作为解释环境,但是在这里并没有起作用。ansible版本ansible2.9.27#yum安装。并且由于python2已经弃用,即使安装pip2后,任然无法安装pywinrm,报错如下。python版本pythonversion=2.7.5#系统默认。系统没有安装pip2,ansible默认使用的python2。ansible调用远程widows服务器,执行报错。...原创 2022-07-26 15:34:35 · 2238 阅读 · 0 评论 -
执行ansible报CryptographyDeprecationWarning
python3.6版本下ansible 执行报warning原创 2022-07-26 15:20:09 · 1408 阅读 · 0 评论 -
ansible获取目标服务器IP的几种方式
从hostvars中获取- debug: var=hostvars[inventory_hostname]['ansible_default_ipv4']['address']- debug: var=hostvars[inventory_hostname]['inventory_hostname']- debug: var=hostvars[inventory_hostname]['ansible_eth0']['ipv4']['address']ansible_local {{ ansi.原创 2022-04-26 17:55:35 · 4743 阅读 · 0 评论 -
使用ansible离线安装rpm包
首先利用copy模块将包分发至目标机器命令方式ansible cloud -m copy -a "src=telnet-0.17-66.el7.x86_64.rpm dest=/tmp/"playbook---- hosts: cloud tasks: - name: Copy file with owner and permissions copy: src: /srv/myfiles/nginx-release-centos-6-0.el6.ngx.noarc原创 2022-04-20 16:12:28 · 4890 阅读 · 1 评论 -
ansible 配置python interpreter解释环境的几种方法
因为centos默认安装Python2,但是现在python2已经离我们而去,很多ansible module都更好的依赖于python3 ,所以我们经常会遇到ansible版本和python版本不兼容的问题可能你遇到的报错有如下字眼,就说明遇到了An exception occurred during task execution. To see the fulltraceback, use -vvv. The error was: ImportError: No module namedkub原创 2022-03-26 11:05:24 · 9133 阅读 · 0 评论 -
ansible命令执行报错
ansible 版本:2.9.27正常情况下执行:[(04:32:52) root@vm1 yaml]# ansible --versionansible 2.9.27config file = /etc/ansible/ansible.cfgconfigured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]ansible python module原创 2022-03-24 16:36:17 · 2681 阅读 · 0 评论 -
ansible copy 模糊匹配、通配符、正则匹配
世上无难事,只怕有心人适用场景:1.用Ansible复制多个文件2.需要复制的原文件名不固定,名称需模糊匹配---- hosts: local_vm vars: filename: /data/ansible/example/data-*-file.jar tasks: - copy: src: "{{ item }}" dest: /data/example/ with_fileglob: - "{{ filename }}"h原创 2021-03-05 19:16:18 · 4376 阅读 · 0 评论