EX294日本語問題集35問でRHCEを確実実践 [Q20-Q35]

Share

EX294日本語問題集35問でRHCEを確実実践

リアル最新EX294日本語試験問題EX294日本語問題集

質問 # 20
Create an Ansible vault to store user passwords as follows:
* The name of the vault is valut.yml
* The vault contains two variables as follows:
- dev_pass with value wakennym
- mgr_pass with value rocky
* The password to encrypt and decrypt the vault is atenorth
* The password is stored in the file /home/admin/ansible/password.txt

正解:

解説:
Solution as:
# pwd
/home/admin/ansible
# echo "atenorth" >password.txt
# chmod 0600 password.txt
# ansible-vault create vault.yml --vault-password-file=password.txt
---
- dev_pass: wakennym
- mgr_pass: rocky
:wq
# cat vault.yml
$ANSIBLE_VAULT;1.1;AES256
36383862376164316436353665343765643331393433373564613762666531313034336438353662
3464346331346461306337633632393563643531376139610a343531326130663266613533633562
38623439316631306463623761343939373263333134353264333834353264343934373765643737
3535303630626666370a643663366634383863393338616661666632353139306436316430616334
65386134393363643133363738656130636532346431376265613066326162643437643064313863
6633333537303334333437646163343666666132316639376531
# ansible-vault view vault.yml
password:******
---
- dev_pass: wakennym
- mgr_pass: rocky


質問 # 21
Modify file content.
------------------------
Create a playbook called /home/admin/ansible/modify.yml as follows:
* The playbook runs on all inventory hosts
* The playbook replaces the contents of /etc/issue with a single line of text as
follows:
--> On hosts in the dev host group, the line reads: "Development"
--> On hosts in the test host group, the line reads: "Test"
--> On hosts in the prod host group, the line reads: "Production"

正解:

解説:
Solution as:
# pwd
/home/admin/ansible
# vim modify.yml
---
- name:
hosts: all
tasks:
- name:
copy:
content: "Development"
dest: /etc/issue
when: inventory_hostname in groups['dev']
- name:
copy:
content: "Test"
dest: /etc/issue
when: inventory_hostname in groups['test']
- name:
copy:
content: "Production"
dest: /etc/issue
when: inventory_hostname in groups['prod']
:wq
# ansible-playbook modify.yml --syntax-check
# ansible-playbook modify.yml


質問 # 22
/ home / sandy / ansibleディレクトリにパスワードreallysafepwを使用してlock.ymlというansibleボールトパスワードファイルを作成します。 lock.ymlファイルで2つの変数を定義します。 1つはpw_devで、パスワードは「dev」で、もう1つはpw_mgrで、パスワードは「mgr」です。lock.ymlのパスワードを含むsecret.txtという通常のファイルを作成します。

  • A. ansible-vault create lock.yml
    新しいVaultパスワード:reallysafepw
    確認:reallysafepw
  • B. ansible-vault create lock.yml
    新しいVaultパスワード:reallysafepw

正解:A


質問 # 23
Create a playbook called issue.yml in /home/sandy/ansible which changes the file /etc/issue on all managed nodes: If host is a member of (lev then write "Development" If host is a member of test then write "Test" If host is a member of prod then write "Production"

正解:

解説:
Solution as:


質問 # 24
/ home / sandy / ansibleにpackages.ymlというファイルを作成して、次のホストのパッケージをインストールします。 devでは、prodおよびwebserversがパッケージhttpd、mod_ssl、およびmariadbをインストールします。開発では、開発ツールパッケージのみをインストールします。また、開発ホストですべてのパッケージを最新のものに更新します。

  • A. オプション

    **注1最新の状態をインストールするように求めていないため、より受け入れられる回答は「存在する」可能性があります:存在
    **注2は開発ノードを更新する必要があります
    -名前:開発ノードのすべてのパッケージを更新します
    ヤム:
    名前: '*'
    状態:最新
  • B. オプション

    **注1最新の状態をインストールするように求めていないため、より受け入れられる回答は「存在する」可能性があります:存在
    **注2は開発ノードを更新する必要があります
    -名前:開発ノードのすべてのパッケージを更新します
    ヤム:
    名前: '*'
    状態:最新

正解:A


質問 # 25
すべてのノードのデフォルトターゲットをマルチユーザーtarqetに変更するプレイブックを作成します。 / home / sandy / ansibleのtarget.ymlというプレイブックファイルでこれを行います

  • A. -名前:デフォルトのターゲットを変更
    ホスト:すべて
    タスク:
    -名前:ターゲットを変更します
    ファイル:
    src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link
  • B. - name: change default target
    hosts: all
    - name: change target
    file:
    src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link

正解:A


質問 # 26
Create a playbook that changes the default target on all nodes to multi-user tarqet. Do this in playbook file called target.yml in /home/sandy/ansible

正解:

解説:
- name: change default target
hosts: all
tasks:
- name: change target
file:
src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link


質問 # 27
Create a jinja template in /home/sandy/ansible/ and name it hosts.j2. Edit this file so it looks like the one below. The order of the nodes doesn't matter. Then create a playbook in /home/sandy/ansible called hosts.yml and install the template on dev node at /root/myhosts

正解:

解説:
Solution as:


質問 # 28
Create a playbook called regulartasks.yml which has the system that append the date to /root/datefile every day at noon. Name is job 'datejob'

正解:

解説:
Solution as:


質問 # 29
rhelシステムロールtimesyncを使用して、/ home / sandy / ansibleにtimesvnc.ymlというプレイブックを作成します。サーバー0.uk.pool.ntp.orgで現在構成されているニップを使用する時間を設定します。バーストを有効にします。すべてのホストでこれを実行します。

  • A. 解決策:
  • B. 解決策:

正解:A


質問 # 30
Create a playbook called hwreport.yml that produces an output file called /root/
hwreport.txt on all managed nodes with the following information:
------------------------------------------------------------------------------------------------------
--> Inventory host name
--> Total memory in MB
--> BIOS version
--> Size of disk device vda
--> Size of disk device vdb
Each line of the output file contains a single key-value pair.
* Your playbook should:
--> Download the file hwreport.empty from the URL http://classroom.example.com/
hwreport.empty and
save it as /root/hwreport.txt
--> Modify with the correct values.
note: If a hardware item does not exist, the associated value should be set to NONE
----------------------------------------------------------------------------------------------
while practising you to create these file hear. But in exam have to download as per
questation.
hwreport.txt file consists.
my_sys=hostname
my_BIOS=biosversion
my_MEMORY=memory
my_vda=vdasize
my_vdb=vdbsize

正解:

解説:
Solution as:
# pwd
/home/admin/ansible
# vim hwreport.yml
- name:
hosts: all
ignore_errors: yes
tasks:
- name: download file
get_url:
url: http://classroom.example.com/content/ex407/hwreport.empty
dest: /root/hwreport.txt
- name: vdasize
replace:
regexp: "vdasize"
replace: "{{ ansible_facts.devices.vda.size }}"
dest: /root/hwreport.txt
register: op1
- debug:
var: op1
- name: none
replace:
regexp: "vdasize"
replace: NONE
dest: /root/hwreport.txt
when:
op1.failed == true
- name: vdbsize
replace:
regexp: "vdbsize"
replace: "{{ ansible_facts.devices.vdb.size }}"
dest: /root/hwreport.txt
register: op2
- debug:
var: op2
- name: none
replace:
regexp: "vdbsize"
replace: NONE
dest: /root/hwreport.txt
when:
op2.failed == true
- name: sysinfo
replace:
regexp: "{{item.src}}"
replace: "{{item.dest}}"
dest: /root/hwreport.txt
loop:
- src: "hostname"
dest: "{{ ansible_facts.fqdn }}"
- src: "biosversion"
dest: "{{ ansible_facts.bios_version }}"
- src: "memory"
dest: "{{ ansible_facts.memtotal_mb }}"
:wq!
# ansible-playbook hwreport.yml --syntax-check
# ansible-playbook hwreport.yml


質問 # 31
Create a playbook called timesvnc.yml in /home/sandy/ansible using rhel system role timesync. Set the time to use currently configured nip with the server 0.uk.pool.ntp.org. Enable burst. Do this on all hosts.

正解:

解説:
Solution as:


質問 # 32
/ home / sandy / ansible /にjinjaテンプレートを作成し、hosts.j2という名前を付けます。このファイルを編集して、次のようにします。ノードの順序は重要ではありません。次に、hosts.ymlという名前のプレイブックを/ home / sandy / ansibleに作成し、テンプレートを/ root / myhostsの開発ノードにインストールします。

  • A. 解決策:
  • B. 解決策:

正解:B


質問 # 33
提供されたファイルusersjist.ymlファイルにユーザーを作成します。これは、/ home / sandy / ansibleにあるusers.ymlというプレイブックで行います。これらのユーザーのパスワードは、TASK7のlock.ymlファイルを使用して設定する必要があります。プレイブックを実行するときは、ロック.ymlファイルをTASK7のsecret.txtファイルでロック解除する必要があります。
'developer'のジョブを持つすべてのユーザーは、開発ホストで作成し、グループdevopsに追加する必要があります。パスワードは、pw_dev変数を使用して設定する必要があります。同様に、プロキシホストで「manager」のジョブを持つユーザーを作成し、ユーザーをグループ「managers」に追加します。パスワードは、pw_mgr変数を使用して設定する必要があります。

  • A. ansible-playbook users.yml -vault-password-file = secret.txt
  • B. ansible-playbook users.yml -vault-password-file = secret.txt

正解:A


質問 # 34
Create a playbook called balance.yml as follows:
* The playbook contains a play that runs on hosts in balancers host group and uses
the balancer role.
--> This role configures a service to loadbalance webserver requests between hosts
in the webservers host group.curl
--> When implemented, browsing to hosts in the balancers host group (for example
http://node5.example.com) should produce the following output:
Welcome to node3.example.com on 192.168.10.z
--> Reloading the browser should return output from the alternate web server:
Welcome to node4.example.com on 192.168.10.a
* The playbook contains a play that runs on hosts in webservers host group and uses
the phphello role.
--> When implemented, browsing to hosts in the webservers host group with the URL /
hello.php should produce the following output:
Hello PHP World from FQDN
--> where FQDN is the fully qualified domain name of the host. For example,
browsing to http://node3.example.com/hello.php, should produce the following output:
Hello PHP World from node3.example.com
* Similarly, browsing to http://node4.example.com/hello.php, should produce the
following output:
Hello PHP World from node4.example.com

正解:

解説:
Solution as:
# pwd
/home/admin/ansible/
# vim balancer.yml
---
- name: Including phphello role
hosts: webservers
roles:
- ./roles/phphello
- name: Including balancer role
hosts: balancer
roles:
- ./roles/balancer
:wq!
# ansible-playbook balancer.yml --syntax-check
# ansible-playbook balancer.yml


質問 # 35
......

EX294日本語別格な問題集で最上級の成績にさせるEX294日本語問題:https://www.goshiken.com/RedHat/EX294-JPN-mondaishu.html