RedHat Red Hat Certified Engineer (RHCE) exam for Red Hat Enterprise Linux 8 Exam (EX294日本語版) - EX294日本語 Exam Practice Test
毎日正午に /root/datefile に日付を追加するシステムを持つ、regulartasks.yml という Playbook を作成します。名前はジョブ「datejob」です
Correct Answer:
解決策:


/home/sandy/ansible に issue.yml という Playbook を作成します。これにより、すべての管理対象ノードのファイル /etc/issue が変更されます。 Test" ホストが prod のメンバーである場合は、"Production" と記述します。
Correct Answer:
解決策:


次のように、web.yml という Playbook を作成します。
* Playbook は「dev」ホスト グループの管理対象ノードで実行されます
* 次の要件でディレクトリ /webdev を作成します。
--> apache グループのメンバーシップ
--> 通常のパーミッション: owner=r+w+execute, group=r+w+execute, other=r+execute
sp=グループ ID を設定
* /var/www/html/webdev を /webdev にシンボリックにリンクします
* 次の 1 行のテキストを含むファイル /webdev/index.html を作成します。
"発達"
--> http://servera.lab.example.com/webdev/index.html で利用できるはずです
* Playbook は「dev」ホスト グループの管理対象ノードで実行されます
* 次の要件でディレクトリ /webdev を作成します。
--> apache グループのメンバーシップ
--> 通常のパーミッション: owner=r+w+execute, group=r+w+execute, other=r+execute
sp=グループ ID を設定
* /var/www/html/webdev を /webdev にシンボリックにリンクします
* 次の 1 行のテキストを含むファイル /webdev/index.html を作成します。
"発達"
--> http://servera.lab.example.com/webdev/index.html で利用できるはずです
Correct Answer:
解決策:
# pwd
/ホーム/管理者/アンシブル/
# vim web.yml
---
- 名前:
ホスト: dev
タスク:
- 名前: グループを作成
うーん:
名前: httpd
状態: 最新
- 名前: グループを作成
グループ:
名前:アパッチ
状態: 現在
- 名前: 作成ディレクトリ
ファイル:
パス: /webdev
状態: ディレクトリ
モード: '2775'
グループ: アパッチ
- セフコンテキスト:
ターゲット: '/webdev/index.html'
タイプ: httpd_sys_content_t
状態: 現在
- name: 新しい SELinux ファイル コンテキストをファイル システムに適用します。
コマンド: restorecon -irv
- 名前: シンボリック リンクの作成
ファイル:
ソース: /webdev
宛先: /var/www/html/webdev
状態: リンク
力: はい
- 名前: 作成中のファイル
ファイル:
パス: /webdev/index.html
状態: タッチ
- 名前: index.html ファイルにコンテンツを追加する
コピー:
宛先: /webdev/index.html
内容:「開発」
- name: ファイアウォールにサービスを追加
ファイアウォール:
サービス: http
永久: はい
状態: 有効
即時: はい
- 名前: アクティブな http サービス
サービス:
名前: httpd
状態:再起動
有効: はい
:wq
# ansible-playbook web.yml --syntax-check
# ansible-playbook web.yml
# pwd
/ホーム/管理者/アンシブル/
# vim web.yml
---
- 名前:
ホスト: dev
タスク:
- 名前: グループを作成
うーん:
名前: httpd
状態: 最新
- 名前: グループを作成
グループ:
名前:アパッチ
状態: 現在
- 名前: 作成ディレクトリ
ファイル:
パス: /webdev
状態: ディレクトリ
モード: '2775'
グループ: アパッチ
- セフコンテキスト:
ターゲット: '/webdev/index.html'
タイプ: httpd_sys_content_t
状態: 現在
- name: 新しい SELinux ファイル コンテキストをファイル システムに適用します。
コマンド: restorecon -irv
- 名前: シンボリック リンクの作成
ファイル:
ソース: /webdev
宛先: /var/www/html/webdev
状態: リンク
力: はい
- 名前: 作成中のファイル
ファイル:
パス: /webdev/index.html
状態: タッチ
- 名前: index.html ファイルにコンテンツを追加する
コピー:
宛先: /webdev/index.html
内容:「開発」
- name: ファイアウォールにサービスを追加
ファイアウォール:
サービス: http
永久: はい
状態: 有効
即時: はい
- 名前: アクティブな http サービス
サービス:
名前: httpd
状態:再起動
有効: はい
:wq
# ansible-playbook web.yml --syntax-check
# ansible-playbook web.yml
ansible のインストールと構成
ユーザー bob がコントロール ノードに作成されました。制御ノードに対する適切な権限を彼に付与します。コントロール ノードで ansible を実行するために必要なパッケージをインストールします。
次の要件を満たすように、構成ファイル /home/bob/ansible/ansible.cfg を作成します。
* ロール パスには、/home/bob/ansible/roles と、サンプル試験のコースで必要になる可能性のあるその他のパスを含める必要があります。
* インベントリ ファイルのパスは /home/bob/ansible/inventory です。
* Ansible は、一度に 10 台のホストを管理できる必要があります。
* Ansible は、bob ユーザーを使用してすべての管理対象ノードに接続する必要があります。
次の 5 つのノードのインベントリ ファイルを作成します。
nodel.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
これらのノードを、node1 がグループ dev のメンバーであるインベントリ ファイルに配置するように構成します。nodc2 はグループ test のメンバー、nodc3 はグループ proxy のメンバー、nodc4 とノード 5 はグループ prod のメンバーです。また、prod はグループ webservers のメンバーです。
ユーザー bob がコントロール ノードに作成されました。制御ノードに対する適切な権限を彼に付与します。コントロール ノードで ansible を実行するために必要なパッケージをインストールします。
次の要件を満たすように、構成ファイル /home/bob/ansible/ansible.cfg を作成します。
* ロール パスには、/home/bob/ansible/roles と、サンプル試験のコースで必要になる可能性のあるその他のパスを含める必要があります。
* インベントリ ファイルのパスは /home/bob/ansible/inventory です。
* Ansible は、一度に 10 台のホストを管理できる必要があります。
* Ansible は、bob ユーザーを使用してすべての管理対象ノードに接続する必要があります。
次の 5 つのノードのインベントリ ファイルを作成します。
nodel.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
これらのノードを、node1 がグループ dev のメンバーであるインベントリ ファイルに配置するように構成します。nodc2 はグループ test のメンバー、nodc3 はグループ proxy のメンバー、nodc4 とノード 5 はグループ prod のメンバーです。また、prod はグループ webservers のメンバーです。
Correct Answer:
/home/sandy/ansible/ansible.cfg 内
[デフォルト]
inventory=/home/sandy/ansible/inventory
roles_path=/home/sandy/ansible/roles
remote_user=砂
host_key_checking=false
【特典】
なる=真
become_user=ルート
become_method=sudo
become_ask_pass=false
/home/sandy/ansible/inventory 内
[開発]
ノード 1 .example.com
[テスト]
node2.example.com
[プロキシー]
node3 .example.com
[製品]
node4.example.com
node5 .example.com
[ウェブサーバー:子]
製品
[デフォルト]
inventory=/home/sandy/ansible/inventory
roles_path=/home/sandy/ansible/roles
remote_user=砂
host_key_checking=false
【特典】
なる=真
become_user=ルート
become_method=sudo
become_ask_pass=false
/home/sandy/ansible/inventory 内
[開発]
ノード 1 .example.com
[テスト]
node2.example.com
[プロキシー]
node3 .example.com
[製品]
node4.example.com
node5 .example.com
[ウェブサーバー:子]
製品