diff --git a/knowledge base/awx.md b/knowledge base/awx.md index dfc1a68..076f308 100644 --- a/knowledge base/awx.md +++ b/knowledge base/awx.md @@ -8,6 +8,7 @@ 1. [Removal](#removal) 1. [Testing](#testing) 1. [Executing jobs](#executing-jobs) +1. [Elevating privileges in tasks](#elevating-privileges-in-tasks) 1. [Workflow automation](#workflow-automation) 1. [Pass data between workflow nodes](#pass-data-between-workflow-nodes) 1. [API](#api) @@ -860,6 +861,38 @@ resource limits. +## Elevating privileges in tasks + +AWX requires one to configure specific settings throughout its resources in order to be able to successfully use +`become` and privileges-related keys in playbooks. + +1. The playbook must be configured to elevate privileges as per normal Ansible operations. + +
+ + ```yml + - name: Do something by escalating privileges + hosts: all + become: true + tasks: [] + ``` + +
+ +1. The Job Template referencing the playbook must have the _Privilege Escalation_ option **enabled**. + +
+ + This corresponds to providing the `--become` flag when running the playbook. + +
+ +1. The Credential used in the Job (either in the Job Template or whatever overrides them) must specify a user that is + able to run `sudo` (or whatever `become_method` the playbook uses). + + > [!important] + > Should the `become_method` require a password, one must also supply that password in the Credential. + ## Workflow automation Refer [How to use workflow job templates in Ansible], [Workflow job templates] and [Workflows].