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

动漫制作专业名称seo扣费系统源码

动漫制作专业名称,seo扣费系统源码,深圳高端女装品牌排行榜,网络教育室内设计专业Ansible中的角色使用#xff1a; 目录 一、ansible角色简介 二、roles目录结构 三、roles的创建 四、roles的使用 1、书写task主任务 2、触发器模块 3、变量模块 4、j2模块 5、files模块 6、启用模块 7、执行playbook 五、控制任务执行顺序 六、多重角色的使用 一…Ansible中的角色使用 目录 一、ansible角色简介 二、roles目录结构 三、roles的创建 四、roles的使用  1、书写task主任务 2、触发器模块 3、变量模块 4、j2模块 5、files模块  6、启用模块 7、执行playbook 五、控制任务执行顺序 六、多重角色的使用 一、ansible角色简介 Ansible roles 是为了层次化结构化的组织Playbook roles就是通过分别将变量、文件、任务、模块及处理器放置于单独的目录中并可以便捷地include它们roles一般用于基于主机构建服务的场景中在企业复杂业务场景中应用的频率很高以特定的层级目录结构进行组织的tasks、variables、handlers、templates、files等相当于函数的调用把各个功能切割 成片段来执行。 二、roles目录结构 files存放copy或script等模块调用的函数tasks定义各种task要有main.yml其他文件include包含调用handlers定义各种handlers要有main.yml其他文件include包含调用vars定义variables要有main.yml其他文件include包含调用templates存储由template模块调用的模板文本meta定义当前角色的特殊设定及其依赖关系要有main.yml的文件defaults要有main.yml的文件用于设定默认变量tests用于测试角色 三、roles的创建 ansible—galaxy命令工具 Ansible Galaxy 是一个免费共享和下载 Ansible 角色的网站可以帮助我们更好的定义和学习roles ansible-galaxy命令默认与https://galaxy.ansible.com网站API通信可以查找、下载各种社区开发的Ansible 角色。 vim ansible.cfg mkdir rolescd roles/ ansible-galaxy init apache cd .. ansible-galaxy list 四、roles的使用  例子下载httpd配置虚拟主机并认证加密 1、书写task主任务 vim tasks/main.yml- name: yumyum:name: httpdstate: present- name: serviceservice:name: httpdstate: startedenabled: yes- name: create doclineinfile:path: {{item.doc}}/index.htmlline: {{item.index}}create: yesloop: {{webs}}- name: create vhosts.conftemplate:src: vhosts.conf.j2dest: /etc/httpd/conf.d/vhost.confnotify: restart httpd- name: authcopy:src: .htpasswddest: /etc/httpd/.htpasswdnotify: restart httpd2、触发器模块 vim handlers/main.yml cat handlers/main.yml- name: restart httpdservice:name: httpdstate: restarted 3、变量模块 vim vars/main.yml cat vars/main.ymlwebs: - doc: /var/www/htmlindex: www.westos.orgs page- name: bbs.westos.orgdoc: /var/www/virtual/westos.org/bbs/htmlindex: bbs.westos.orgs page- name: login.westos.orgdoc: /var/www/virtual/westos.org/login/htmlindex: login.westos.orgs page 4、j2模块 vim templates/vhosts.conf.j2 cat templates/vhosts.conf.j2{% for web in webs %} {% if web.name is defined %} VirtualHost *:80ServerName {{web.name}} {% endif %} {% if web.name is not defined %} VirtualHost _default_:80 {% endif %}DocumentRoot {{web.doc}} /VirtualHost {% endfor %} Directory /var/www/virtual/westos.org/login/html AuthUserfile /etc/httpd/.htpasswd AuthName Please input your name and password AuthType basic Require user yyl /Directory 5、files模块  touch .htpasswd htpasswd -cm .htpasswd yyl cp /etc/httpd/.htpasswd files/6、启用模块 vim httpd.yml- name: instell httphosts: allroles:- role: apache7、执行playbook ansible-playbook httpd.yml 五、控制任务执行顺序 pre_task任务执行前post_tasks任务执行后 例子 - name: instell httphosts: allpre_tasks:- name: testdebug:msg: this is start !!roles:- role: apachepost_tasks:- name: show postdebug:msg: this is end !!六、多重角色的使用 1、访问地址角色下载地址galaxy.ansible.com roles 2、搜索nginx往后翻一下找到roles 3、下载角色  ansible-galaxy collection install ivansible.nginx 要注意出于安全原因下载的代码需要仔细研读每一行代码
http://www.dnsts.com.cn/news/1725.html

相关文章:

  • 马鞍山网站建设公提高工作效率的软件
  • dw做的网站如何让别人看看网站开发流程图
  • 做网站公司宁波中国舆情在线
  • 企业网站的分类代写文章多少钱
  • 网站建站建设让顾客进店的100条方法
  • 企业网站建站 费用杭州网站排名seo
  • 做棋牌推广网站违法不百度seo发帖推广
  • 独立商城网站怎么做北京seo外包平台
  • 为什么做这个网站项目免费的网站域名查询
  • 贵州省住房和城乡建设厅网站搜索seo推广编辑
  • 服装网站建设可行性分析全网营销系统
  • 做网站banner课程封面百度投诉中心24小时电话
  • 树莓派3b 做网站服务器网络营销一般月薪多少
  • 专业网站建设加工seo文章范文
  • 网站运营需要 做哪些工作百度指数查询官网入口登录
  • 工程公司财务制度及流程seo搜索方法
  • 网站如何注销微信投放广告多少钱
  • 网站打开速度慢的原因适合企业员工培训的课程
  • 雁塔网站建设文大侠seo博客
  • 慈溪市网站建设百度的推广方式有哪些
  • 顺徳网站建设公司有哪些营销渠道有哪些
  • 阿里巴巴怎么做自己的免费网站公司软文
  • 网站新闻中心模版线上推广方式
  • 成都网站开发网站公司网站建设
  • 网站建设电脑大多怎么办百度成都总部
  • 怎么把音乐导入wordpress杭州百度推广优化排名
  • 做一家网站需要多少钱玄幻小说排行榜百度风云榜
  • 江苏太平洋建设集团官方网站白山seo
  • 上海做兼职哪个网站seo综合查询什么意思
  • 阿里云1M做网站长春网站快速优化排名