10.7.2.3. コマンドラインでのホストグループメンバーの追加
メンバーは、hostgroup-add-member コマンドを使用して、ホストグループに追加します。このコマンドは、両方のホストと、他のグループをグループメンバーとして追加できます。
hostgroup-add-member コマンドの構文では、追加するグループ名のコンマ区切りの一覧のみが必要になります。
ipa hostgroup-add-member groupName [--hosts=list] [--hostgroups=list]
$ ipa hostgroup-add-member groupName [--hosts=list] [--hostgroups=list]
たとえば、以下は、ホスト 3 つを caligroup グループに追加します。
ipa hostgroup-add-member caligroup --hosts=ipaserver.example.com,client1.example.com,client2.example.com
$ ipa hostgroup-add-member caligroup --hosts=ipaserver.example.com,client1.example.com,client2.example.com
Group name: caligroup
Description: for machines in california
GID: 387115842
Member hosts: ipaserver.example.com,client1.example.com,client2.example.com
-------------------------
Number of members added 3
-------------------------
同様に、他のグループをメンバーとして追加して、ネスト化されたグループを作成することもできます。
ipa hostgroup-add-member caligroup --groups=mountainview,sandiego
$ ipa hostgroup-add-member caligroup --groups=mountainview,sandiego
Group name: caligroup
Description: for machines in california
GID: 387115842
Member groups: mountainview,sandiego
-------------------------
Number of members added 2
-------------------------