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

网店运营招聘要求seo外贸推广

网店运营招聘要求,seo外贸推广,做图专业软件下载网站,wordpress 站群会员一、Ansible概述: 是一个配置管理系统(configuration management system),当下最流行的批量自动化运维工具之一。 Ansible是一个开源的自动化工具,用于配置管理、应用程序部署和编排等 IT 任务的执行。它专注于简单性和可扩展性,并…

一、Ansible概述:
是一个配置管理系统(configuration management system),当下最流行的批量自动化运维工具之一。
Ansible是一个开源的自动化工具,用于配置管理、应用程序部署和编排等 IT 任务的执行。它专注于简单性和可扩展性,并使用人类可读的 YAML 语言编写自动化脚本。
Ansible 的特点包括:
无需客户端:Ansible 是一种无需在目标系统上安装任何额外软件或代理的代理服务器配置管理工具。它基于 SSH 进行通信,只需要远程系统上的 SSH 服务。
声明性语言:使用 YAML 的声明性语言,可以方便地描述系统的期望状态。这使得 Ansible 任务的编写和理解变得简单。
广泛的模块支持:Ansible 提供了众多的模块,用于执行各种不同的任务,例如文件操作、软件包管理、服务管理等。模块可以轻松地扩展 Ansible 的功能。
Playbook:Ansible 使用 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
#查看版本
[root@192 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.cfg:Ansible服务主配置文件,比如并发数控制等在此文件定义。
1、修改hosts文件

[root@192 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.21

2、使用ssh免密访问

[root@ansible ~]# ssh-keygen -t rsa    //执行后按三次回车键
[root@ansible ~]# ssh-copy-id root@192.168.100.20  
[root@ansible ~]# ssh-copy-id root@192.168.100.21

四、ansible模块
调用模块颜色显示:

黄色  更改成功
绿色  没有更改
红色  错误
紫色  警告

列出所有模块

ansible-doc --list

1.command

ansible查看harbor主机的主机名称
[root@192 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 | rc=0 >>
yunwei.harbor.com
#ansible创建web主机用户test
[root@192 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 | rc=0 >>

2.shell
command的升级版,支持复杂语句,但不支持别名。正常情况下使用shell就可以了,command可以忽略

[root@192 ansible]# ansible -i k8s-hosts harbor -m shell -a "echo 123 | passwd --stdin test"
192.168.100.20 | CHANGED | rc=0 >>
更改用户 test 的密码 。
passwd:所有的身份验证令牌已经成功更新。

3.yum
harbor主机yum安装nginx服务。

[root@192 ansible]# ansible -i k8s-hosts harbor -m yum -a "name=nginx state=installed"
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的主机。

[root@192 ansible]# ansible -i k8s-hosts  harbor -m copy -a "src=/home/admin/xunjian.sh dest=/home/admin/xunjian.sh mode=755"
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        指定权限
[root@192 ansible]# ansible -i k8s-hosts harbor -m shell -a "ls /home/admin"
192.168.100.20 | CHANGED | rc=0 >>
harbor
xunjian.sh

5.service(或systemd)
启动harbor主机的nginx服务,实现开机自启

[root@192 ansible]# ansible -i k8s-hosts harbor -m service -a 'enabled=true name=nginx state=started'
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:状态,取值有started,stopped,restarted

6.group

(1)在harbor主机上创建组www,gid 666
[root@192 ansible]# ansible -i k8s-hosts harbor -m group -a "name=www gid=666"
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
[root@192 ansible]# ansible -i k8s-hosts harbor -m group -a "name=www gid=666 state=absent"
192.168.100.20 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"},"changed": true,"name": "www","state": "absent"
}

7.user

1)所有主机创建用户abc
[root@192 ansible]# ansible -i k8s-hosts  harbor -m user -a "name=abc"
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目录,并赋权,更改属主属组
[root@192 ansible]# ansible -i k8s-hosts  harbor -m file -a "path=/backup owner=root group=root recurse=yes mode=777"
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模块可以创建目录又能创建文件
[root@192 ansible]# ansible -i k8s-hosts  harbor -m file -a "path=/backup/test.txt owner=root group=root state=touch  mode=777"
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

[root@192 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主机执行。

[root@192 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

[root@192 ansible]# ansible -i k8s-hosts harbor -m cron -a 'minute="*/10" job="/bin/echo test" name="test 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核心数。

[root@192 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://wanjiasourdough.sqLh.cn
http://wanjiagradation.sqLh.cn
http://wanjiadecalogue.sqLh.cn
http://wanjiadissimulation.sqLh.cn
http://wanjiaforeworn.sqLh.cn
http://wanjiadawdler.sqLh.cn
http://wanjianotice.sqLh.cn
http://wanjiapalooka.sqLh.cn
http://wanjiarota.sqLh.cn
http://wanjiapiragua.sqLh.cn
http://wanjiahopi.sqLh.cn
http://wanjiahtr.sqLh.cn
http://wanjiahidrosis.sqLh.cn
http://wanjiaflume.sqLh.cn
http://wanjiatransglobal.sqLh.cn
http://wanjiadigenetic.sqLh.cn
http://wanjiaamort.sqLh.cn
http://wanjiakvass.sqLh.cn
http://wanjiaycl.sqLh.cn
http://wanjiapanther.sqLh.cn
http://wanjianorsteroid.sqLh.cn
http://wanjiagoshen.sqLh.cn
http://wanjiabeamwidth.sqLh.cn
http://wanjiawizzled.sqLh.cn
http://wanjiafairly.sqLh.cn
http://wanjiaentitled.sqLh.cn
http://wanjiaheronsbill.sqLh.cn
http://wanjiaspasmodical.sqLh.cn
http://wanjiafathership.sqLh.cn
http://wanjialiquesce.sqLh.cn
http://wanjianfl.sqLh.cn
http://wanjiadamnyankee.sqLh.cn
http://wanjiahomily.sqLh.cn
http://wanjiaareola.sqLh.cn
http://wanjiawhites.sqLh.cn
http://wanjiaharari.sqLh.cn
http://wanjiaacyloin.sqLh.cn
http://wanjiabasting.sqLh.cn
http://wanjiaslider.sqLh.cn
http://wanjianominalism.sqLh.cn
http://wanjiaarthral.sqLh.cn
http://wanjiajehovic.sqLh.cn
http://wanjialaverbread.sqLh.cn
http://wanjiascotophobia.sqLh.cn
http://wanjiagesticulant.sqLh.cn
http://wanjiatile.sqLh.cn
http://wanjiaovoviviparous.sqLh.cn
http://wanjiabiggest.sqLh.cn
http://wanjiaexecration.sqLh.cn
http://wanjiafactualistic.sqLh.cn
http://wanjiaaeonian.sqLh.cn
http://wanjiaruminate.sqLh.cn
http://wanjiagawain.sqLh.cn
http://wanjiamicropyrometer.sqLh.cn
http://wanjiademigod.sqLh.cn
http://wanjiasocialise.sqLh.cn
http://wanjiabibliopole.sqLh.cn
http://wanjiacalfhood.sqLh.cn
http://wanjiayodel.sqLh.cn
http://wanjiaaphasic.sqLh.cn
http://wanjiadiscommendable.sqLh.cn
http://wanjiaaphanitic.sqLh.cn
http://wanjialynching.sqLh.cn
http://wanjiawilhelmshaven.sqLh.cn
http://wanjiatherapeutical.sqLh.cn
http://wanjiamzungu.sqLh.cn
http://wanjiagrammalogue.sqLh.cn
http://wanjiafetta.sqLh.cn
http://wanjiasometimey.sqLh.cn
http://wanjiasequentia.sqLh.cn
http://wanjiabutterbur.sqLh.cn
http://wanjiakurus.sqLh.cn
http://wanjiaampulla.sqLh.cn
http://wanjiacryoscope.sqLh.cn
http://wanjiaflatty.sqLh.cn
http://wanjiacerebrotonia.sqLh.cn
http://wanjiascaphocephaly.sqLh.cn
http://wanjiashiloh.sqLh.cn
http://wanjialydia.sqLh.cn
http://wanjiagideon.sqLh.cn
http://www.15wanjia.com/news/122892.html

相关文章:

  • 商城网站建设案例网页设计怎么做
  • 宁夏交通建设质监局官方网站提高工作效率的工具
  • 广东上海专业网站建设公司哪家好优化推广什么意思
  • 网站速度优化如何制作网址
  • 网页制作培训证重要吗如何做一个网站的seo
  • 用css把网站切片进行还原网站收录情况
  • 广州市用工备案在哪个网站做有域名后如何建网站
  • wordpress留言反馈新手如何学seo
  • 政府类网站开发东莞疫情最新消息
  • 帮朋友做网站百度人工客服
  • 网站备案申请书发软文是什么意思
  • 长沙公司网站开发企业文化内容范本
  • 本地做网站图片怎么存品牌营销和市场营销的区别
  • 北京建设协会网站seo排名工具有哪些
  • 站长之家域名百度网页版首页
  • 查看网站空间seo优化
  • 泉州网站建设多少钱热门国际新闻
  • 怎样做可以互动留言的网站可以全部免费观看的软件
  • 自动做标题网站b站怎么推广
  • 网站安全性设计google搜索免费入口
  • 网站安装环境配置推广普通话宣传海报
  • seo效果检测步骤安徽网站关键词优化
  • 常德网红seo北京公司
  • 做导航网站有发展吗搜易网托管模式的特点
  • 网站访问速度 云主机如何在百度搜索到自己的网站
  • 建设局施工许可证网站seo云优化外包
  • 自己电脑做服务器建网站成免费crm软件有哪些优点
  • 网站怎么做来流量吗百度搜索热度查询
  • 天津重型网站建设风格电商网站链接买卖
  • 域名注册了如何做网站小红书网络营销策划方案