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

怎么用nat做网站巴中做网站的公司

怎么用nat做网站,巴中做网站的公司,黑龙江省建设工程质量协会网站,企业文化建设的内容有哪些想要知道ansible-pull是用来做什么的#xff0c;就需要了解Ansible的工作模#xff0c;Ansible的工作模式有两种#xff1a; push模式 push推送#xff0c;这是Ansible的默认模式#xff0c;在主控机上编排好playbook文件#xff0c;push到远程主机上来执行。pull模式 p…想要知道ansible-pull是用来做什么的就需要了解Ansible的工作模Ansible的工作模式有两种 push模式 push推送这是Ansible的默认模式在主控机上编排好playbook文件push到远程主机上来执行。pull模式 pull模式就是现在要介绍的ansible-pull命令来完成的功能与push推送模式反向pull模式是远程主机 拉去git仓库的playbook文件进行执行这需要远程主机安装ansible和git。 pull模式的优点如下 1. 斜体样式不需要主控机 2. 可以并行执行playbook任务并且速度非常快 3. 连接有节点启动更加安全 pull 模式的工作流程 图片来之网络 每台远程主机上都需要安装Ansible 和git(svn)所有的配置及playbooks 都存放在git 仓库远程主机的ansible-pull 计划任务会定期检查给定的git 的tag 或者分支ansible-pull 执行特定的playbooks 即local.yml 或者hostname.yml每次更改playbooks 只需要提交到git 即可 实验测试: 在gitee上创建一个用于测试的库pull-test 将这个库下载下来并创建playbook剧本文件上传到pull-test库 #touchfile-playbook.yaml 内容如下 # cat touchfile-playbook.yaml --- - hosts: localhostremote_user: rootgather_facts: notasks:- name: Create a filefile:path: /opt/script/ansible-pull-empty.txtstate: touchmode: 0664git clone https://gitee.com/crazy-stone-man/pull-test.git cd pull-test/ git remote add ansible-pull https://gitee.com/crazy-stone-man/pull-test.git git add touchfile-playbook.yaml git commit -m touch a file git push ansible-pull可以在gitee仓库上查看文件是否被推送上去 # ansible-pull -U https://gitee.com/crazy-stone-man/pull-test.git touchfileplaybook.yaml-U 指定playbook的URL。 -i: 指定inventory文件 我这里忽略了默认是  看看效果 [rootlocalhost script]# ansible-pull -U https://gitee.com/crazy-stone-man/pull-test.git touchfileplaybook.yaml Starting Ansible Pull at 2024-09-30 05:43:15 /usr/bin/ansible-pull -U https://gitee.com/crazy-stone-man/pull-test.git touchfileplaybook.yaml [WARNING]: Could not match supplied host pattern, ignoring: localhost.localdomain localhost [WARNING]:| SUCCESS Your git {version isafter: 2 too old t9daba82f0co fully sub39887ca15pport the eb0dce51bddepth arguad3c0066bment. Fall, being back tfore: 29o full chedaba82f0cbckouts. 39887ca15eb0dce51bdad3c0066b, changed: false, remote_url_changed: false } [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match all [WARNING]: Could not match supplied host pattern, ignoring: localhost.localdomainPLAY [localhost] ********************************************************************************************************************************************TASK [Create a file] **************************************************************************************************************************************** changed: [localhost]PLAY RECAP ************************************************************************************************************************************************** localhost : ok1 changed1 unreachable0 failed0 skipped0 rescued0 ignored0 [rootlocalhost script]# ls ansible-pull-empty.txt执行成功了 修改文件重新上传再次执行 --- - hosts: localhostremote_user: rootgather_facts: notasks:- name: Create a filefile:path: /opt/script/ansible-pull-empty.txtstate: absent 删除掉文件[rootlocalhost script]# ansible-pull -U https://gitee.com/crazy-stone-man/pull-test.git touchfileplaybook.yaml Starting Ansible Pull at 2024-09-30 05:49:41 /usr/bin/ansible-pull -U https://gitee.com/crazy-stone-man/pull-test.git touchfileplaybook.yaml [WARNING]: Could not match supplied host pattern, ignoring: localhost.localdomain localhost [WARNING]:| CHANGED Your git {version isafter: d too old tbfda18ce36o fully su79910c8316pport the 5477f9dd84depth argu5e8f875aament. Fall, being back tfore: 29o full chedaba82f0cbckouts. 39887ca15eb0dce51bdad3c0066b, changed: true, remote_url_changed: false } [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match all [WARNING]: Could not match supplied host pattern, ignoring: localhost.localdomainPLAY [localhost] ********************************************************************************************************************************************TASK [Create a file] **************************************************************************************************************************************** changed: [localhost]PLAY RECAP ************************************************************************************************************************************************** localhost : ok1 changed1 unreachable0 failed0 skipped0 rescued0 ignored0 [rootlocalhost script]# ls [rootlocalhost script]# 可以看到已经被删除了 学习更多功能使用 我创建的git仓库是公开的在真实环境是不能公开的而且最好是限制IP 加入定时任务 定时去拉取playbook文件执行 */5 * * * * ansible-pull -C master -d /tmp/ansible-pull -i /etc/ansible/hosts -U https://gitee.com/crazy-stone-man/pull-test.git -o-C 指定分支 checkout功能-d Ansible Pull 将要使用的工作目录。它会将仓库克隆到这个目录或者在该目录中查找已经克隆的仓库。-i 指定 inventory 文件路径-U 指定存储 playbook 的远程 Git 仓库的 URL。-o 只有playbook 远程Git仓库更新才执行 参考连接https://blog.csdn.net/yuezhilangniao/article/details/115799713
http://www.w-s-a.com/news/946236/

相关文章:

  • 公司网站怎么突然多了好多友情链接如何删除宁波有几个区
  • 临沂seo网站推广wordpress新编辑器
  • c2c网站设计店面logo设计制作
  • 网站建设任务执行书重庆今天新闻事件
  • 怎样发布自己的网站南宁制作网站公司
  • wordpress装多站点百度查一下
  • 怎么优化一个网站搭建网站免费空间
  • 山东建设和城乡建设厅注册中心网站首页wordpress安装教材
  • 个人风采网站制作毕节网站开发公司电话
  • 网络网站销售设计主题和设计理念
  • 做网站一般用什么服务器承德专业做网站
  • 松北区建设局网站网站建设分为几种
  • 网站建设的合同 体会智联招聘网站建设情况
  • 记的网站域名wordpress地方信息主题
  • 淄博好的建网站公司网站建设 海口
  • 有人做网站花了10几万2017做啥网站能致富
  • 做网站有什么软件cod建站平台
  • 合肥学校网站建设怎么做免费的产品图片网站
  • 营养早餐网站的设计与制作建设通网站怎么查项目经理在建
  • 浑南区建设局网站永州网站建设公司推荐
  • 做外贸都得有网站吗绵阳网站建设制作
  • 功能性的网站建设北京餐饮品牌设计公司
  • php做网站优势视频直播软件
  • 怎么安装php网站哪个网站是专门为建设方服务的
  • 重慶网站开发sina app engine wordpress
  • wampserver网站开发步骤中冠工程管理咨询有限公司
  • 自己做网站商城需要营业执照吗老外做牛排的视频网站
  • 网站推广效果的评估指标主要包括公司广告推广
  • 昆明网站建设那家好哪个网站学做凉皮
  • hype做网站动效哪里有给网站做