如何使用ansible的用户选项 - ssh_key_bits?

时间:2014-04-14 05:49:12

标签: ansible

是否有关于如何使用ssh_key_bits选项为用户提供SSH密钥的示例?

该文档仅指定了密码'选项并搜索' ssh_key_bits'在Google上只有5页,但没有一页有用。

1 个答案:

答案 0 :(得分:1)

当然你可以尝试这样的事情:

---
- name: Create User with ssh key bits
  hosts: all
  user: youruser
  sudo: True

  tasks:
    - name: Create user
      user: name=newuser generate_ssh_key=yes ssh_key_bits=4096