EX294 · Question #9
EX294 Question #9: Real Exam Question with Answer & Explanation
Sign in or unlock EX294 to reveal the answer and full explanation for question #9. The question stem and answer options stay visible for context.
Question
09. Creating and Using Logical Volumes Create a playbook named /home/greg/ansible/lv.yml that will run on all managed nodes to perform the following tasks: Create a logical volume that meets the following requirements: - The logical volume is created in the research volume group. - The size of the logical volume is 1500 MiB. - Format the logical volume using the ext4 file system. - If unable to create the requested size for the logical volume, display an error message and fallback to using a size of 800MiB. - Could not create logical volume of that size - Display an error message if the volume group research does not exist. - Volume group does not exist - Do not mount the logical volume in any way. Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: [greg@control ansible]$ ansible-navigator doc community.general.lvol -m stdout [greg@control ansible]$ ansible-navigator doc community.general.filesystem -m stdout [greg@control ansible]$ ansible-doc debug [greg@control ansible]$ ansible-doc stat [greg@control ansible]$ vim /home/greg/ansible/lv.yml --- - name: Create LVM hosts: all tasks: - block: - name: lv 1500M community.general.lvol: vg: research lv: data size: 1500 - name: Create ext4 community.general.filesystem: fstype: ext4 dev: /dev/research/data rescue: - name: Could not create lvm ansible.builtin.debug: msg: Could not create logical volume of that size - name: lv 800M community.general.lvol: vg: research lv: data size: 800 - name: Create ext4 community.general.filesystem: fstype: ext4 dev: /dev/research/data when: ansible_lvm.vgs.research is defined - debug: msg: Volume group done not exist when: ansible_lvm.vgs.research is not defined [greg@control ansible]$ ansible-navigator run /home/greg/ansible/lv.yml -m stdout # Observing the execution process of the Ansible playbook to determine if it meets the requirements, and combining it with the 'blkid' command for verification (mandatory operation). [greg@control ansible]$ ansible all -m shell -a 'lvs' [greg@control ansible]$ ansible all -m shell -a 'blkid /dev/research/data'
Unlock EX294 to see the answer
You've previewed enough free EX294 questions. Unlock EX294 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.