EX407 Password Practice Questions
The free EX407: Red Hat Certified Specialist in Ansible Automation questions that deal with password, with answers and explanations. The full bank and the timed practice test cover every topic the exam asks about.
Question #1
=================================================================================== control.realmX.example.com _ workstation.lab.example.com node1.realmX.example.com _ servera.lab.example.com node2.realmX.example.com _ serverb.lab.example.com node3.realmX.example.com _ serverc.lab.example.com node4.realmX.example.com _ serverd.lab.example.com node5.realmX.example.com - username:root, password:redhat - username:admin, password:redhat note1. don't change "root" or "admin" password. note2. no need to create ssh-keygen for access, its pre-defined note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts. =================================================================================== Install the RHEL system roles package and create a playbook called timesync.yml that: --> Runs over all managed hosts. --> Uses the timesync role. --> Configures the role to use the time server 192.168.10.254 ( Hear in redhat lab use "classroom.example.com" ) --> Configures the role to set the iburst parameter as enabled.
Type your answer, then reveal.
Correct answer: A
Explanation
Solution as: # pwd home/admin/ansible/ # sudo yum install rhel-system-roles.noarch -y # cd roles/ # ansible-galaxy list # cp -r /usr/share/ansible/roles/rhelsystem-roles.timesync . # vim timesync.yml --- - name: timesynchronization hosts: all vars: timesync_ntp_provider: chrony timesync_ntp_servers: - hostname: classroom.example.com _ in exam its ip-address iburst: yes timezone: Asia/Kolkata roles: - rhel-system-roles.timesync tasks: - name: set timezone timezone: name: "{{ timezone }}" wq! timedatectl list-timezones | grep india # ansible-playbook timesync.yml --syntax-check # ansible-playbook timesync.yml # ansible all -m shell -a 'chronyc sources -v' # ansible all -m shell -a 'timedatectl' # ansible all -m shell -a 'systemctl is-enabled chronyd'
Question #3
=================================================================================== control.realmX.example.com _ workstation.lab.example.com node1.realmX.example.com _ servera.lab.example.com node2.realmX.example.com _ serverb.lab.example.com node3.realmX.example.com _ serverc.lab.example.com node4.realmX.example.com _ serverd.lab.example.com node5.realmX.example.com - username:root, password:redhat - username:admin, password:redhat note1. don't change "root" or "admin" password. note2. no need to create ssh-keygen for access, its pre-defined note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts. =================================================================================== 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
Type your answer, then reveal.
Correct answer: A
Explanation
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
Question #5
=================================================================================== control.realmX.example.com _ workstation.lab.example.com node1.realmX.example.com _ servera.lab.example.com node2.realmX.example.com _ serverb.lab.example.com node3.realmX.example.com _ serverc.lab.example.com node4.realmX.example.com _ serverd.lab.example.com node5.realmX.example.com - username:root, password:redhat - username:admin, password:redhat note1. don't change "root" or "admin" password. note2. no need to create ssh-keygen for access, its pre-defined note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts. =================================================================================== Create user accounts ------------------------ --> A list of users to be created can be found in the file called user_list.yml which you should download from http://classroom.example.com/user_list.yml and save to /home/admin/ansible/ --> Using the password vault created elsewhere in this exam, create a playbook called create_user.yml that creates user accounts as follows: --> Users with a job description of developer should be: --> created on managed nodes in the "dev" and "test" host groups assigned the password from the "dev_pass" variable and these user should be member of supplementary group "devops". --> Users with a job description of manager should be: --> created on managed nodes in the "prod" host group assigned the password from the "mgr_pass" variable and these user should be member of supplementary group "opsmgr" --> Passwords should use the "SHA512" hash format. Your playbook should work using the vault password file created elsewhere in this exam. while practising you to create these file hear. But in exam have to download as per questation. user_list.yml file consist: --- user: - name: user1 job: developer - name: user2 job: manager
Type your answer, then reveal.
Correct answer: A
Explanation
Solution as: # pwd /home/admin/ansible # wget http://classroom.example.com/user_list.yml # cat user_list.yml # vim create_user.yml --- - name: hosts: all vars_files: - ./user_list.yml - ./vault.yml tasks: - name: creating groups group: name: "{{ item }}" state: present loop: - devops - opsmgr - name: creating user user: name: "{{ item.name }}" state: present groups: devops password: "{{ dev_pass|password_hash ('sha512') }}" loop: "{{ user }}" when: (inventory_hostname in groups['dev'] or inventory_hostname in groups['test']) and item.job == "developer" - name: creating user user: name: "{{ item.name }}" state: present groups: opsmgr password: "{{ mgr_pass|password_hash ('sha512') }}" loop: "{{ user }}" when: inventory_hostname in groups['prod'] and item.job == "manager" wq! # ansible-playbook create_user.yml -–vault-password-file=password.txt -–syntax-check # ansible-playbook create_user.yml -–vault-password-file=password.txt
Question #6
=================================================================================== control.realmX.example.com _ workstation.lab.example.com node1.realmX.example.com _ servera.lab.example.com node2.realmX.example.com _ serverb.lab.example.com node3.realmX.example.com _ serverc.lab.example.com node4.realmX.example.com _ serverd.lab.example.com node5.realmX.example.com - username:root, password:redhat - username:admin, password:redhat note1. don't change "root" or "admin" password. note2. no need to create ssh-keygen for access, its pre-defined note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts. =================================================================================== Create and run an Ansible ad-hoc command. --> As a system administrator, you will need to install software on the managed nodes. --> Create a shell script called yum-pack.sh that runs an Ansible ad-hoc command to create yum-repository on each of the managed nodes as follows: --> repository1 ----------- * 1. The name of the repository is EX407 * 2. The description is "Ex407 Description" * 3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/ * 4. GPG signature checking is enabled * 5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release * 6. The repository is enabled --> repository2 ----------- * 1. The name of the repository is EXX407 * 2. The description is "Exx407 Description" * 3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/AppStream/ * 4. GPG signature checking is enabled * 5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release * 6. The repository is enabled
Type your answer, then reveal.
Correct answer: A
Explanation
Solution as: # pwd /home/admin/ansible # vim yum-pack.sh #!/bin/bash ansible all -m yum_repository -a 'name=EX407 description="Ex407 Description" baseurl=http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/ gpgcheck=yes gpgkey=http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release enabled=yes' ansible all -m yum_repository -a 'name=EXX407 description="Exx407 Description" baseurl=http://content.example.com/rhel8.0/x86_64/dvd/AppStream/ gpgcheck=yes gpgkey=http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release enabled=yes' !wq # chmod +x yum-pack.sh # bash yum-pack.sh # ansible all -m command -a 'yum repolist all'
Continue with EX407: Red Hat Certified Specialist in Ansible Automation exam
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in EX407: Red Hat Certified Specialist in Ansible Automation exam, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
All EX407: Red Hat Certified Specialist in Ansible Automation practice questions →
