Below are the answers for Exam Scenario 3.
mkdir {inventories,playbooks,roles,files,templates}
ansible.cfg
Ini
1[defaults]2remote_user = vagrant3roles_path = ./roles4inventory = ./inventories/lab_inventory.ini5ask_pass = true67[privilege_escalation]8become = true9become_ask_pass = false10become_method = sudo11become_user = root
inventories/lab_inventory.ini
Ini
1[repo]2repo.ansi.example.com34[control]5control.ansi.example.com ansible_connection=local67[dv]8node1.ansi.example.com9node3.ansi.example.com1011[qa]12node2.ansi.example.com13node4.ansi.example.com1415[webserver]16node[1:3].ansi.example.com1718[sqlserver]19node4.ansi.example.com
sudo dnf install -y rhel-system-roles
Ini
1roles_path = ./roles:/usr/share/ansible/roles
playbooks/setup-ssh.yml
YAML
1---2- hosts: control3become: true45tasks:6- name: "Configure ssh clients"7include_role:8name: rhel-system-roles.ssh9vars:10ssh_user: vagrant11ssh:12StrictHostKeyChecking: no
playbooks/kernel-parameters.yml
YAML
1---2- hosts: dv3become: true45vars:6kernel_settings_sysctl:7- name: fs.file-max8value: 4000009- name: kernel.threads-max10value: 6553611roles:12- rhel-system-roles.kernel_settings