PrepAway - Latest Free Exam Questions & Answers

Which use of the ansible-playbook command on the provided playbook will result in ONLY editing the file /var/w

Consider the following playbook:

# playbook name: /home/ansible/web.yml

– hosts: webservers
become: yes

tasks:
– name: edit file 1
lineinfile:
path: /var/www/content.hml line: “{{ text }}” tags:
– content
– name: edit file 2
lineinfile: path: /var/www/index.hml
line: “{{ text }}”

tags:
– web
– name: edit file 3
lineinfile:
path: /var/www/etc.hml
line: “{{ text }}”
tags: – content – misc

Which use of the ansible-playbook command on the provided playbook will result in ONLY editing the file /var/www/index.html?

A. ansible-playbook /home/ansible/web.yml
B. ansible-playbook /home/ansible/web.yml –skip-tags web

C. ansible-playbook /home/ansible/web.yml –skip-tags content

D. ansible-playbook /home/ansible/web.yml –tags content

Explanation:
This command skips the two tasks editing other files and only allows the task that is editing /var/www/index.html to run.


Leave a Reply

Your email address will not be published. Required fields are marked *