37.4. IdM 호스트 그룹에 ID 보기 적용

ipa idview-apply 명령은 --hostgroups 옵션을 허용합니다. 그러나 옵션은 현재 지정된 호스트 그룹에 속하는 호스트에 ID 보기를 적용하는 일회성 작업으로 작동하지만 ID 뷰를 호스트 그룹 자체와 동적으로 연관하지는 않습니다. --hostgroups 옵션은 지정된 호스트 그룹의 멤버를 확장하고 --hosts 옵션을 개별적으로 해당 그룹에 적용합니다.

나중에 호스트 그룹에 새 호스트를 추가하는 경우 --hosts 옵션과 함께 ipa idview-apply 명령을 사용하여 ID 보기를 새 호스트에 수동으로 적용해야 합니다.

마찬가지로 호스트 그룹에서 호스트를 제거해도 제거 후에도 ID 보기가 호스트에 계속 할당됩니다. 제거된 호스트에서 ID 보기를 적용 취소하려면 ipa idview-unapply id_view_name --hosts=name_of_the_removed_host 명령을 실행해야 합니다.

다음 목표를 달성하려면 다음 절차를 따르십시오.

  1. 호스트 그룹을 생성하고 여기에 호스트를 추가하는 방법.
  2. 호스트 그룹에 ID 보기를 적용하는 방법.
  3. 호스트 그룹에 새 호스트를 추가하고 ID 보기를 새 호스트에 적용하는 방법.

사전 요구 사항

절차

  1. 호스트 그룹을 생성하고 여기에 호스트를 추가합니다.

    1. 호스트 그룹을 생성합니다. 예를 들어 이름이 baltimore 인 호스트 그룹을 생성하려면 다음을 수행합니다.

      [root@server ~]# ipa hostgroup-add --desc="Baltimore hosts" baltimore
      ---------------------------
      Added hostgroup "baltimore"
      ---------------------------
      Host-group: baltimore
      Description: Baltimore hosts
    2. 호스트 그룹에 호스트를 추가합니다. 예를 들어 host102host103baltimore 호스트 그룹에 추가하려면 다음을 수행합니다.

      [root@server ~]# ipa hostgroup-add-member --hosts={host102,host103} baltimore
      Host-group: baltimore
      Description: Baltimore hosts
      Member hosts: host102.idm.example.com, host103.idm.example.com
      -------------------------
      Number of members added 2
      -------------------------
  2. 호스트 그룹의 호스트에 ID 보기를 적용합니다. 예를 들어 example_for_host1 ID 보기를 baltimore 호스트 그룹에 적용하려면 다음을 수행합니다.

    [root@server ~]# ipa idview-apply --hostgroups=baltimore
    ID View Name: example_for_host1
    -----------------------------------------
    Applied ID View "example_for_host1"
    -----------------------------------------
      hosts: host102.idm.example.com, host103.idm.example.com
    ---------------------------------------------
    Number of hosts the ID View was applied to: 2
    ---------------------------------------------
  3. 새 호스트를 호스트 그룹에 추가하고 ID 보기를 새 호스트에 적용합니다.

    1. 호스트 그룹에 새 호스트를 추가합니다. 예를 들어 somehost.idm.example.com 호스트를 baltimore 호스트 그룹에 추가하려면 다음을 수행합니다.

      [root@server ~]# ipa hostgroup-add-member --hosts=somehost.idm.example.com baltimore
        Host-group: baltimore
        Description: Baltimore hosts
        Member hosts:  host102.idm.example.com, host103.idm.example.com,somehost.idm.example.com
      -------------------------
      Number of members added 1
      -------------------------
    2. 선택적으로 ID 보기 정보를 표시합니다. 예를 들어 example_for_host1 ID 보기에 대한 세부 정보를 표시하려면 다음을 수행합니다.

      [root@server ~]# ipa idview-show example_for_host1 --all
        dn: cn=example_for_host1,cn=views,cn=accounts,dc=idm,dc=example,dc=com
        ID View Name: example_for_host1
      [...]
        Hosts the view applies to: host102.idm.example.com, host103.idm.example.com
        objectclass: ipaIDView, top, nsContainer

      출력에서 ID 보기가 baltimore 호스트 그룹의 새로 추가된 호스트인 somehost.idm.example.com 에 적용되지 않음을 보여줍니다.

    3. 새 호스트에 ID 뷰를 적용합니다. 예를 들어 example_for_host1 ID 보기를 somehost.idm.example.com 에 적용하려면 다음을 수행합니다.

      [root@server ~]# ipa idview-apply --host=somehost.idm.example.com
      ID View Name: example_for_host1
      -----------------------------------------
      Applied ID View "example_for_host1"
      -----------------------------------------
        hosts: somehost.idm.example.com
      ---------------------------------------------
      Number of hosts the ID View was applied to: 1
      ---------------------------------------------

검증 단계

  • ID 보기 정보를 다시 표시합니다.

    [root@server ~]# ipa idview-show example_for_host1 --all
      dn: cn=example_for_host1,cn=views,cn=accounts,dc=idm,dc=example,dc=com
      ID View Name: example_for_host1
    [...]
      Hosts the view applies to: host102.idm.example.com, host103.idm.example.com, somehost.idm.example.com
      objectclass: ipaIDView, top, nsContainer

    출력에 ID 보기가 baltimore 호스트 그룹에 새로 추가된 호스트인 somehost.idm.example.com 에 적용됨을 보여줍니다.