Create an ansible vault password file called lock.yml with the password reallysafepw in the
/home/sandy/ansible directory. In the lock.yml file define two variables. One is pw_dev and the password is 'dev' and the other is pw_mgr and the password is 'mgr' Create a regular file called secret.txt which contains the password for lock.yml.
Solution:
ansible-vault create lock.yml
New Vault Password: reallysafepw Confirm: reallysafepw
Does this meet the goal?
Correct Answer:
A
Using the Simulation Program, perform the following tasks: Static Inventories Task:
* 1. Add a new group to your default ansible host file. call the group [ec2]
* 2. Add a new host to the new group you created.
* 3. Add a variable to a new host entry in the /etc/ansible/hosts file. Add the following. localhost http_port=80 maxRequestsPerChild=808
* 4. Check to see if maxRequestsPerChild is pulled out with an ad-hoc command.
* 5. Create a local host file and put a target group and then a host into it. Then ping it with an ad-hoc command.
Solution:
* 1. Edit the /etc/ansible/hosts file. Add a group.
* 2. Edit the /etc/ansible/hosts file. Add a user under the group you created.
* 3. Edit the /etc/ansible/hosts file. Find a host. if we add a variable called maxRequestsPerChild to the host it would look like this. host1 maxRequestsPerChild=808
* 4. ansible ec2 -m shell -a "echo {{ maxRequestsPerChild }}"
* 5. Edit a local file. It could be called anything. Lets call it myhosts. Inside the file it would have a host like the following. [mygroup] myusername1.mylabserver.com
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