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

摄影作品网站app十大排名安卓搭载wordpress

摄影作品网站app十大排名,安卓搭载wordpress,做广告牌子的电话,湖南小程序管理平台一、Ansible概述: 是一个配置管理系统#xff08;configuration management system#xff09;,当下最流行的批量自动化运维工具之一。 Ansible是一个开源的自动化工具#xff0c;用于配置管理、应用程序部署和编排等 IT 任务的执行。它专注于简单性和可扩展性#xff0c;并…一、Ansible概述: 是一个配置管理系统configuration management system,当下最流行的批量自动化运维工具之一。 Ansible是一个开源的自动化工具用于配置管理、应用程序部署和编排等 IT 任务的执行。它专注于简单性和可扩展性并使用人类可读的 YAML 语言编写自动化脚本。 Ansible 的特点包括 无需客户端Ansible 是一种无需在目标系统上安装任何额外软件或代理的代理服务器配置管理工具。它基于 SSH 进行通信只需要远程系统上的 SSH 服务。 声明性语言使用 YAML 的声明性语言可以方便地描述系统的期望状态。这使得 Ansible 任务的编写和理解变得简单。 广泛的模块支持Ansible 提供了众多的模块用于执行各种不同的任务例如文件操作、软件包管理、服务管理等。模块可以轻松地扩展 Ansible 的功能。 PlaybookAnsible 使用 Playbook 文件来组织和描述配置任务。Playbook 可以包含一个或多个任务这些任务按照定义的顺序执行。Playbook 可以指定目标主机、任务的执行条件以及一些其他选项。 角色和剧本Ansible 提供了角色和剧本的概念以帮助组织复杂的配置和部署任务。角色是一组相关任务和配置的集合而剧本则是包含角色和相关配置的抽象层。 扩展性Ansible 提供了丰富的插件系统允许用户编写自定义的模块、插件和回调函数以满足特定的需求。 社区支持Ansible 拥有庞大的活跃社区提供了大量的文档、示例和第三方扩展。这使得用户可以轻松地获取支持和共享最佳实践 Ansible的作用: 批量部署服务安装日常备份。 Ansible官方文档: https://docs.ansible.com/ansible/latest/index.html Ansible的特性: 无客户端软件通过ssh远程管理 安装后不需要启动服务 依赖大量的Python模块扩展功能 配置文件/etc/ansible/ansible.cfg Ansible基础架构: 连接插件(connecter plugins):用来连接主机连接被管理端 核心模块core modules:连接主机实现操作依赖于具体模块来执行 自定义模块用户自己开发的功能模块 剧本playbook:将多个任务组合成一个剧本由ansible自动批量执行 主机清单host inventory定义ansible管理的客户端主机范围 Ansible的命令格式 ansible [-f forks] [-m module_name] [-a args] ansible 主机清单名 -m 调用的模块 -a 动作命令 inventory group name ip all -f forks 并发线程数默认为5个线程 -m module_name 要使用的模块 -a args 模块特有的参数 -i hosts文件 指定特定的inventory文件默认为 /etc/ansible/hosts 二、安装 yum -y install ansible #查看版本 [root192 ansible]# ansible --version ansible 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 location /usr/lib/python2.7/site-packages/ansibleexecutable location /usr/bin/ansiblepython version 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]三、修改配置文件 /etc/ansible/hosts主机列表清单也叫Inventory。 所有被管理的主机都需要定义在该文件中。 如果不想使用默认清单的话可以用-i选项指定自定义的清单文件防止多人混合使用一个主机清单。 如果没有定义在主机列表文件中执行命令会提示“No hosts matched”。 /etc/ansible/ansible.cfgAnsible服务主配置文件比如并发数控制等在此文件定义。 1、修改hosts文件 [root192 ansible]# vim k8s-hosts [master] 192.168.100.15[node] 192.168.100.16 192.168.100.17[harbor] 192.168.100.20[k8s] 192.168.100.212、使用ssh免密访问 [rootansible ~]# ssh-keygen -t rsa //执行后按三次回车键 [rootansible ~]# ssh-copy-id root192.168.100.20 [rootansible ~]# ssh-copy-id root192.168.100.21四、ansible模块 调用模块颜色显示 黄色 更改成功 绿色 没有更改 红色 错误 紫色 警告列出所有模块 ansible-doc --list1.command ansible查看harbor主机的主机名称 [root192 ansible]# ansible -i k8s-hosts harbor -m command -a hostname [WARNING]: Platform linux on host 192.168.100.20 is using the discovered Python interpreter at /usr/bin/python3, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. 192.168.100.20 | CHANGED | rc0 yunwei.harbor.com #ansible创建web主机用户test [root192 ansible]# ansible -i k8s-hosts harbor -m command -a useradd test [WARNING]: Platform linux on host 192.168.100.20 is using the discovered Python interpreter at /usr/bin/python3, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. 192.168.100.20 | CHANGED | rc0 2.shell command的升级版支持复杂语句但不支持别名。正常情况下使用shell就可以了command可以忽略 [root192 ansible]# ansible -i k8s-hosts harbor -m shell -a echo 123 | passwd --stdin test 192.168.100.20 | CHANGED | rc0 更改用户 test 的密码 。 passwd所有的身份验证令牌已经成功更新。3.yum harbor主机yum安装nginx服务。 [root192 ansible]# ansible -i k8s-hosts harbor -m yum -a namenginx stateinstalled 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,msg: ,rc: 0,results: [Installed: nginx-mod-mail-1:1.21.5-5.oe2203sp2.x86_64,Installed: nginx-mod-stream-1:1.21.5-5.oe2203sp2.x86_64,Installed: libwebp-1.2.1-4.oe2203sp2.x86_64,Installed: libxslt-1.1.37-1.oe2203sp2.x86_64,Installed: gd-2.3.3-3.oe2203sp2.x86_64,Installed: gperftools-libs-2.10-1.oe2203sp2.x86_64,Installed: libunwind-2:1.6.2-5.oe2203sp2.x86_64,Installed: libXpm-3.5.13-5.oe2203sp2.x86_64,Installed: nginx-1:1.21.5-5.oe2203sp2.x86_64,Installed: nginx-all-modules-1:1.21.5-5.oe2203sp2.noarch,Installed: nginx-filesystem-1:1.21.5-5.oe2203sp2.noarch,Installed: nginx-mod-http-image-filter-1:1.21.5-5.oe2203sp2.x86_64,Installed: nginx-mod-http-perl-1:1.21.5-5.oe2203sp2.x86_64,Installed: nginx-mod-http-xslt-filter-1:1.21.5-5.oe2203sp2.x86_64] }4.copy 复制ansible本地hosts文件到harbor的主机。 [root192 ansible]# ansible -i k8s-hosts harbor -m copy -a src/home/admin/xunjian.sh dest/home/admin/xunjian.sh mode755 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,checksum: edabfe7d12be113132cb753bca4b2257f56729b1,dest: /home/admin/xunjian.sh,gid: 0,group: root,md5sum: a6c55dfc444995f85d01ef50e444eb53,mode: 0755,owner: root,size: 9594,src: /root/.ansible/tmp/ansible-tmp-1697897996.12-19512-73839827124674/source,state: file,uid: 0 }注释src 源文件路径dest 目标文件路径backup 覆盖到目标文件前是否提前备份content 添加文件内容group 指定属组owner 指定属主mode 指定权限 [root192 ansible]# ansible -i k8s-hosts harbor -m shell -a ls /home/admin 192.168.100.20 | CHANGED | rc0 harbor xunjian.sh5.service(或systemd) 启动harbor主机的nginx服务实现开机自启 [root192 ansible]# ansible -i k8s-hosts harbor -m service -a enabledtrue namenginx statestarted 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,enabled: true,name: nginx,state: started,status: {ActiveEnterTimestamp: n/a,ActiveEnterTimestampMonotonic: 0,ActiveExitTimestamp: n/a,ActiveExitTimestampMonotonic: 0,ActiveState: inactive,After: sysinit.target tmp.mount remote-fs.target -.mount network.target system.slice systemd-journald.socket systemd-tmpfiles-setup.service basic.target nss-lookup.target, #enabled是否开机自启动取值为true或者false。 #name服务名称 #state状态取值有startedstoppedrestarted6.group 1在harbor主机上创建组www,gid 666 [root192 ansible]# ansible -i k8s-hosts harbor -m group -a namewww gid666 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,gid: 666,name: www,state: present,system: false } 2在harbor主机删除组www [root192 ansible]# ansible -i k8s-hosts harbor -m group -a namewww gid666 stateabsent 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,name: www,state: absent }7.user 1所有主机创建用户abc [root192 ansible]# ansible -i k8s-hosts harbor -m user -a nameabc 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,comment: ,create_home: true,group: 1005,home: /home/abc,name: abc,shell: /bin/bash,state: present,system: false,uid: 1005 }8.file 1创建backup目录并赋权更改属主属组 [root192 ansible]# ansible -i k8s-hosts harbor -m file -a path/backup ownerroot grouproot recurseyes mode777 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,gid: 0,group: root,mode: 0777,owner: root,path: /backup,size: 4096,state: directory,uid: 0 } 2创建test.txt文件file模块可以创建目录又能创建文件 [root192 ansible]# ansible -i k8s-hosts harbor -m file -a path/backup/test.txt ownerroot grouproot statetouch mode777 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,dest: /backup/test.txt,gid: 0,group: root,mode: 0777,owner: root,size: 0,state: file,uid: 0 }9.ping [root192 ansible]# ansible -i k8s-hosts demo -m ping 192.168.100.20 | SUCCESS {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: false,ping: pong } 192.168.100.21 | SUCCESS {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: false,ping: pong }10.script 在ansible上编写测试脚本指定harbor主机执行。 [root192 ansible]# ansible -i k8s-hosts harbor -m script -a /home/admin/dir.sh 192.168.100.20 | CHANGED {changed: true,rc: 0,stderr: Shared connection to 192.168.100.20 closed.\r\n,stderr_lines: [Shared connection to 192.168.100.20 closed.],stdout: ,stdout_lines: [] }11.cron [root192 ansible]# ansible -i k8s-hosts harbor -m cron -a minute*/10 job/bin/echo test nametest cron job 192.168.100.20 | CHANGED {ansible_facts: {discovered_interpreter_python: /usr/bin/python3},changed: true,envs: [],jobs: [test cron job] }12.setup 收集被管理主机的信息包含系统版本、IP地址、CPU核心数。 [root192 ansible]# ansible -i k8s-hosts harbor -m setup 192.168.100.20 | SUCCESS {ansible_facts: {ansible_all_ipv4_addresses: [192.168.100.20,172.17.0.1],ansible_all_ipv6_addresses: [fe80::20c:29ff:fe5a:c40d],ansible_apparmor: {status: disabled},ansible_architecture: x86_64,ansible_bios_date: 11/12/2020,ansible_bios_version: 6.00,ansible_cmdline: {BOOT_IMAGE: /vmlinuz-5.10.0-153.12.0.92.oe2203sp2.x86_64,apparmor: 0,cgroup_disable: files,crashkernel: 512M,rd.lvm.lv: openeuler/swap,resume: /dev/mapper/openeuler-swap,ro: true,root: /dev/mapper/openeuler-root},
http://www.hkea.cn/news/14517872/

相关文章:

  • 基于php电子商务网站开发开发一款手机app软件需要多少钱
  • 如何防范钓鱼网站手机端网站建设公司
  • 怎样做网站店铺cms网站模板
  • 网站建设拟解决问题互动型网站成功例子
  • 黑龙省建设厅网站首页永久免费观看不收费的软件app
  • 沈阳关键词网站排名百度做网站怎么样
  • 零基础网站开发要学多久什么网站可以做自媒体
  • 开网站怎么开整合营销传播之父
  • 网站模板中企动力wordpress封装app
  • 更换网站域名 推广介休门户网站
  • 织梦可以做视频网站么网站建设前期规划方案范文
  • 个人如何制作一个网站wordpress 自动标签
  • 江门网页建站模板房地产小程序开发
  • a站网址是什么网页制作基础教程第二版cc6照片
  • 个人网站建设教程 ppt重庆建筑行业认证培训网
  • 公司网站如何在百度上能搜索到wordpress ajax登录
  • 深圳高端网站设计建设福州建设高端网站
  • 网站建设公司哪家好 皆来磐石网络手机360优化大师官网
  • 自贸区网站建设wordpress显示作者信息
  • 正规网站建设首选公司郴州58同城
  • 网站焦点图怎么做链接建设有限公司网站
  • wordpress admin 密码seo优化总结
  • 长寿做网站北京app制作开发
  • 织梦cms官方网站wordpress 只有英文版
  • 学校网站建设招标公告深圳营销型网站建设设计公司
  • 做网站开发的过程asp.net ftp发布网站
  • 管理课程培训视频教程全集网站seo优化有哪些
  • 搭建网站的必须条件tp框架做展示网站
  • 用别人公司域名做网站网站开发方法是什么
  • 连云港做网站建设html教学网站