Curated

Automation, Orchestration, and Scripting

0 votes

Questions113

  1. Question 101

    Automation, Orchestration, and Scripting

    Which statement describes an appropriate use of an AI assistant for infrastructure as code?

    Show the answer

    Correct answerB. It drafts a Terraform configuration that an administrator reviews and tests

    AWhy not this: Letting an assistant apply unreviewed changes to production skips review and the plan step that shows what will change.

    BWhy this is right: Drafting IaC is a common use, and a person reviews and tests the output before it is applied.

    CWhy not this: A syntax check does not catch wrong logic, insecure defaults or outdated modules; the playbook still needs testing.

    DWhy not this: Hand-editing state is risky and does not prevent drift; state should be changed through Terraform commands.

    Drafting IaC is a common AI use case, but generated code can contain errors, insecure defaults or outdated syntax. Human review and testing in a non-production environment are required before deployment.

    Open this question
  2. Question 102

    Automation, Orchestration, and Scripting

    A team inherits 40 undocumented Bash backup scripts and needs documentation quickly. Which use of AI BEST matches this task?

    Show the answer

    Correct answerB. Have AI draft comments and a README for each script, then verify them against how the scripts actually behave

    Generating draft documentation from existing code is a standard AI use, provided a person checks it for accuracy. Rewriting in another language is tempting but creates new unreviewed code and does not document the original scripts.

    Open this question
  3. Question 103

    Automation, Orchestration, and Scripting

    An administrator must write a regular expression that extracts the source IP addresses of failed logins from /var/log/auth.log. Which use of AI BEST fits this task?

    Show the answer

    Correct answerA. Ask an AI assistant to draft the expression and explain each part, then test it with grep against sample log lines

    AI is well suited to drafting and explaining regular expressions, but the output must be tested before it is trusted. Pasting the whole log into a public service is tempting, but it exposes sensitive data to an external provider.

    Open this question
  4. Question 104

    Automation, Orchestration, and Scripting

    A deployment script is about to be merged into a shared repository. The team wants to find hardcoded credentials and overly permissive file modes first. Which use of AI BEST fits this task?

    Show the answer

    Correct answerC. Ask AI to scan the script for hardcoded secrets and risky permissions, then have a person validate the findings

    AI-assisted security review can flag secrets and unsafe permissions, with a person confirming the findings. Automatic approval is tempting, but AI can miss issues or report false results, so human accountability must remain.

    Open this question
  5. Question 105

    Automation, Orchestration, and Scripting

    A company handles regulated customer data and wants engineers to use AI for analyzing configuration files and drafting scripts. Which approach BEST reduces the risk of data exposure while still providing AI assistance?

    Show the answer

    Correct answerD. Host an approved local model on internal infrastructure so prompts and files never leave the company's control

    A local, approved model keeps data inside the organization's boundary, which supports data governance. Instructing a public model not to retain data does not bind the provider, and excluding only passwords still allows other regulated data to leave the company.

    Open this question
  6. Question 106

    Automation, Orchestration, and Scripting

    A team lead discovers that several engineers have been pasting internal infrastructure diagrams and API keys into a public AI chatbot to speed up documentation. Which action BEST addresses the root problem going forward?

    Show the answer

    Correct answerA. Define and communicate an AI acceptable-use policy that specifies approved tools and prohibits sharing credentials and confidential data

    The underlying gap is the lack of enforced corporate policy on approved tools and data handling. Shorter prompts still leak confidential data, and yearly key rotation leaves exposed secrets usable for months.

    Open this question
  7. Question 107

    Automation, Orchestration, and Scripting

    A systems administrator wants help troubleshooting an application error. The log file contains customer email addresses and internal hostnames. The company has no approved AI tool. Which action BEST aligns with responsible AI use?

    Show the answer

    Correct answerB. Remove or mask the sensitive data and confirm the use is permitted by corporate policy before sharing any log content with an AI tool

    Data governance and corporate policy come first: sensitive data must be masked and the use must be permitted. Encryption in transit does not stop a public service from storing the data or using it for model training, and deleting history afterward does not undo the disclosure.

    Open this question
  8. Question 108

    Automation, Orchestration, and Scripting

    An administrator receives a log-rotation shell script from an AI assistant for a production Linux server. What should the administrator do before running it there?

    Show the answer

    Correct answerD. Review the code and test it on a non-production system

    AWhy not this: Running unreviewed code as root raises the damage any mistake in it can do.

    BWhy not this: The assistant's own answer is not verification; it can be confidently wrong about its code.

    CWhy not this: A quiet window lowers the impact but still tests unreviewed code on the production system.

    DWhy this is right: A person reads the code and tests it safely before it touches production.

    AI output can contain errors, outdated syntax or destructive commands, so human review and testing in a safe environment are required before production use. Trusting the assistant's confidence is not a substitute for verification.

    Open this question
  9. Question 109

    Automation, Orchestration, and Scripting

    An administrator asks an AI assistant for a command to clean up old files on a file server. It returns a command using find with -delete and a broad path. The administrator is confident the command is correct because the assistant explained it clearly. What should the administrator do FIRST?

    Show the answer

    Correct answerD. Verify the command against the man page, then test it without -delete or on non-critical data to confirm what it would affect

    AI output must be verified against authoritative documentation and tested safely before use, for example by listing matches instead of deleting. Asking the same assistant to confirm is not independent verification, and a fluent explanation does not prove correctness.

    Open this question
  10. Question 110

    Automation, Orchestration, and Scripting

    An AI assistant returns a patching script that calls apt-get, but the target server runs Rocky Linux 9. Which follow-up prompt is the BEST way to refine the result?

    Show the answer

    Correct answerD. The target is Rocky Linux 9, which uses dnf. Rewrite the script with dnf and keep the rest of the logic unchanged.

    An iterative follow-up that states the missing context and what to preserve lets the model correct only the faulty part. Telling it to try again gives no direction, so the same mistake is likely to recur.

    Open this question
  11. Question 111

    Automation, Orchestration, and Scripting

    An administrator wants an AI assistant to convert free-form sshd log lines into CSV with the columns timestamp,user,source_ip,result. Which prompting technique is MOST likely to produce consistent output across many lines?

    Show the answer

    Correct answerD. Include a few sample log lines, each paired with the exact CSV row expected, before the lines to convert.

    Input/output examples (few-shot prompting) show the model the exact format and field mapping to follow. Supplying only raw lines and relying on 'usual conventions' leaves the column order and values open to interpretation.

    Open this question
  12. Question 112

    Automation, Orchestration, and Scripting

    An administrator will pipe an AI assistant's answer directly into jq in an automation workflow that lists failed systemd units. Which addition to the prompt BEST ensures the response can be parsed without manual editing?

    Show the answer

    Correct answerD. Return only a JSON array of objects with the keys unit and state, with no surrounding text or code fences.

    Stating the exact output structure and forbidding extra text makes the response machine-readable. Assigning a role improves tone and expertise but does not enforce a format, so the output could still contain prose that breaks jq.

    Open this question
  13. Question 113

    Automation, Orchestration, and Scripting

    An administrator needs an AI assistant to draft a script that compresses application logs older than 14 days on a RHEL 9 server. Which prompt is MOST likely to produce a usable first draft?

    Show the answer

    Correct answerC. Write a Bash script for RHEL 9 that gzips files in /var/log/myapp older than 14 days and reports each action to syslog.

    A prompt that names the shell, distribution, path, age threshold and logging behavior gives the model the context and constraints it needs. The vague options only state goals or quality ('production-grade', 'no bugs') and leave the model to guess the details.

    Open this question