EX294 Exam Question 1

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
  • EX294 Exam Question 2

    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.
  • EX294 Exam Question 3

    Install and configure ansible
    User bob has been created on your control node. Give him the appropriate permissions on the control node. Install the necessary packages to run ansible on the control node.
    Create a configuration file /home/bob/ansible/ansible.cfg to meet the following requirements:
    * The roles path should include /home/bob/ansible/roles, as well as any other path that may be required for the course of the sample exam.
    * The inventory file path is /home/bob/ansible/inventory.
    * Ansible should be able to manage 10 hosts at a single time.
    * Ansible should connect to all managed nodes using the bob user.
    Create an inventory file for the following five nodes:
    nodel.example.com
    node2.example.com
    node3.example.com
    node4.example.com
    node5.example.com
    Configure these nodes to be in an inventory file where node1 is a member of group dev. nodc2 is a member of group test, nodc3 is a member of group proxy, nodc4 and node 5 are members of group prod. Also, prod is a member of group webservers.
  • EX294 Exam Question 4

    Create a playbook called issue.yml in /home/sandy/ansible which changes the file /etc/issue on all managed nodes: If host is a member of (lev then write "Development" If host is a member of test then write "Test" If host is a member of prod then write "Production"
  • EX294 Exam Question 5

    Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which creates and serves a message from /var/www/html/index.html Whenever the content of the file changes, restart the webserver service.
    Welcome to [FQDN] on [IP]
    Replace the FQDN with the fully qualified domain name and IP with the ip address of the node using ansible facts. Lastly, create a playbook in /home/sandy/ansible/ called apache.yml and use the role to serve the index file on webserver hosts.