Creating an Ansible-Ready Proxmox VE OpenVZ template

Alongside with the instructions on creating a customized template, also:

  1. Create the user “ansible”.

    adduser ansible 
    mkdir /home/ansible/.ssh 
    echo "YOURSSSHKEYHERE" > /home/ansible/.ssh/authorized_keys 
    chown -R ansible:ansible /home/USERNAME/.ssh 
    chmod 600 /home/ansible/.ssh/authorized_keys
    
  2. Add it to the sudoer’s list:

    cat > /etc/sudoers.d/ansible <<!ENDSUDOERS 
    ansible ALL=(ALL) NOPASSWD: ALL 
    !ENDSUDOERS 
    chmod 440 /etc/sudoers.d/ansible
    

Leave a Reply

Your email address will not be published. Required fields are marked *