I'm not sure what exactly is the problem? You basically need to login as 
root, create a user and than give it sudo permissions to run everything as 
root. For that I would recommend that you create a playbook for 
bootstrapping your server with something like this:

---- hosts: servername  remote_user: root  tasks:    - name: create ansible 
user for managing host      user: name=ansible comment="Ansible User"

    - name: give ansible user sudo rights      lineinfile: dest=/etc/sudoers
                  state=present
                  regexp='^ansible ALL\='
                  line='ansible ALL=(ALL) NOPASSWD:ALL'
                  validate='visudo -cf %s'

Than in ansible.cfg you set remote_user = ansible (so that you don't have 
to set remote_user in every playbook) and in playbooks use sudo: yes, like 
this:

---
- hosts: servername
  sudo: yes
  - tasks:
    - name: ...




On Sunday, April 20, 2014 10:24:25 PM UTC+2, Daniel Charbonneau wrote:
>
> The remote machine I am logging into currently only allows me to login via 
> root, but I'd like to create another user and perform configurations as 
> this user. I don't know how to do this, would someone point me to a few 
> resources explaining this, or if someone is willing to explain via email, I 
> would appreciate this too!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fca11edd-cf59-49a7-b366-61771225ae0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to