CORRECT TEXT
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:
Solution as:
Does this meet the goal?
Correct Answer:
A
CORRECT TEXT
===================================================================================
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 Logical volumes with lvm.yml in all nodes according to following requirements.
----------------------------------------------------------------------------------------
* Create a new Logical volume named as 'data'
* LV should be the member of 'research' Volume Group
* LV size should be 1500M
* It should be formatted with ext4 file-system.
--> If Volume Group does not exist then it should print the message "VG Not found"
--> If the VG can not accommodate 1500M size then it should print "LV Can not be created with
following size", then the LV should be created with 800M of size.
--> Do not perform any mounting for this LV.
Solution:
Solution as:
# pwd
/home/admin/ansible
# vim lvm.yml
---
- name: hosts: all
ignore_errors: yes tasks:
- name: lvol:
lv: data
vg: research size: "1500"
- debug:
msg: "VG Not found"
when: ansible_lvm.vgs.research is not defined
- debug:
msg: "LV Can not be created with following size" when: ansible_lvm.vgs.research.size_g < "1.5"
- name: lvol:
lv: data
vg: research size: "800"
when: ansible_lvm.vgs.research.size_g < "1.5"
- name: filesystem: fstype: ext4
dev: /dev/research/data wq!
# ansible-playbook lvm.yml –-syntax-check
# ansible-playbook lvm.yml
Does this meet the goal?
Correct Answer:
A