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
This commit is contained in:
Alan Orth 2019-12-08 12:29:36 +02:00
parent 5010e56223
commit cb5fe90499
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 1 additions and 1 deletions

View File

@ -4,6 +4,7 @@ force_handlers=True
inventory=hosts inventory=hosts
# instead of using --ask-vault-pass # instead of using --ask-vault-pass
ask_vault_pass=True ask_vault_pass=True
remote_user = provisioning
ansible_managed = This file is managed by Ansible.%n ansible_managed = This file is managed by Ansible.%n
template: {file} template: {file}

View File

@ -3,7 +3,6 @@
- name: Configure web servers - name: Configure web servers
hosts: web hosts: web
remote_user: provisioning
become: yes become: yes
roles: roles:
- common - common