RHEL 角色目錄

  1. 要使用 RHEL 系統角色,必須先將其 roles 目錄位置加到目前工作目錄下的 ansible.cfg。
    [deyu1@kvm19 ansible]$ vim ansible.cfg 
    [deyu1@kvm19 ansible]$ cat ansible.cfg
    [defaults]
    inventory  = /home/deyu1/ansible/inventory
    roles_path = /home/deyu1/ansible/roles:/usr/share/ansible/roles
    
  2. 列出 roles
    [deyu1@kvm19 ansible]$ ansible-galaxy list
    # /home/deyu1/ansible/roles
    # /usr/share/ansible/roles
    - linux-system-roles.timesync, (unknown version)
    - linux-system-roles.selinux, (unknown version)
    - linux-system-roles.postfix, (unknown version)
    - linux-system-roles.kdump, (unknown version)
    - linux-system-roles.network, (unknown version)
    - rhel-system-roles.kdump, (unknown version)
    - rhel-system-roles.timesync, (unknown version)
    - rhel-system-roles.network, (unknown version)
    - rhel-system-roles.postfix, (unknown version)
    - rhel-system-roles.selinux, (unknown version)