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

怎样建立自己的视频号网站建设与优化推广方案

怎样建立自己的视频号,网站建设与优化推广方案,邯郸市中小学健康管理平台登录,源码购买网站目录常规操作系统发行版与操作系统家族1. RedHat 发行版家族2. Debian 发行版家族3. Suse 发行版家族4. Gentoo 发行版家族5. Archlinux 发行版家族6. Mandrake 发行版家族7. Solaris 发行版家族8. AIX9. Alpine 操作系统家族10. macOS – Darwin11. FreeBSD12. HP-UX13. Windo…

目录

  • 常规操作系统发行版与操作系统家族
    • 1. RedHat 发行版家族
    • 2. Debian 发行版家族
    • 3. Suse 发行版家族
    • 4. Gentoo 发行版家族
    • 5. Archlinux 发行版家族
    • 6. Mandrake 发行版家族
    • 7. Solaris 发行版家族
    • 8. AIX
    • 9. Alpine 操作系统家族
    • 10. macOS – Darwin
    • 11. FreeBSD
    • 12. HP-UX
    • 13. Windows
    • 14. 其他发行版示例
    • 15. ansible变量的两种使用方式 - ansible_facts字典引用、ansible_xxx_xxx变量名

Ansible是系统管理员、开发工程师、网络工程师等常用的自动化工具,通过编写Playbook,可以执行不同的管理任务。当需要根据不同的操作系统执行对应的操作的时候,就需要在Playbook中提前对目标操作系统进行检测,此时就需要用到ansible的内置变量 - facts的值。通过判断变量 ansible_facts['os_family']或者 ansible_facts[distribution]实现对远程被控主机操作系统家族以及发行版的检测。

在这里插入图片描述

常规操作系统发行版与操作系统家族

1. RedHat 发行版家族

下面的发行版均是来自RedHat 操作系统家族的成员:

  • RedHat
  • CentOS
  • Fedora
  • Scientific
  • CloudLinux
  • OracleLinux
  • Amazon
  • XenServer
  • OpenEuler

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "RedHat" # CentOS 8, CentOS 7,Fedora 33, Amazon Linux 2, e.t.c# ansible_distribution
when: ansible_facts['distribution'] == "CentOS" # CentOS 8,7,6
when: ansible_facts['distribution'] == "Amazon" # Amazon Linux
when: ansible_facts['distribution'] == "Fedora" # Fedora 33,32,31,..
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8") # CentOS 8 only

2. Debian 发行版家族

Debian家族的发行版成员主要如下:

  • Debian
  • Ubuntu

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Debian" # Debian 10,9,..,Ubuntu 20.04,18.04,e.t.c# ansible_distribution
when: ansible_facts['distribution'] == "Debian" # Debian 10,9,8,..
when: ansible_facts['distribution'] == "Ubuntu" # Ubuntu 20.04, 18.04, 16.04,..
when: (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "10") # Only Debian 10
when: (ansible_facts['distribution'] == "Ubuntu" and ansible_facts['distribution_major_version'] == "20") # Only Ubuntu 20.04

3. Suse 发行版家族

SUSE发行版系列的主要成员如下:

  • SUSE
  • SLED – SUSE Linux Enterprise Desktop
  • SLES – SUSE Linux Enterprise Server

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Suse"# ansible_distribution
when: ansible_facts['distribution'] == "SLES"

4. Gentoo 发行版家族

主要成员如下:

  • Gentoo

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Gentoo"# ansible_distribution
when: ansible_facts['distribution'] == "Gentoo"

5. Archlinux 发行版家族

主要成员如下:

  • Archlinux

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Archlinux"# ansible_distribution
when: ansible_facts['distribution'] == "Archlinux"

6. Mandrake 发行版家族

主要成员如下:

  • Mandriva

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Mandrake"# ansible_distribution
when: ansible_facts['distribution'] == "Mandriva"

7. Solaris 发行版家族

主要成员如下:

  • Solaris
  • Nexenta
  • OmniOS
  • OpenIndiana
  • SmartOS

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Solaris"# ansible_distribution
when: ansible_facts['distribution'] == "OmniOS"
when: ansible_facts['distribution'] == "SmartOS"

8. AIX

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "AIX"

9. Alpine 操作系统家族

主要成员如下:

  • Alpine Linux

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Alpine"# ansible_distribution
when: ansible_facts['distribution'] == "Alpine"

10. macOS – Darwin

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Darwin"

11. FreeBSD

主要成员如下:

  • FreeBSD

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "FreeBSD"

12. HP-UX

主要成员如下:

  • HP-UX

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "HP-UX"

13. Windows

检测操作系统家族和发行版的使用方式如下:

# ansible_os_family
when: ansible_facts['os_family'] == "Windows"

14. 其他发行版示例

  • VMware ESXi
    检测操作系统家族和发行版的使用方式如下:
# ansible_distribution
when: ansible_facts['distribution'] == "VMwareESX"
  • OpenWrt
    检测操作系统家族和发行版的使用方式如下:
# ansible_distribution
when: ansible_facts['distribution'] == "OpenWrt"
  • CoreOS
    检测操作系统家族和发行版的使用方式如下:
# ansible_distribution
when: ansible_facts['distribution'] == "Coreos"
  • ALT Linux
    检测操作系统家族和发行版的使用方式如下:
# ansible_distribution
when: ansible_facts['distribution'] == "Altlinux"

15. ansible变量的两种使用方式 - ansible_facts字典引用、ansible_xxx_xxx变量名

除了上述的通过ansible_facts内置变量查询操作系统发行版的方式之外,还可以通过setup模块输出的完整变量名的方式来查询。具体如下:

列出所有的facts变量:

albertqee@ZBG7W:postgresql-17.5$ ansible all -i 'u24u04s1,' -m setup | egrep family
[WARNING]: Platform linux on host u24u04s1 is using the discovered Python
interpreter at /usr/bin/python3.12, but future installation of another Python
interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.18/reference_appendices/interpreter_discovery.html for more information."ansible_os_family": "Debian",
albertqee@ZBG7W:postgresql-17.5$

在playbook中使用两种方式列出操作系统发行版:

#*************************************************************************
#    > File Name: main.yml
#    > Author: Albert Qee
#    > Created Time: 2025年07月25日 星期五 22时25分19秒
#    > Description: get os family
#    > Usage: ansible-playbook -i 'u24u04s1,' main.yml 
# ************************************************************************- hosts: all remote_user: rootgather_facts: truetasks:- name: display ip addressdebug:msg: "The IP address is {{ ansible_default_ipv4['address'] }}"  - name: display os familydebug:var: ansible_facts['os_family']          # ansible_facts[]字典的形式引用,此时索引名不带前缀的ansible_- name: another way to disply os familydebug:var: ansible_os_family                   # 直接使用setup模块输出的完整变量名的形式引用变量,此时变量名带前缀的ansible_

上述playbook的执行结果如下:

albertqee@ZBG7W:potgresql$ ansible-playbook -i 'u24u04s1,' main.yml PLAY [all] ***********************************************************************************************************************************************************************************TASK [Gathering Facts] ***********************************************************************************************************************************************************************
[WARNING]: Platform linux on host u24u04s1 is using the discovered Python interpreter at /usr/bin/python3.12, but future installation of another Python interpreter could change the meaning
of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
ok: [u24u04s1]TASK [display ip address] ********************************************************************************************************************************************************************
ok: [u24u04s1] => {"msg": "The IP address is 192.168.122.125"
}TASK [display os family] *********************************************************************************************************************************************************************
ok: [u24u04s1] => {"ansible_facts['os_family']": "Debian"            # 通过ansible_facts['os_family]这种ansible_facts字典的方式引用
}TASK [another way to disply os family] *******************************************************************************************************************************************************
ok: [u24u04s1] => {"ansible_os_family": "Debian"                     # 通过直接的完整变量名的方式引用
}PLAY RECAP ***********************************************************************************************************************************************************************************
u24u04s1                   : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   albertqee@ZBG7W:potgresql$
http://www.dtcms.com/a/590451.html

相关文章:

  • 俱乐部手机网站模板做网站做得好的公司
  • Flume安装部署
  • 最新版T5友价互站网源码商城PHP源码交易平台 完整带手机版源码网系统源码
  • 化学商城网站建设做网站有底薪吗
  • 树莓派4B使用指南
  • c语言做网站后台建设部中国建造师网查询
  • Overleaf——编译超时(timed out)的解决办法
  • 网站推广如何做的深圳市注册公司需要什么资料
  • 做电子商务网站建设工资多少钱网站站内链接怎么做
  • Java中同步和异步的区别,以及阻塞和非阻塞的区别
  • 电子商务网站建设问题公司网站制作知乎
  • 科研人如何使用ubantu服务器
  • o2o网站建设手机网站大全123456
  • 【Web安全】JeecgBoot框架SRC高频漏洞分析总结
  • 花都微网站建设北京网站制作出名 乐云践新
  • 路径总和(C)
  • 网站模版怎么样网站内容一样影响收录
  • 网站开发怎么接入支付宝中山企业网站的建设
  • 做网站参考文献河北网站建设价格低
  • 天河建设网站报价网页打不开qq可以上qq
  • 郑州网站推广电话wordpress发布文章 自定义栏目
  • 深圳市住房和城乡建设局网站首页静态网站建设背景
  • 做编程的网站有哪些大航母网站建设案例
  • 青岛制作企业网站百度信誉任何在网站展示
  • 深入浅出 Ascend C:新一代算子开发接口 Aclnn 原理解析与实践
  • 山西省洪涝灾害应急物资体系优化研究 - 核心章节建模与算法实施方案
  • 做生物学的网站平板室内装修设计软件
  • 为什么要建设个人网站网站建设优惠活动
  • 八.Docker-compose容器编排-生产环境用Kubernetes替代
  • ComfyUI高级应用之图片放大