Create an empty encrypted file calledmyvault.yml in /home/sandy/ansibleand set the passwordtonotsafepw. Rekey the passwordtoiwejfj2221.
Solution:
ansible-vault create myvault.yml
Create new password: notsafepw Confirm password: notsafepwansible-vault rekeymyvault.yml
Current password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221
Does this meet the goal?
Correct Answer:
A
Create the users in the fileusersjist.ymlfile provided. Do this in a playbook called users.yml located at
/home/sandy/ansible.The passwords for these users should be set using thelock.ymlfile from TASK7. When running the playbook, the lock.yml file should be unlocked withsecret.txtfile from TASK 7.
All users with the job of 'developer' should be created on thedevhosts, add them to the group devops, their password should be set using thepw_devvariable. Likewise create users with the job of 'manager' on theproxy
host and add the users to the group 'managers', their password should be set using thepw_mgrvariable.
Solution:
ansible-playbook users.yml –vault-password-file=secret.txt
Does this meet the goal?
Correct Answer:
A
Create a file called requirements.yml in/home/sandy/ansible/roles to install two roles. The source for the first role is geerlingguy.haproxy and geerlingguy.php. Name the first haproxy-role and the second php-role. The roles should be installed in /home/sandy/ansible/roles.
Solution:
in /home/sandy/ansible/roles vim requirements.yml
Run the requirements file from the roles directory:
ansible-galaxy install -r requirements.yml -p/home/sandy/ansible/roles
Does this meet the goal?
Correct Answer:
A
Create a playbook calledtimesvnc.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:
See the explanation forcomplete Solution below.
Explanation
Solution as:
Does this meet the goal?
Correct Answer:
A
Create a Shell script /root/program:
The shell script will come back to ”user” parameter when you are entering ”kernel” parameter.
The shell script will come back to ”kernel” when you are entering ”user” parameter.
It will output the standard error when this script ”usage:/root/program kernel|user” don’t input any parameter or the parameter you inputted is entered as the requirements.
Solution:
Does this meet the goal?
Correct Answer:
A