当前位置: 首页 > news >正文

阿里云t5做网站h5制作培训

阿里云t5做网站,h5制作培训,汕头网站制作哪家强,iis更改默认网站ansible报错解决#xff1a;Failed to import the required Python library (netaddr) 问题情况 今天我在做实验的时候出现了一个问题#xff0c;以下是我的playbook#xff0c;这个playbook是验证变量ip_address是否是一个合法的IP地址#xff0c;并打印相应的信息的一个…ansible报错解决Failed to import the required Python library (netaddr) 问题情况 今天我在做实验的时候出现了一个问题以下是我的playbook这个playbook是验证变量ip_address是否是一个合法的IP地址并打印相应的信息的一个剧本 [rootlocalhost ansible]# vim test6.yml - hosts: testvars:ip_address: 192.168.2455.1tasks:- name: 判断{{ip_address}}是否为合法ipdebug:msg: {{ ip_address | ipaddr}} # 执行结果 [rootlocalhost ansible]# ansible-playbook test6.yml PLAY [test] *************************************************************************************************************************TASK [Gathering Facts] ************************************************************************************************************** ok: [192.168.200.20]TASK [判断192.168.2455.1是否为合法ip] ********************************************************************************************* fatal: [192.168.200.20]: FAILED! {msg: template error while templating string: Could not load \ipaddr\: Invalid plugin FQCN (ansible.netcommon.ipaddr): unable to locate collection ansible.netcommon. String: {{ ip_address | ipaddr}}. Could not load \ipaddr\: Invalid plugin FQCN (ansible.netcommon.ipaddr): unable to locate collection ansible.netcommon}PLAY RECAP ************************************************************************************************************************** 192.168.200.20 : ok1 changed0 unreachable0 failed1 skipped0 rescued0 ignored0 这里报错没有识别ipaddr这个集合并告诉你没有安装ansible.netcommon.ipaddr集合这时候我们安装集合就好了对吧 # 安装集合 [rootlocalhost ansible]# ansible-galaxy collection install /root/ansible-netcommon-6.1.1.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-4.1.0.tar.gz to /root/.ansible/tmp/ansible-local-4770j3qwrbe5/tmptvw6n2g6/ansible-utils-4.1.0-_5mvcxlt Installing ansible.netcommon:6.1.1 to /root/ansible/mycollection/ansible_collections/ansible/netcommon ansible.netcommon:6.1.1 was installed successfully Installing ansible.utils:4.1.0 to /root/ansible/mycollection/ansible_collections/ansible/utils ansible.utils:4.1.0 was installed successfully # 查看集合 [rootlocalhost ansible]# ansible-galaxy collection list # 这里是我自己设置的集合路径显示已经安装了对吧 # /root/ansible/mycollection/ansible_collections Collection Version ----------------- ------- ansible.netcommon 6.1.1 ansible.utils 4.1.0 再次执行这个playbook [rootlocalhost ansible]# ansible-playbook test6.yml PLAY [test] *************************************************************************************************************************TASK [Gathering Facts] ************************************************************************************************************** ok: [192.168.200.20]TASK [Set the IP address192.168.2455.1] ********************************************************************************************* [DEPRECATION WARNING]: Use ansible.utils.ipaddr module instead. This feature will be removed from ansible.netcommon in a release after 2024-01-01. Deprecation warnings can be disabled by setting deprecation_warningsFalse in ansible.cfg. fatal: [192.168.200.20]: FAILED! {msg: Failed to import the required Python library (netaddr) on localhost.localdomains Python /usr/bin/python3.11. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter} # 这个时候他告诉我们没有netaddr这个python库 # 这里我们安装这个python库 # 也是我自己出错的点你ansible使用的是哪个python版本 # 你就要使用哪个版本来安装netaddr这个python库才行 PLAY RECAP ************************************************************************************************************************** 192.168.200.20 : ok1 changed0 unreachable0 failed1 skipped0 rescued0 ignored0 解决问题 先查看ansible版本 [rootlocalhost ansible]# ansible --version ansible [core 2.14.2]config file /root/ansible/ansible.cfgconfigured module search path [/root/.ansible/plugins/modules, /usr/share/ansible/plugins/modules]ansible python module location /usr/lib/python3.11/site-packages/ansibleansible collection location /root/ansible/mycollection:/root/ansible/{{ ANSIBLE_HOME ~ /collections:/usr/share/ansible/collections }}executable location /usr/bin/ansiblepython version 3.11.2 (main, Feb 16 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3.11)jinja version 3.1.2libyaml True # 用的python3.11对吧 # 使用python3.11安装netaddr安装netaddr这个python库 # 安装pip3.11 [rootlocalhost ansible]# yum install -y python3.11-pip.noarch # 创建python虚拟环境 python3.11 -m venv python_env source python_env/bin/activate (python_env) [rootlocalhost ansible]# pip3.11 install netaddr Collecting netaddrUsing cached netaddr-1.2.1-py3-none-any.whl (2.3 MB) Installing collected packages: netaddr Successfully installed netaddr-1.2.1[notice] A new release of pip available: 22.3.1 - 24.0 [notice] To update, run: pip install --upgrade pip执行成功 (python_env) [rootlocalhost ansible]# ansible-playbook test6.yml PLAY [test] *************************************************************************************************************************TASK [Gathering Facts] ************************************************************************************************************** ok: [192.168.200.20]TASK [判断192.168.2455.1是否为合法ip] *********************************************************************************************** [DEPRECATION WARNING]: Use ansible.utils.ipaddr module instead. This feature will be removed from ansible.netcommon in a release after 2024-01-01. Deprecation warnings can be disabled by setting deprecation_warningsFalse in ansible.cfg. # 这里告诉我们要使用完整的模块名字 ok: [192.168.200.20] {msg: false }PLAY RECAP ************************************************************************************************************************** 192.168.200.20 : ok2 changed0 unreachable0 failed0 skipped0 rescued0 ignored0
http://www.dnsts.com.cn/news/109234.html

相关文章:

  • 零食公司建立网站的原因网页微信登录
  • wordpress全站使用cdn企业官网维护
  • 惠阳网站建设通化市建设工程招投标网站
  • 网站报价表格辽宁省建设银行e护航网站
  • 高性能网站建设朝阳公园网站建设
  • 单位建网站的详细步骤seo怎么做网站内容
  • 网站会员系统怎么做com域名申请
  • 网站做熊掌号码企业外贸网站推广
  • 企业手机网站程序是什么wordpress 搜索排除
  • 邢台网站制作那家便宜脉脉用的什么技术做网站
  • 佛山网站开发招聘潍坊市建设信息网
  • 共享备案网站小程序和h5的区别和优势
  • 古色古香 网站模板阿坝北京网站建设
  • 自动做网站门户网站建设目标
  • 男女插孔做暖暖试看网站大全wordpress修改主题代码
  • 郑州网站建设公司航迪软件怎么样家具网站建设策划书
  • 长沙网站设计认准智优营家广告设计与制作专升本考试科目
  • 东莞网站平面设计公司管理咨询公司swot
  • 做海淘网站赚钱吗更换网站模板
  • 潍坊网站建设wf3旧网站怎么做301跳转
  • 网站建设属于什么会计科目做网站公司怎么找客户
  • 怎么对自己做的网站进行加密纪检监察网站建设 讲话
  • 网站建设qq大连三大网络推广网站
  • php网站怎么做的域名和网站名要一样吗
  • 福田网站建设方案服务北京西站附近的景点有哪些
  • 医院做网站定位广东省备案网站建设方案书
  • 做母婴的网站网站被提示危险网站
  • 做外贸要做什么网站万网云主机 wordpress
  • 网站建设实习招聘wordpress设置多语言
  • seo综合查询 站长工具江苏润祥建设集团网站