From cb5fe90499379425bc305a88e3459e16fa7577cb Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 8 Dec 2019 12:29:36 +0200 Subject: [PATCH] Move remote_user to ansible.cfg Command line options override config files like ansible.cfg, but not inventory data or playbook directives. This allows us to over- ride remote_user with `-u` on the command line to log in as root before we have set up the provisioning user. See: https://github.com/ansible/ansible/issues/7841#issuecomment-245716271 --- ansible.cfg | 1 + web.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible.cfg b/ansible.cfg index 992aee1..37a5290 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -4,6 +4,7 @@ force_handlers=True inventory=hosts # instead of using --ask-vault-pass ask_vault_pass=True +remote_user = provisioning ansible_managed = This file is managed by Ansible.%n template: {file} diff --git a/web.yml b/web.yml index 45d7c58..382e827 100644 --- a/web.yml +++ b/web.yml @@ -3,7 +3,6 @@ - name: Configure web servers hosts: web - remote_user: provisioning become: yes roles: - common